-
Notifications
You must be signed in to change notification settings - Fork 271
fix(operations): use resolved component for switchover runtime #10568
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
base: main
Are you sure you want to change the base?
Changes from all commits
47e57d6
20ffba8
95b4972
d46081b
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 |
|---|---|---|
|
|
@@ -47,6 +47,12 @@ type lifecycleAction interface { | |
| parameters(ctx context.Context, cli client.Reader) (map[string]string, error) | ||
| } | ||
|
|
||
| // authoritativeActionParameters marks action parameters that are defined by | ||
| // the runtime contract and therefore cannot be overridden by template vars. | ||
| type authoritativeActionParameters interface { | ||
| authoritativeActionParameters() | ||
| } | ||
|
|
||
| type kbagent struct { | ||
| namespace string | ||
| clusterName string | ||
|
|
@@ -302,11 +308,17 @@ func (a *kbagent) parameters(ctx context.Context, cli client.Reader, lfa lifecyc | |
| return nil, err | ||
| } | ||
|
|
||
| for k, v := range sys { | ||
| // template vars take precedence | ||
| if _, ok := m[k]; !ok { | ||
| if _, authoritative := lfa.(authoritativeActionParameters); authoritative { | ||
| for k, v := range sys { | ||
| m[k] = v | ||
|
Collaborator
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. [P1] This authoritative assignment can still be undone by |
||
| } | ||
| } else { | ||
| for k, v := range sys { | ||
| // template vars take precedence for existing lifecycle actions. | ||
| if _, ok := m[k]; !ok { | ||
| m[k] = v | ||
| } | ||
| } | ||
| } | ||
| addShellSafeParameterAliases(m) | ||
| return m, nil | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.