1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00

Fix SonarCube codesmell

This commit is contained in:
Sebastian Gomez 2022-01-26 12:30:55 -05:00
parent 16839c6ce1
commit 2c6dde34f7
2 changed files with 18 additions and 8 deletions

View file

@ -46,6 +46,11 @@ type secretManagerTestCase struct {
expectedData map[string][]byte
}
const (
testSecret = "test-secret"
defaultVersion = "default"
)
func makeValidSecretManagerTestCase() *secretManagerTestCase {
smtc := secretManagerTestCase{
mockClient: &fakesm.IBMMockClient{},
@ -65,16 +70,16 @@ func makeValidSecretManagerTestCase() *secretManagerTestCase {
func makeValidRef() *esv1alpha1.ExternalSecretDataRemoteRef {
return &esv1alpha1.ExternalSecretDataRemoteRef{
Key: "test-secret",
Version: "default",
Key: testSecret,
Version: defaultVersion,
}
}
func makeValidRefFrom() *esv1alpha1.ExternalSecretDataFromRemoteRef {
return &esv1alpha1.ExternalSecretDataFromRemoteRef{
Extract: esv1alpha1.ExternalSecretExtract{
Key: "test-secret",
Version: "default",
Key: testSecret,
Version: defaultVersion,
},
}
}

View file

@ -39,6 +39,11 @@ type vaultTestCase struct {
expectedData map[string][]byte
}
const (
testSecret = "test-secret"
defaultVersion = "default"
)
func makeValidVaultTestCase() *vaultTestCase {
smtc := vaultTestCase{
mockClient: &fakeoracle.OracleMockClient{},
@ -57,16 +62,16 @@ func makeValidVaultTestCase() *vaultTestCase {
func makeValidRef() *esv1alpha1.ExternalSecretDataRemoteRef {
return &esv1alpha1.ExternalSecretDataRemoteRef{
Key: "test-secret",
Version: "default",
Key: testSecret,
Version: defaultVersion,
}
}
func makeValidRefFrom() *esv1alpha1.ExternalSecretDataFromRemoteRef {
return &esv1alpha1.ExternalSecretDataFromRemoteRef{
Extract: esv1alpha1.ExternalSecretExtract{
Key: "test-secret",
Version: "default",
Key: testSecret,
Version: defaultVersion,
},
}
}