Skip to content

Commit

Permalink
Merge pull request #3766 from RuliXu/automated-cherry-pick-of-#3739-u…
Browse files Browse the repository at this point in the history
…pstream-release-1.6

Automated cherry pick of #3739: fix: when application failover is enabled but propagateDeps
  • Loading branch information
karmada-bot authored Jul 5, 2023
2 parents c31e161 + 7424a0f commit fdc7ac6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/util/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const LabelValueMaxLength int = 63
func ValidatePropagationSpec(spec policyv1alpha1.PropagationSpec) field.ErrorList {
var allErrs field.ErrorList
allErrs = append(allErrs, ValidatePlacement(spec.Placement, field.NewPath("spec").Child("placement"))...)
if spec.Failover != nil && spec.Failover.Application != nil && !spec.PropagateDeps {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("propagateDeps"), spec.PropagateDeps, "application failover is set, propagateDeps must be true"))
}
allErrs = append(allErrs, ValidateFailover(spec.Failover, field.NewPath("spec").Child("failover"))...)
return allErrs
}
Expand Down

0 comments on commit fdc7ac6

Please sign in to comment.