-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Populate .spec.template with default values before Rollout Validation #580
Conversation
…alues before validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment on your comment, but otherwise LGTM
@@ -77,7 +79,15 @@ func ValidateRolloutSpec(rollout *v1alpha1.Rollout, fldPath *field.Path) field.E | |||
if err != nil { | |||
allErrs = append(allErrs, field.Invalid(fldPath.Child("selector"), spec.Selector, "invalid label selector")) | |||
} else { | |||
data, structConvertErr := json.Marshal(&spec.Template) | |||
// Set default values in PodTemplate to address issue https://github.com/argoproj/argo-rollouts/issues/576 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add something like:
The upstream K8s validation we are using expects the default values of a PodSpec to be set otherwise throwing a validation error. However, the Rollout does not need to have them set since the ReplicaSet it creates will have the default values set. As a result, the controller sets the default values before validation to prevent the validation errors due to the lack of these default fields. See #576 for more info.
Closes #576