+ # metadataPolicy to fetch all the labels in JSON format
+ - secretKey: tags
+ remoteRef:
+ metadataPolicy: Fetch
+ key: foo
+
+ # metadataPolicy to fetch a specific label (dev) from the source secret
+ - secretKey: developer
+ remoteRef:
+ metadataPolicy: Fetch
+ key: foo
+ property: dev
+
---
# will create a secret with:
kind: Secret
@@ -81,6 +95,8 @@ data:
foobar: czNjcjN0
```
+Keep in mind that fetching the labels with `metadataPolicy: Fetch` only works with KV sercrets engine version v2.
+
#### Fetching Raw Values
You can fetch all key/value pairs for a given path If you leave the `remoteRef.property` empty. This returns the json-encoded secret value for that path.