Browse Source

fix: aws secretexists returns true ifnotexists (#3684)

Signed-off-by: Alok N <alokme123@gmail.com>
Alok N 1 year ago
parent
commit
0fcf972a70

+ 1 - 1
pkg/provider/aws/secretsmanager/secretsmanager.go

@@ -230,7 +230,7 @@ func (sm *SecretsManager) handleSecretError(err error) (bool, error) {
 		return false, err
 	}
 	if aerr.Code() == awssm.ErrCodeResourceNotFoundException {
-		return true, nil
+		return false, nil
 	}
 	return false, err
 }

+ 2 - 2
pkg/provider/aws/secretsmanager/secretsmanager_test.go

@@ -1359,7 +1359,7 @@ func TestSecretExists(t *testing.T) {
 				wantError: true,
 			},
 		},
-		"SecretExistsReturnsTrueForNonExistingSecret": {
+		"SecretExistsReturnsFalseForNonExistingSecret": {
 			args: args{
 				store: makeValidSecretStore().Spec.Provider.AWS,
 				client: fakesm.Client{
@@ -1369,7 +1369,7 @@ func TestSecretExists(t *testing.T) {
 			},
 			want: want{
 				err:       nil,
-				wantError: true,
+				wantError: false,
 			},
 		},
 		"SecretExistsReturnsFalseForErroredSecret": {