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: eks encryption logic fix #3095

Merged
merged 1 commit into from
Jan 27, 2022
Merged

fix: eks encryption logic fix #3095

merged 1 commit into from
Jan 27, 2022

Conversation

richardcase
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

The logic for when to update the EKS encryption had issues. This
refactors the logic to be more explicit.

Also updated the docs to say that the KMS key ARN needs to be used and
not the alias ARN.

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 #3092

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

Update to EKS encryption logic to stop it reporting a chnage when one hasn't occured.

The logic for when to update the EKS encryption had issues. This
refactors the logic to be more explicit.

Also updated the docs to say that the KMS key ARN needs to be used and
not the alias ARN.

Signed-off-by: Richard Case <richard@weave.works>
@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-priority labels Jan 22, 2022
@k8s-ci-robot
Copy link
Contributor

@richardcase: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 22, 2022
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 22, 2022
@richardcase richardcase changed the title fix: eks encryprion logic fix fix: eks encryption logic fix Jan 22, 2022
Comment on lines +541 to +542
record.Warnf(s.scope.ControlPlane, "FailedUpdateEKSControlPlane", "failed to update the EKS control plane: disabling EKS encryption is not allowed after it has been enabled")
return errors.Errorf("failed to update the EKS control plane: disabling EKS encryption is not allowed after it has been enabled")
Copy link
Contributor

Choose a reason for hiding this comment

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

Once set, modifying or deleting the config is not allowed in the webhook, so not really needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@richardcase What was the fix here? I could not see.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed it should never get here....although it was with the issue that this PR relates to. I'd be tempted to keep it as it would be good to get an error .

@sedefsavas sedefsavas added this to the v1.3.0 milestone Jan 23, 2022
@richardcase
Copy link
Member Author

Changing to WIP as i will fix #3096 as part of this.

@richardcase richardcase changed the title fix: eks encryption logic fix WIP fix: eks encryption logic fix Jan 23, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 23, 2022
@rayterrill
Copy link

More comments in Slack, but I built this and deployed it to my cluster - so far I'm able to build a cluster with no KMS error messages relating to trying to pull the encryption back off. Looking good @richardcase! Thank you!

@richardcase richardcase changed the title WIP fix: eks encryption logic fix fix: eks encryption logic fix Jan 26, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 26, 2022
@richardcase
Copy link
Member Author

@rayterrill - thanks for confirming this fixes your issue. I'll do #3096 as a seperate PR after some thought so that we get this in.

@richardcase
Copy link
Member Author

/test ?

@k8s-ci-robot
Copy link
Contributor

@richardcase: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test ?

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.

@richardcase
Copy link
Member Author

/test pull-cluster-api-provider-aws-e2e-eks

@sedefsavas
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 27, 2022
@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 Jan 27, 2022
@k8s-ci-robot k8s-ci-robot merged commit 2969152 into kubernetes-sigs:main Jan 27, 2022
@k8s-ci-robot k8s-ci-robot removed this from the v1.3.0 milestone Jan 27, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.x milestone Jan 27, 2022
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. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specifying KMS encryption results in envelope encryption being set, but controller is trying to back it out
4 participants