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
@@ -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"`
}
@@ -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
}
@@ -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
+1 -1
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
@@ -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) {