mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-09 09:17:27 +00:00
Merge pull request #911 from fluxcd/select-numeric-validation
Validate if only one image policy selector is given
This commit is contained in:
commit
cfad9a19eb
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Reference in a new issue