Skip to content
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

Merged
merged 10 commits into from
Jul 10, 2020

Conversation

khhirani
Copy link
Contributor

@khhirani khhirani commented Jul 9, 2020

Closes #576

@khhirani khhirani changed the title Rollout Validation Fix fix: Populate .spec.template with default values before Rollout Validation Jul 9, 2020
@khhirani khhirani requested review from dthomson25 and jessesuen July 9, 2020 22:22
Copy link
Member

@dthomson25 dthomson25 left a 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
Copy link
Member

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.

@khhirani khhirani merged commit 9257fac into argoproj:master Jul 10, 2020
@khhirani khhirani deleted the ro-validation-fix branch July 10, 2020 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Examples don't work with master controller
2 participants