mirror of
https://github.com/containers/podman.git
synced 2025-12-01 18:49:18 +08:00
Add --replace flag to podman secret create
Users may want to replace the secret used within containers, without destroying the secret and recreating it. Partial fix for https://github.com/containers/podman/issues/18667 Make sure podman --remote secret inspect and podman secret inspect return the same error message. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@@ -24,6 +24,7 @@ func CreateSecret(w http.ResponseWriter, r *http.Request) {
|
||||
Driver string `schema:"driver"`
|
||||
DriverOpts map[string]string `schema:"driveropts"`
|
||||
Labels map[string]string `schema:"labels"`
|
||||
Replace bool `schema:"replace"`
|
||||
}{
|
||||
// override any golang type defaults
|
||||
}
|
||||
@@ -36,6 +37,7 @@ func CreateSecret(w http.ResponseWriter, r *http.Request) {
|
||||
opts.Driver = query.Driver
|
||||
opts.DriverOpts = query.DriverOpts
|
||||
opts.Labels = query.Labels
|
||||
opts.Replace = query.Replace
|
||||
|
||||
ic := abi.ContainerEngine{Libpod: runtime}
|
||||
report, err := ic.SecretCreate(r.Context(), query.Name, r.Body, opts)
|
||||
|
||||
Reference in New Issue
Block a user