mirror of
https://github.com/external-secrets/external-secrets.git
synced 2024-12-15 17:51:01 +00:00
Fixing sonar cloud duplication
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
This commit is contained in:
parent
a5f5ecf6a5
commit
8e7da7b6ed
1 changed files with 6 additions and 38 deletions
|
@ -73,45 +73,13 @@ func TestNewClientNoCreds(t *testing.T) {
|
||||||
secretClient, err = provider.NewClient(context.Background(), &store, k8sClient, namespace)
|
secretClient, err = provider.NewClient(context.Background(), &store, k8sClient, namespace)
|
||||||
tassert.EqualError(t, err, "could not find secret internal/user: secrets \"user\" not found")
|
tassert.EqualError(t, err, "could not find secret internal/user: secrets \"user\" not found")
|
||||||
tassert.Nil(t, secretClient)
|
tassert.Nil(t, secretClient)
|
||||||
}
|
store.TypeMeta.Kind = esv1alpha1.ClusterSecretStoreKind
|
||||||
|
store.TypeMeta.APIVersion = esv1alpha1.ClusterSecretStoreKindAPIVersion
|
||||||
func TestNewClientClusterScoped(t *testing.T) {
|
ns := "default"
|
||||||
namespace := "internal"
|
store.Spec.Provider.AzureKV.AuthSecretRef.ClientID.Namespace = &ns
|
||||||
vaultURL := "https://local.vault.url"
|
store.Spec.Provider.AzureKV.AuthSecretRef.ClientSecret.Namespace = &ns
|
||||||
tenantID := "1234"
|
|
||||||
store := esv1alpha1.ClusterSecretStore{
|
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
|
||||||
Namespace: namespace,
|
|
||||||
},
|
|
||||||
TypeMeta: metav1.TypeMeta{
|
|
||||||
Kind: esv1alpha1.ClusterSecretStoreKind,
|
|
||||||
APIVersion: esv1alpha1.ClusterSecretStoreKindAPIVersion,
|
|
||||||
},
|
|
||||||
Spec: esv1alpha1.SecretStoreSpec{Provider: &esv1alpha1.SecretStoreProvider{AzureKV: &esv1alpha1.AzureKVProvider{
|
|
||||||
VaultURL: &vaultURL,
|
|
||||||
TenantID: &tenantID,
|
|
||||||
}}},
|
|
||||||
}
|
|
||||||
provider, err := schema.GetProvider(&store)
|
|
||||||
tassert.Nil(t, err, "the return err should be nil")
|
|
||||||
k8sClient := clientfake.NewClientBuilder().Build()
|
|
||||||
secretClient, err := provider.NewClient(context.Background(), &store, k8sClient, namespace)
|
|
||||||
tassert.EqualError(t, err, "missing clientID/clientSecret in store config")
|
|
||||||
tassert.Nil(t, secretClient)
|
|
||||||
|
|
||||||
store.Spec.Provider.AzureKV.AuthSecretRef = &esv1alpha1.AzureKVAuth{}
|
|
||||||
secretClient, err = provider.NewClient(context.Background(), &store, k8sClient, namespace)
|
secretClient, err = provider.NewClient(context.Background(), &store, k8sClient, namespace)
|
||||||
tassert.EqualError(t, err, "missing accessKeyID/secretAccessKey in store config")
|
tassert.EqualError(t, err, "could not find secret default/user: secrets \"user\" not found")
|
||||||
tassert.Nil(t, secretClient)
|
|
||||||
ns := "user"
|
|
||||||
store.Spec.Provider.AzureKV.AuthSecretRef.ClientID = &v1.SecretKeySelector{Name: "user", Namespace: &ns}
|
|
||||||
secretClient, err = provider.NewClient(context.Background(), &store, k8sClient, namespace)
|
|
||||||
tassert.EqualError(t, err, "missing accessKeyID/secretAccessKey in store config")
|
|
||||||
tassert.Nil(t, secretClient)
|
|
||||||
|
|
||||||
store.Spec.Provider.AzureKV.AuthSecretRef.ClientSecret = &v1.SecretKeySelector{Name: "password", Namespace: &ns}
|
|
||||||
secretClient, err = provider.NewClient(context.Background(), &store, k8sClient, namespace)
|
|
||||||
tassert.EqualError(t, err, "could not find secret user/user: secrets \"user\" not found")
|
|
||||||
tassert.Nil(t, secretClient)
|
tassert.Nil(t, secretClient)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue