Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

identity: Adding K8sServiceAccount.ToServiceIdentity() and ServiceIdentity.ToK8sServiceAccount() #3179

Merged

Conversation

draychev
Copy link
Contributor

@draychev draychev commented Apr 15, 2021

This PR introduces a few (not yet used) functions to help with the transition from K8sServiceAccount to ServiceIdentity (#2218)

  • ServiceIdentity{}.ToK8sServiceAccount() converts a ServiceIdentity to a K8sServiceAccount - examples of how this will be used are here Migration path for Service Identity #3170

  • K8sServiceAccount{}.ToServiceIdentity() converts a K8sServiceAccount to a ServiceIdentity - examples are also in Migration path for Service Identity #3170

  • ServiceIdentity{}.GetSDSCSecretName() needed to create the string keys used as names for SDS Certs / Secrets - this is going to be used instead of K8sServiceAccount{}.String()


The type changes will arrive with another PR.

No functional code changes in this PR.


This is one of the few steps towards addressing: Use ServiceIdentity type in catalog APIs instead of service.K8sServiceAccount #2218


This is a small chunk from #3170


All PRs in the series:

@draychev draychev requested a review from a team as a code owner April 15, 2021 22:04
@draychev draychev force-pushed the svcidentity-start-w-interfaces_helpers branch from c2cc102 to 8e087e9 Compare April 15, 2021 22:12
…ntity.ToK8sServiceAccount()

Signed-off-by: Delyan Raychev <delyan.raychev@microsoft.com>
Copy link
Member

@shashankram shashankram left a comment

Choose a reason for hiding this comment

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

Looks good overall, have one major concern regarding SDS implementation details (SDS secret) name being leaked into a generic identity package.

pkg/identity/types.go Outdated Show resolved Hide resolved
Signed-off-by: Delyan Raychev <delyan.raychev@microsoft.com>
Copy link
Member

@shashankram shashankram left a comment

Choose a reason for hiding this comment

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

#3182 is tracking the removal of the SDS related code. Looks good otherwise.

@draychev draychev merged commit 012e2f9 into openservicemesh:main Apr 15, 2021
@draychev draychev deleted the svcidentity-start-w-interfaces_helpers branch April 15, 2021 23:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants