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

reconcile service account call SCI #189

Merged
merged 9 commits into from
Aug 13, 2023
Merged

reconcile service account call SCI #189

merged 9 commits into from
Aug 13, 2023

Conversation

samos123
Copy link
Contributor

@samos123 samos123 commented Aug 11, 2023

  • Call sci.BindIdentity to allow a K8s Service account to impersonate an identity
  • Created a FakeSCIControllerClient to be able to run tests easily

Copy link
Contributor

@brandonjbjelland brandonjbjelland left a comment

Choose a reason for hiding this comment

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

overall lgtm. I'll give another pass later when I have more cycles

@samos123
Copy link
Contributor Author

Let's make sure tests pass before merging

Copy link
Contributor

@nstogner nstogner left a comment

Choose a reason for hiding this comment

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

Looks like the right solution. Requested a few changes.

)

type Common struct {
ClusterName string `env:"CLUSTER_NAME" validate:"required"`
ArtifactBucketURL *BucketURL `env:"ARTIFACT_BUCKET_URL,noinit" validate:"required"`
RegistryURL string `env:"REGISTRY_URL" validate:"required"`
Principal string `env:"PRINCIPAL"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be required (validate:"required")?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the reason I made this optional is because that would require us to always set it, even when you use something like kind or when you run the tests. I had it as validate:"required" at first but after running tests, I thought it would be better to make it optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After refactoring the PR, I think this could be changed back to required. Do you think that's the right move here? Even though Kind won't need it? There might be other environments where workload identity isn't available.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see the benefit of requiring this (production environments need it) outweighing the negatives… dev envs needing to pass a stub value… alternative would be to have some custom validation logic, but prob not worth the effort there

internal/cloud/gcp.go Outdated Show resolved Hide resolved
internal/controller/service_accounts.go Outdated Show resolved Hide resolved
internal/controller/service_accounts.go Outdated Show resolved Hide resolved
@samos123 samos123 requested a review from nstogner August 12, 2023 04:10
Copy link
Contributor

@brandonjbjelland brandonjbjelland left a comment

Choose a reason for hiding this comment

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

🍗

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice work on these!

Copy link
Contributor

@brandonjbjelland brandonjbjelland left a comment

Choose a reason for hiding this comment

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

Yep 👍

@samos123 samos123 merged commit 581b6e2 into main Aug 13, 2023
4 checks passed
@samos123 samos123 deleted the sa-reconciler-use-sci branch August 13, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants