summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorAshley Cui <acui@redhat.com>2022-09-12 15:52:54 -0400
committerAshley Cui <acui@redhat.com>2022-09-20 16:28:00 -0400
commit9bb51e8e96f98ab74d416a9af9bd708c7c503bdf (patch)
tree602c43271772dd72cd52dca3bfb397f65ee3515e /test/apiv2
parent8216d0ef4e8212413a650a55ce8fd02f2ca8d181 (diff)
downloadpodman-9bb51e8e96f98ab74d416a9af9bd708c7c503bdf.tar.gz
podman-9bb51e8e96f98ab74d416a9af9bd708c7c503bdf.tar.bz2
podman-9bb51e8e96f98ab74d416a9af9bd708c7c503bdf.zip
Add labels to secrets
Add --label/-l label flag to secret create, and show labels when inspecting secrets. Also allow labeling secrets via libpod/compat API. Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/50-secrets.at10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/apiv2/50-secrets.at b/test/apiv2/50-secrets.at
index ed0e8fb6b..acd8f3de9 100644
--- a/test/apiv2/50-secrets.at
+++ b/test/apiv2/50-secrets.at
@@ -7,9 +7,6 @@
t POST secrets/create Name=mysecret Data=c2VjcmV0 200\
.ID~.* \
-# secret create unsupported labels
-t POST secrets/create Name=mysecret Data=c2VjcmV0 Labels='{"fail":"fail"}' 400
-
# secret create name already in use
t POST secrets/create Name=mysecret Data=c2VjcmV0 409
@@ -59,8 +56,15 @@ t GET libpod/secrets/json?filters='garb1age}' 500 \
t GET libpod/secrets/json?filters='{"label":["testl' 500 \
.cause="unexpected end of JSON input"
+# secret with labels
+t POST secrets/create Name=labeledsecret Data=c2VjcmV0 Labels='{"foo":"bar"}' 200
+t GET secrets/labeledsecret 200 \
+ .Spec.Labels.foo=bar
+
# secret rm
t DELETE secrets/mysecret 204
+t DELETE secrets/labeledsecret 204
+
# secret rm non-existent secret
t DELETE secrets/bogus 404