-
Notifications
You must be signed in to change notification settings - Fork 880
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: Modify validation to check Analysis args passed through RO spec #1215
Changes from all commits
c5a0b0e
08acecd
57c7cff
9f6869a
bf51479
446ffb2
2e13c8a
465c8b1
8e308b9
5a2cc9b
f63126f
8edb7c9
c336bd3
c45d05a
4361809
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -636,6 +636,7 @@ func (c *rolloutContext) getReferencedRolloutAnalyses() (*[]validation.AnalysisT | |
if err != nil { | ||
return nil, err | ||
} | ||
templates.Args = blueGreen.PrePromotionAnalysis.Args | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on this? I thought we did this anyway when we created the AnalysisRun from the templates (i.e. combine the templates’ args with the AnalysisRunArguments passed through the RO spec) in the function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't believe so. I'm copying the AnalysisRunArguments from the Rollout Spec into a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Can you confirm that this is the behavior? kind: AnalysisTemplate
...
args:
- name: aaa
value: foo # default value
- name: bbb # mandatory supplied value
- name: ccc
value: baz Args supplied by rollout (note that aaa is omitted) kind: Rollout
...
args:
- name: bbb
value: "11111"
- name: ccc
value: "2222" The AnalysisRun should be created with kind: AnalysisRun
args:
- name: aaa
value: foo
- name: bbb
value: "11111"
- name: ccc
value: "2222" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I took a closer look. You're right. I mistakenly thought it was returning AnalysisTemplates There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jessesuen Can I merge this in then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My first concern is not valid, but can you answer my second concern? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jessesuen Yes, I confirm that the behavior in this comment is what happens. |
||
analysisTemplates = append(analysisTemplates, *templates) | ||
} | ||
|
||
|
@@ -645,13 +646,15 @@ func (c *rolloutContext) getReferencedRolloutAnalyses() (*[]validation.AnalysisT | |
if err != nil { | ||
return nil, err | ||
} | ||
templates.Args = blueGreen.PostPromotionAnalysis.Args | ||
analysisTemplates = append(analysisTemplates, *templates) | ||
} | ||
} else if c.rollout.Spec.Strategy.Canary != nil { | ||
canary := c.rollout.Spec.Strategy.Canary | ||
for i, step := range canary.Steps { | ||
if step.Analysis != nil { | ||
templates, err := c.getReferencedAnalysisTemplates(c.rollout, step.Analysis, validation.InlineAnalysis, i) | ||
templates.Args = step.Analysis.Args | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
@@ -663,6 +666,7 @@ func (c *rolloutContext) getReferencedRolloutAnalyses() (*[]validation.AnalysisT | |
if err != nil { | ||
return nil, err | ||
} | ||
templates.Args = canary.Analysis.Args | ||
analysisTemplates = append(analysisTemplates, *templates) | ||
} | ||
} | ||
|
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.
it seems this method can be removed as this is the only place to use it.