-
Notifications
You must be signed in to change notification settings - Fork 103
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
[WIP] Refactor Provider Credentials #2195
base: master
Are you sure you want to change the base?
Conversation
Highlight secret row instead of open secret dialog
show secret data in edit mode
const credentialsList = secretBindings.map(secretBinding => { | ||
const secret = referencedSecrets.find(secret => secret.metadata.name === secretBinding.secretRef.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const credentialsList = secretBindings.map(secretBinding => { | |
const secret = referencedSecrets.find(secret => secret.metadata.name === secretBinding.secretRef.name) | |
const secretMap = new Map(referencedSecrets.map(secret => [secret.metadata.name, secret])) | |
const credentialsList = secretBindings.map(secretBinding => { | |
const secret = secretMap.get(secretBinding.secretRef.name) |
return [ | ||
{ | ||
label: 'Domain Name', | ||
value: atob(secretData.domainName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Base64.decode(data)
instead of atob
const gardenerExtensionStore = useGardenerExtensionStore() | ||
const cloudProfileStore = useCloudProfileStore() | ||
|
||
const credentialResourcesList = ref(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to cloudProviderCredentials
or cloudProviderCredentialList
. I would never use Resource or Resources as part of the name. In kubernetes the term object and items is used. The term resource is use in http in the client - server context form server entities.
|
||
const secretBindingList = computed(() => { | ||
return map(credentialResourcesList.value, ({ secretBinding, secret, quotas }) => { | ||
Object.defineProperty(secretBinding, 'secretResource', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to secret
configurable: false, | ||
enumerable: false, | ||
}) | ||
Object.defineProperty(secretBinding, 'quotaResources', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to quotas
writable: false, | ||
configurable: false, | ||
enumerable: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default. We have not specified these default value in the past
@@ -455,14 +455,14 @@ export function shortRandomString (length) { | |||
} | |||
|
|||
export function selfTerminationDaysForSecret (secret) { | |||
const clusterLifetimeDays = function (quotas, scope) { | |||
return get(find(quotas, scope), ['spec', 'clusterLifetimeDays']) | |||
const clusterLifetimeDays = function (quotaResources, scope) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always use quota
|
||
exports.create = async function ({ user, body }) { | ||
const client = user.client | ||
const { coordinate: { namespace, name }, credential: { poviderType, secretData } } = body |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not use the property coordinate
. Use the relevant properties flat. Pass the params and not body.
const { namespace, name, poviderType, secretData } = params
This PR refactors the backend
/cloudprovidersecrets
APISecretBinding
,Secret
(if own) and resolvedQuota
resourcesThis PR is also a preparation to support new CredentialsBinding resource
SecretBinding
as the leading resource, access referenced secret only when we need to access the actual secret dataCredentialsBindings
in the backend and return with the list. The dashboard can then work with CredentialsBindings and SecretBindings in the frontend as they are more or less interchangeable. Only the reference to the Secret / WorkloadIdentity data is different so we need to add some kind of abstraction / transformation there.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Tests need to be adapted
Release note: