-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Create func to reset awsCloudInstances #15316
Create func to reset awsCloudInstances #15316
Conversation
|
Welcome @ltellesfl! |
Hi @ltellesfl. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Hey folks! Any updates about this? |
@@ -234,10 +234,14 @@ func (c *awsCloudImplementation) Region() string { | |||
return c.region | |||
} | |||
|
|||
var awsCloudInstances map[string]AWSCloud = make(map[string]AWSCloud) | |||
var AWSCloudInstances = NewAWSCloudInstances() |
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.
Making this one public doesn't seem like a good idea. Perhaps create a function for setting a specific AWSCloud
to a specific region.
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.
The problem is not the region, it's the AWS account. The region is the same but not the account, the second time it runs it keeps the credentials for the account that was set on the first run. When NewAWSCloud() func runs the second time it will not create again the clients because of this if. Since we want to use multi-account we need to reset those clients to use with a different AWS account, here is an example of how we did using a fork with the proposed changes.
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.
Yes, I figured that. So what I am proposing is that you can create a new AWSCloud instance for the same region rather than just resetting the map and rerun the entire instantiation logic.
Alternatively, make a public function that resets the private map. Either is better than opening the whole map up for manipulation anywhere in the code.
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.
I created the public function to reset the map, thanks for the suggestion, makes much more sense than having the map public
Hello, any updates? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: olemarkus The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
Since we use kops as lib, we need to reset this variable so that we can create clients with another AWS account.
Here is an example that also follows the same idea and was recently changed:
https://github.com/kubernetes/kops/blob/v1.26.2/util/pkg/vfs/context.go#L65