Skip to content
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 hardcoded ARN partitions #12638

Merged
merged 4 commits into from
Oct 30, 2021
Merged

Conversation

rifelpet
Copy link
Member

@rifelpet rifelpet commented Oct 29, 2021

IAMBuilder was hardcoding the partition in ARNs to aws in IAM Policy documents for OIDC Providers, EBS Volumes, and EBS Snapshots. This fixes them to use the current partition (aws-test in integration tests). This also fixes a few ARNs generated in cloudmock and updates any ARNs referenced in cluster manifests as well.

The end goal is that there are no ARNs with aws partitions in any of the integration test inputs or outputs so they can be validated for support for alternative partitions via #12635.

Fixes #12633

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 29, 2021
@rifelpet
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 30, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 30, 2021
@@ -32,7 +32,7 @@ var _ iam.Subject = &ServiceAccount{}
func (r *ServiceAccount) BuildAWSPolicy(b *iam.PolicyBuilder) (*iam.Policy, error) {
clusterName := b.Cluster.ObjectMeta.Name
p := iam.NewPolicy(clusterName)
iam.AddCCMPermissions(p, b.Cluster.Spec.Networking.Kubenet != nil)
iam.AddCCMPermissions(p, b.Partition, b.Cluster.Spec.Networking.Kubenet != nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to pass the partition into NewPolicy() instead of having to pass it to every Add*Permissions() call?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 30, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johngmyers

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 30, 2021
@k8s-ci-robot k8s-ci-robot merged commit 9bc5887 into kubernetes:master Oct 30, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Oct 30, 2021
k8s-ci-robot added a commit that referenced this pull request Oct 30, 2021
…38-origin-release-1.22

Automated cherry pick of #12638: Fix hardcoded ARN partitions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Partition "aws" is not valid for resource "arn:aws:ec2:*:*:volume/*".
3 participants