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: Process extra statements for Cluster API Controllers #2437

Merged

Conversation

Szymongib
Copy link
Contributor

What type of PR is this?
/kind bug

What this PR does / why we need it:

This PR fixes the bug causing extraStatements section to be ignored for clusterAPIControllers when creating IAM role.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2387

Special notes for your reviewer:

Checklist:

  • squashed commits
  • adds unit tests

Release note:

Process extra statements for Cluster API Controllers

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 27, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @Szymongib. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot requested review from rudoi and vincepri May 27, 2021 14:41
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 27, 2021
@@ -387,6 +387,10 @@ func (t Template) ControllersPolicy() *iamv1.PolicyDocument {
})
}

if t.Spec.ClusterAPIControllers.ExtraStatements != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not change the controllers.cluster-api-provider-aws.sigs.k8s.io here, instead similar to controlplane and node, we want to attach extra statemements as inline policy:

func (t Template) controlPlanePolicies() []cfn_iam.Role_Policy {

And add this as inline policy in the Policies section of the controller role.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yea, that totally makes sense! Sorry about that, fixed.

@Szymongib Szymongib force-pushed the bug/accept-extra-statements branch from 8b24487 to 16763c1 Compare May 28, 2021 15:22
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 28, 2021
@Szymongib Szymongib force-pushed the bug/accept-extra-statements branch from 16763c1 to ee72471 Compare May 28, 2021 15:24
@sedefsavas
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 28, 2021
@Szymongib Szymongib force-pushed the bug/accept-extra-statements branch from ee72471 to f746ca8 Compare May 29, 2021 05:26
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 29, 2021
@richardcase richardcase changed the title 🐛 Process extra statements for Cluster API Controllers bug: Process extra statements for Cluster API Controllers Jun 1, 2021
@richardcase richardcase changed the title bug: Process extra statements for Cluster API Controllers fix: Process extra statements for Cluster API Controllers Jun 1, 2021
@richardcase
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2021
@richardcase
Copy link
Member

For final approval:

/assign sedefsavas

@sedefsavas
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sedefsavas

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 Jun 1, 2021
@k8s-ci-robot k8s-ci-robot merged commit 9b29411 into kubernetes-sigs:main Jun 1, 2021
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extraStatements in the clusterAPIControllers config for clusterawsadm is being ignored
4 participants