mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
fix(annotations): parse annotation keys in angular forms [r8s-170] (#233)
This commit is contained in:
parent
94d2e32b49
commit
e1388eff84
3 changed files with 9 additions and 5 deletions
|
@ -19,7 +19,8 @@ class KubernetesConfigurationConverter {
|
|||
res.IsRegistrySecret = secret.IsRegistrySecret;
|
||||
res.SecretType = secret.SecretType;
|
||||
if (secret.Annotations) {
|
||||
res.ServiceAccountName = secret.Annotations['kubernetes.io/service-account.name'];
|
||||
const serviceAccountAnnotation = secret.Annotations.find((a) => a.key === 'kubernetes.io/service-account.name');
|
||||
res.ServiceAccountName = serviceAccountAnnotation ? serviceAccountAnnotation.value : undefined;
|
||||
}
|
||||
res.Labels = secret.Labels;
|
||||
return res;
|
||||
|
|
|
@ -109,7 +109,10 @@ class KubernetesSecretConverter {
|
|||
res.Type = formValues.customType;
|
||||
}
|
||||
if (formValues.Type === KubernetesSecretTypeOptions.SERVICEACCOUNTTOKEN.value) {
|
||||
res.Annotations = [{ name: 'kubernetes.io/service-account.name', value: formValues.ServiceAccountName }];
|
||||
const serviceAccountAnnotation = formValues.Annotations.find((a) => a.key === 'kubernetes.io/service-account.name');
|
||||
if (!serviceAccountAnnotation) {
|
||||
res.Annotations.push({ key: 'kubernetes.io/service-account.name', value: formValues.ServiceAccountName });
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue