-
Notifications
You must be signed in to change notification settings - Fork 1
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 a aws.Config
with region to be able to work different AWS partition (like gov cloud or china AWS partition)
#588
Conversation
aws.Config
with region to be able to use different AWS partition (like gov or china AWS partition)aws.Config
with region to be able to work different AWS partition (like gov or china AWS partition)
aws.Config
with region to be able to work different AWS partition (like gov or china AWS partition)aws.Config
with region to be able to work different AWS partition (like gov cloud or china AWS partition)
Where was the bug here? You're now supplying the region explicitly, but I guess that should be provided by CAPA to every AWS "create {instance,NAT gateway,...}" request. What's the relation to the partition (which is |
The bug is not providing the region to the AWS client because if you do not do that on the client creation it will fail with INVALID credentials, as it cannot validate the credentials - since it is connecting to the AWS global and not connecting to the AWS CHINA partition Access keys generated in the China partition are not valid access keys in AWS global and by trying to check the validity of keys without using the region(which will tell the AWS client which partition to use) it will always use AWS global for and in our case it will fail to validate them. Resulting in non-recoverable error which stops any reconcilation. |
here is the error log, after lot of debugging and injecting a debug output I localized it into that function where the PR fixes it
|
@@ -140,6 +140,7 @@ github.com/ahmetb/gen-crd-api-reference-docs v0.3.0/go.mod h1:TdjdkYhlOifCQWPs1U | |||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= | |||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= | |||
github.com/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0= | |||
github.com/alecthomas/participle/v2 v2.1.0/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c= |
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.
this smells like a go mod tidy
is needed?
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 actually run go mod tidy and it did nothing
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 will just remove this , maybe my IDE does something fishy
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.
sounds legit
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.
Sounds reasonable to me. I think this is hard to test. Let's include the hotfix in our fork, and then please try to upstream it. Maybe a maintainer has more experience with this part of the code and can tell if it's problematic.
Did you test this change with cluster creation in China and non-China? That should be the minimum we do before merging.
Yes, as stated in the first message I tested in China and on |
…partition (like gov cloud or china AWS partition) (#588) * create-aws-client-with-region
* Add Giant Swarm fork modifications * Push to Azure registry * aws-cni-deleted-helm-managed-resources * import-order * Filter CNI subnets when creating EKS NodeGroup * add godoc * 🐛 Create a `aws.Config` with region to be able to work different AWS partition (like gov cloud or china AWS partition) (#588) * create-aws-client-with-region * 🐛 Add ID to secondary subnets (#589) * give name to secondary subnets * make linter happy * Add non root volumes to AWSMachineTemplate * Support adding custom secondary VPC CIDR blocks in `AWSCluster` (backport) (#590) * S3 user data support for `AWSMachinePool` (#592) * Delete machine pool user data files that did not get deleted yet by the lifecycle policy (#593) * Delete machine pool user data files that did not get deleted yet by the lifecycle policy * Use paging for S3 results * Log S3 list operation * Handle NotFound * Remove duplicated argument * Add `make test` to Circle CI build, S3 test fixes (#596) * Cancel instance refresh on any relevant change to ASG instead of blocking until previous one is finished (which may have led to failing nodes due to outdated join token) (#598) * Use feature gate for S3 storage (#599) * Fixes after cherry-pick our customizations --------- Co-authored-by: Andreas Sommer <andreas@giantswarm.io> Co-authored-by: calvix <vaclav@giantswarm.io> Co-authored-by: Mario Nitchev <marionitchev@gmail.com> Co-authored-by: calvix <rozsypalek.vaclav@gmail.com>
towards giantswarm/roadmap#3254
if this makes sense to you I will make a PR upstream
test in china
galaxy
and ongolem
work as expected