We use labels in Secret Manager to label secrets corresponding to a particular service, for example, "reports" vs "rostering", and I would like to be able to list secrets with such a label, however, these labels have no value, so this fails to return any results:
gcloud secrets list --filter="labels.reports:*"
How can I use the gcloud CLI to list secrets matching a label with no value?
You can only achieve the desired filtering effect for valueless labels by looking for those that are less than one of the last ASCII characters:
The GCP console (where regular valueless label filtering works) sends an HTTP request to https://cloudconsole-pa.clients6.google.com/v3/entityServices/SecretsEntityService/schemas/SECRETS_GRAPHQL:batchGraphql, with payload:
However,
labels:prod#*doesn't work with the gcloud CLI.