Fix: Change credentials -> credentialsRef

This commit is contained in:
Daniel Hougaard
2024-03-21 17:08:01 +01:00
parent caea055281
commit 0341c32da0
6 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -77,7 +77,7 @@ spec:
projectSlug: <project-slug> projectSlug: <project-slug>
envSlug: <env-slug> # "dev", "staging", "prod", etc.. envSlug: <env-slug> # "dev", "staging", "prod", etc..
secretsPath: "<secrets-path>" # Root is "/" secretsPath: "<secrets-path>" # Root is "/"
credentials: credentialsRef:
secretName: universal-auth-credentials secretName: universal-auth-credentials
secretNamespace: default secretNamespace: default
@@ -142,7 +142,7 @@ Default re-sync interval is every 1 minute.
</Step> </Step>
<Step title="Add reference for the Kubernetes secret containing the identity credentials"> <Step title="Add reference for the Kubernetes secret containing the identity credentials">
Once the secret is created, add the `secretName` and `secretNamespace` of the secret that was just created under `authentication.universalAuth.credentials` field in the InfisicalSecret resource. Once the secret is created, add the `secretName` and `secretNamespace` of the secret that was just created under `authentication.universalAuth.credentialsRef` field in the InfisicalSecret resource.
</Step> </Step>
</Steps> </Steps>
@@ -165,7 +165,7 @@ Default re-sync interval is every 1 minute.
projectSlug: <project-slug> # <-- project slug projectSlug: <project-slug> # <-- project slug
envSlug: <env-slug> # "dev", "staging", "prod", etc.. envSlug: <env-slug> # "dev", "staging", "prod", etc..
secretsPath: "<secrets-path>" # Root is "/" secretsPath: "<secrets-path>" # Root is "/"
credentials: credentialsRef:
secretName: universal-auth-credentials # <-- name of the Kubernetes secret that stores our machine identity credentials secretName: universal-auth-credentials # <-- name of the Kubernetes secret that stores our machine identity credentials
secretNamespace: default # <-- namespace of the Kubernetes secret that stores our machine identity credentials secretNamespace: default # <-- namespace of the Kubernetes secret that stores our machine identity credentials
... ...
@@ -15,7 +15,7 @@ type Authentication struct {
type UniversalAuthDetails struct { type UniversalAuthDetails struct {
// +kubebuilder:validation:Required // +kubebuilder:validation:Required
Credentials KubeSecretReference `json:"credentials"` CredentialsRef KubeSecretReference `json:"credentialsRef"`
// +kubebuilder:validation:Required // +kubebuilder:validation:Required
SecretsScope MachineIdentityScopeInWorkspace `json:"secretsScope"` SecretsScope MachineIdentityScopeInWorkspace `json:"secretsScope"`
} }
@@ -239,7 +239,7 @@ func (in *ServiceTokenDetails) DeepCopy() *ServiceTokenDetails {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *UniversalAuthDetails) DeepCopyInto(out *UniversalAuthDetails) { func (in *UniversalAuthDetails) DeepCopyInto(out *UniversalAuthDetails) {
*out = *in *out = *in
out.Credentials = in.Credentials out.CredentialsRef = in.CredentialsRef
out.SecretsScope = in.SecretsScope out.SecretsScope = in.SecretsScope
} }
@@ -92,7 +92,7 @@ spec:
type: object type: object
universalAuth: universalAuth:
properties: properties:
credentials: credentialsRef:
properties: properties:
secretName: secretName:
description: The name of the Kubernetes Secret description: The name of the Kubernetes Secret
@@ -119,7 +119,7 @@ spec:
- secretsPath - secretsPath
type: object type: object
required: required:
- credentials - credentialsRef
- secretsScope - secretsScope
type: object type: object
type: object type: object
+1 -1
View File
@@ -43,7 +43,7 @@ spec:
envSlug: <env-slug> # "dev", "staging", "prod", etc.. envSlug: <env-slug> # "dev", "staging", "prod", etc..
secretsPath: "<secrets-path>" # Root is "/" secretsPath: "<secrets-path>" # Root is "/"
credentials: credentialsRef:
secretName: universal-auth-credentials secretName: universal-auth-credentials
secretNamespace: default secretNamespace: default
@@ -117,8 +117,8 @@ func (r *InfisicalSecretReconciler) GetInfisicalTokenFromKubeSecret(ctx context.
func (r *InfisicalSecretReconciler) GetInfisicalUniversalAuthFromKubeSecret(ctx context.Context, infisicalSecret v1alpha1.InfisicalSecret) (machineIdentityDetails model.MachineIdentityDetails, err error) { func (r *InfisicalSecretReconciler) GetInfisicalUniversalAuthFromKubeSecret(ctx context.Context, infisicalSecret v1alpha1.InfisicalSecret) (machineIdentityDetails model.MachineIdentityDetails, err error) {
universalAuthCredsFromKubeSecret, err := r.GetKubeSecretByNamespacedName(ctx, types.NamespacedName{ universalAuthCredsFromKubeSecret, err := r.GetKubeSecretByNamespacedName(ctx, types.NamespacedName{
Namespace: infisicalSecret.Spec.Authentication.UniversalAuth.Credentials.SecretNamespace, Namespace: infisicalSecret.Spec.Authentication.UniversalAuth.CredentialsRef.SecretNamespace,
Name: infisicalSecret.Spec.Authentication.UniversalAuth.Credentials.SecretName, Name: infisicalSecret.Spec.Authentication.UniversalAuth.CredentialsRef.SecretName,
}) })
if errors.IsNotFound(err) { if errors.IsNotFound(err) {