diff --git a/internal/datasources/secret/data_source.go b/internal/datasources/secret/data_source.go index c8cf9bb..f0438f6 100644 --- a/internal/datasources/secret/data_source.go +++ b/internal/datasources/secret/data_source.go @@ -62,7 +62,7 @@ func (s *DataSource) Configure( } func createNameFilter(name string) string { - return constants.NameFilter + name + return constants.NameFilter + "'" + name + "'" } func getSecretByName( diff --git a/internal/simulator/secret.go b/internal/simulator/secret.go index e4589cc..f578bf7 100644 --- a/internal/simulator/secret.go +++ b/internal/simulator/secret.go @@ -18,7 +18,7 @@ func simulateSecretGetByName() { gock.New("http://localhost"). Get("/data-services/v1beta1/secrets"). - MatchParam("filter", "name eq "+secretName). + MatchParam("filter", "name eq "+ "'" + secretName + "'"). MatchHeader("Authorization", "Bearer abcdefghijklmnopqrstuvwxyz-0123456789"). Reply(200). SetHeader("Content-Type", "application/json"). @@ -26,7 +26,7 @@ func simulateSecretGetByName() { gock.New("http://localhost"). Get("/data-services/v1beta1/secrets"). - MatchParam("filter", "name eq "+secretName). + MatchParam("filter", "name eq "+ "'" + secretName + "'"). MatchHeader("Authorization", "Bearer expired-token"). Reply(401). SetHeader("Content-Type", "text/plain").