Bug 1907947: cloud-creds-secret creation with current context info only#4484
Conversation
|
@nirarg: This pull request references Bugzilla bug 1907947, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Hi @staebler , |
|
@nirarg: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
staebler
left a comment
There was a problem hiding this comment.
Looks good. Just some nits.
/approve
There was a problem hiding this comment.
| var currentContextValue *clientcmdapi.Context | |
| for k, v := range rawConfig.Contexts { | |
| if k != rawConfig.CurrentContext { | |
| delete(rawConfig.Contexts, k) | |
| } else { | |
| currentContextValue = v | |
| } | |
| } | |
| if currentContextValue == nil { | |
| return nil, fmt.Errorf("currentContext is not included in rawConfig.Contexts") | |
| } | |
| currentContextValue := rawConfig.Contexts[rawConfig.CurrentContext] | |
| if currentContextValue == nil { | |
| return nil, fmt.Errorf("currentContext is not included in rawConfig.Contexts") | |
| } | |
| rawConfig.Contexts = map[string]*clientcmdapi.Context{ | |
| rawConfig.CurrentContext: currentContextValue, | |
| } |
There was a problem hiding this comment.
| for k := range rawConfig.Clusters { | |
| if k != currentContextValue.Cluster { | |
| delete(rawConfig.Clusters, k) | |
| } | |
| } | |
| if v, ok := rawConfig.Clusters[currentContextValue.Cluster]; ok { | |
| rawConfig.Clusters = map[string]*clientcmdapi.Cluster{ | |
| currentContextValue.Cluster: v | |
| } | |
| } |
Do a similar thing for AuthInfos, as well.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: staebler The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…e anything that is not related to the current context from the result rawConfig
5e19612 to
c45442e
Compare
|
/retest |
|
/lgtm |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@nirarg: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@nirarg: All pull requests linked via external trackers have merged: Bugzilla bug 1907947 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
No description provided.