Browse Source

docs: starts with filter comment

Docs 4 years ago
parent
commit
f5293c58be
1 changed files with 6 additions and 0 deletions
  1. 6 0
      pkg/provider/gcp/secretmanager/secretsmanager.go

+ 6 - 0
pkg/provider/gcp/secretmanager/secretsmanager.go

@@ -247,6 +247,12 @@ func (sm *ProviderGCP) findByName(ctx context.Context, ref esv1beta1.ExternalSec
 		}
 		log.V(1).Info("gcp sm findByName found", "secrets", strconv.Itoa(it.PageInfo().Remaining()))
 		key := sm.trimName(resp.Name)
+		// If we don't match we skip.
+		// Also, if we have path, and it is not at the beguining we skip.
+		// We have to check if path is at the beguining of the key because
+		// there is no way to create a `name:%s*` (starts with) filter
+		// At https://cloud.google.com/secret-manager/docs/filtering you can use `*`
+		// but not like that it seems.
 		if !matcher.MatchName(key) || (ref.Path != nil && !strings.HasPrefix(key, *ref.Path)) {
 			continue
 		}