Fix: Change credentials -> credentialsRef

This commit is contained in:
Daniel Hougaard
2024-03-19 11:25:26 +01:00
parent caea055281
commit 0341c32da0
6 changed files with 10 additions and 10 deletions

View File

@@ -77,7 +77,7 @@ spec:
projectSlug: <project-slug>
envSlug: <env-slug> # "dev", "staging", "prod", etc..
secretsPath: "<secrets-path>" # Root is "/"
credentials:
credentialsRef:
secretName: universal-auth-credentials
secretNamespace: default
@@ -142,7 +142,7 @@ Default re-sync interval is every 1 minute.
</Step>
<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>
</Steps>
@@ -165,7 +165,7 @@ Default re-sync interval is every 1 minute.
projectSlug: <project-slug> # <-- project slug
envSlug: <env-slug> # "dev", "staging", "prod", etc..
secretsPath: "<secrets-path>" # Root is "/"
credentials:
credentialsRef:
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
...

View File

@@ -15,7 +15,7 @@ type Authentication struct {
type UniversalAuthDetails struct {
// +kubebuilder:validation:Required
Credentials KubeSecretReference `json:"credentials"`
CredentialsRef KubeSecretReference `json:"credentialsRef"`
// +kubebuilder:validation:Required
SecretsScope MachineIdentityScopeInWorkspace `json:"secretsScope"`
}

View File

@@ -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.
func (in *UniversalAuthDetails) DeepCopyInto(out *UniversalAuthDetails) {
*out = *in
out.Credentials = in.Credentials
out.CredentialsRef = in.CredentialsRef
out.SecretsScope = in.SecretsScope
}

View File

@@ -92,7 +92,7 @@ spec:
type: object
universalAuth:
properties:
credentials:
credentialsRef:
properties:
secretName:
description: The name of the Kubernetes Secret
@@ -119,7 +119,7 @@ spec:
- secretsPath
type: object
required:
- credentials
- credentialsRef
- secretsScope
type: object
type: object

View File

@@ -43,7 +43,7 @@ spec:
envSlug: <env-slug> # "dev", "staging", "prod", etc..
secretsPath: "<secrets-path>" # Root is "/"
credentials:
credentialsRef:
secretName: universal-auth-credentials
secretNamespace: default

View File

@@ -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) {
universalAuthCredsFromKubeSecret, err := r.GetKubeSecretByNamespacedName(ctx, types.NamespacedName{
Namespace: infisicalSecret.Spec.Authentication.UniversalAuth.Credentials.SecretNamespace,
Name: infisicalSecret.Spec.Authentication.UniversalAuth.Credentials.SecretName,
Namespace: infisicalSecret.Spec.Authentication.UniversalAuth.CredentialsRef.SecretNamespace,
Name: infisicalSecret.Spec.Authentication.UniversalAuth.CredentialsRef.SecretName,
})
if errors.IsNotFound(err) {