-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Issue Description
Reading https://docs.podman.io/en/latest/_static/api.html?version=latest#tag/secrets-(compat)/operation/SecretDelete we can see that in compatibility mode, the endpoint to delete a secret is /secrets/{name} however, when calling this endpoint we got the following response (503)
{
"cause": "Podman does not support service: /secrets/6f459689a4269dd3d99d61c51",
"message": "Podman does not support service: /secrets/6f459689a4269dd3d99d61c51",
"response": 503
}
⚠️ The endpoint used in Dockerode (compat) is using pluralsecrets(with as).
I can use DELETE /secret/<name> without problem using Curl, but this is not the official endpoint (ref https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Secret/operation/SecretDelete).
Steps to reproduce the issue
Steps to reproduce the issue
printf "secretdata" | podman secret create mysecret -<-- create a secretpodman system service --time=0 tcp://localhost:8888<-- make the API available- Try to delete the secret using compact API
Describe the results you received
$: curl --location --request DELETE 'localhost:8888/secrets/<secretId>'
{"cause":"Podman does not support service: /secrets/<secretId>","message":"Podman does not support service: /secrets/<secretId>","response":503}
Describe the results you expected
Secret deleted
podman info output
podman version 5.6.0Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
The registered endpoint is not using plural
podman/pkg/api/server/register_secrets.go
Line 239 in 942f789
| r.Handle("/secret/{name}", s.APIHandler(compat.RemoveSecret)).Methods(http.MethodDelete) |
The error is raised from the following
podman/pkg/api/server/register_swarm.go
Line 25 in 942f789
| r.PathPrefix("/secrets/").HandlerFunc(noSwarm) |
Additional information
I am open to fix the problem if this is only adding an s to the register_secrets.go#L239