mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-09 17:27:28 +00:00
Validate if only 1 image policy selector is given
Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
parent
e4c3136433
commit
73b8a26850
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