cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

Try to find and verify existing OIDC providers before we try to create a new one

Open codablock opened this issue 4 years ago • 46 comments
trafficstars

What type of PR is this? /kind bug

What this PR does / why we need it: When moving clusters between management clusters, ControlPlane.Status.OIDCProvider.ARN is lost. The new management cluster must then pickup the already existing cluster, as otherwise it tries to create the same provider again and then fails.

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 #

Special notes for your reviewer:

Checklist:

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

Release note:

Try to find and verify existing OIDC providers before we try to create a new one

codablock avatar Nov 01 '21 16:11 codablock

@codablock: 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 avatar Nov 01 '21 16:11 k8s-ci-robot

Hi @codablock. 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 avatar Nov 01 '21 16:11 k8s-ci-robot

/ok-to-test

randomvariable avatar Nov 02 '21 17:11 randomvariable

Shame we stored this in the status in the original implementation.

@codablock - do you see any potential issues (i.e. edge cases) with trying to to automatically find the oidc provider?

richardcase avatar Nov 03 '21 06:11 richardcase

@richardcase I can't imagine any. I was first thinking that I could also try to update an existing OIDC provider's thumbprint ind client IDs, but then decided that I should not touch them as we can't know for sure WHY they would differ from the expected values...if they do, there is probably a good reason (e.g. manually created provider, for whatever reason).

codablock avatar Nov 03 '21 06:11 codablock

@richardcase Any update on how to proceed with this PR?

codablock avatar Dec 14 '21 08:12 codablock

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Mar 14 '22 09:03 k8s-triage-robot

/lifecycle frozen

This looks good to me. I can't imagine any issues with this myself. @sedefsavas - what do you think?

richardcase avatar Mar 15 '22 14:03 richardcase

@richardcase: The lifecycle/frozen label cannot be applied to Pull Requests.

In response to this:

/lifecycle frozen

This looks good to me. I can't imagine any issues with this myself. @sedefsavas - what do you think?

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 avatar Mar 15 '22 14:03 k8s-ci-robot

@codablock - this looks good to me. Do you think there is anyway we can add a test around this functionality?

richardcase avatar Apr 11 '22 11:04 richardcase

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar May 11 '22 11:05 k8s-triage-robot

Unfortunately I'm a bit overloaded atm and won't find time to add tests.

codablock avatar May 11 '22 12:05 codablock

/help

richardcase avatar Jun 08 '22 11:06 richardcase

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Jul 08 '22 11:07 k8s-triage-robot

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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 avatar Jul 08 '22 11:07 k8s-ci-robot

/reopen

richardcase avatar Jul 08 '22 12:07 richardcase

@richardcase: Reopened this PR.

In response to this:

/reopen

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 avatar Jul 08 '22 12:07 k8s-ci-robot

/milestone v1.6.0

richardcase avatar Jul 25 '22 21:07 richardcase

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Aug 24 '22 21:08 k8s-triage-robot

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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 avatar Aug 24 '22 21:08 k8s-ci-robot

/reopen. This one is fairly important for using workers across multiple managers

Jacobious52 avatar Sep 19 '22 04:09 Jacobious52

/reopen

Skarlso avatar Sep 19 '22 05:09 Skarlso

@Skarlso: Reopened this PR.

In response to this:

/reopen

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 avatar Sep 19 '22 05:09 k8s-ci-robot

I'll take this.

Skarlso avatar Sep 19 '22 05:09 Skarlso

To pick up:

  • Test the code, and see if it works, if not, fix anything that might remain
  • See if I can write some tests around this

Skarlso avatar Sep 19 '22 05:09 Skarlso

This looks okay so far. I'll have a think about the security concerns such as, can be abused to find an OIDC provider that you shouldn't have...

Skarlso avatar Sep 19 '22 05:09 Skarlso

/assign

Skarlso avatar Sep 20 '22 05:09 Skarlso

I guess for a first take this is fine. I doubt there will be too many oidc providers to Get.

I'll add tests then it lgtm.

Skarlso avatar Sep 28 '22 05:09 Skarlso

/remove-lifecycle rotten

Skarlso avatar Sep 29 '22 04:09 Skarlso

@codablock Hello 👋

Would you mind giving me permission to push into this PR, please? :)

Alternatively, I can open a new one under my name if you don't want to give me access. :D I understand. :)

Skarlso avatar Sep 29 '22 04:09 Skarlso