Skip to content

DELETE /secrets/<name> (compat) return Podman does not support service /secrets/<name> #27548

@axel7083

Description

@axel7083

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 plural secrets (with a s).

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

  1. printf "secretdata" | podman secret create mysecret - <-- create a secret
  2. podman system service --time=0 tcp://localhost:8888 <-- make the API available
  3. 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.0

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

The registered endpoint is not using plural

r.Handle("/secret/{name}", s.APIHandler(compat.RemoveSecret)).Methods(http.MethodDelete)

The error is raised from the following

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

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.triagedIssue has been triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions