Merge pull request #911 from fluxcd/select-numeric-validation

Validate if only one image policy selector is given
pull/914/head
Hidde Beydals 4 years ago committed by GitHub
commit cfad9a19eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -102,7 +102,9 @@ func createImagePolicyRun(cmd *cobra.Command, args []string) error {
switch {
case imagePolicyArgs.semver != "" && imagePolicyArgs.alpha != "":
return fmt.Errorf("policy cannot be specified with both --select-semver and --select-alpha")
case imagePolicyArgs.semver != "" && imagePolicyArgs.numeric != "":
case imagePolicyArgs.alpha != "" && imagePolicyArgs.numeric != "":
return fmt.Errorf("only one of --select-semver, --select-alpha or --select-numeric can be specified")
case imagePolicyArgs.semver != "":
policy.Spec.Policy.SemVer = &imagev1.SemVerPolicy{
Range: imagePolicyArgs.semver,

Loading…
Cancel
Save