Skip to content

Commit e7507fe

Browse files
committed
make DriverOpts name consistent.
Signed-off-by: Tino Rusch <[email protected]>
1 parent b56b4b5 commit e7507fe

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

cmd/podman/secrets/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func init() {
4747
cfg := registry.PodmanConfig()
4848

4949
flags.StringVar(&createOpts.Driver, driverFlagName, cfg.Secrets.Driver, "Specify secret driver")
50-
flags.StringToStringVar(&createOpts.Opts, optsFlagName, cfg.Secrets.Opts, "Specify driver specific options")
50+
flags.StringToStringVar(&createOpts.DriverOpts, optsFlagName, cfg.Secrets.Opts, "Specify driver specific options")
5151
_ = createCmd.RegisterFlagCompletionFunc(driverFlagName, completion.AutocompleteNone)
5252
_ = createCmd.RegisterFlagCompletionFunc(optsFlagName, completion.AutocompleteNone)
5353

pkg/api/handlers/libpod/secrets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func CreateSecret(w http.ResponseWriter, r *http.Request) {
4040
}
4141

4242
opts.Driver = query.Driver
43-
opts.Opts = query.DriverOpts
43+
opts.DriverOpts = query.DriverOpts
4444

4545
ic := abi.ContainerEngine{Libpod: runtime}
4646
report, err := ic.SecretCreate(r.Context(), query.Name, r.Body, opts)

pkg/domain/entities/secrets.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ type SecretCreateReport struct {
1111
}
1212

1313
type SecretCreateOptions struct {
14-
Driver string
15-
Opts map[string]string
14+
Driver string
15+
DriverOpts map[string]string
1616
}
1717

1818
type SecretListRequest struct {

pkg/domain/infra/abi/secrets.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ func (ic *ContainerEngine) SecretCreate(ctx context.Context, name string, reader
2727
if options.Driver == "" {
2828
options.Driver = cfg.Secrets.Driver
2929
}
30-
if len(options.Opts) == 0 {
31-
options.Opts = cfg.Secrets.Opts
30+
if len(options.DriverOpts) == 0 {
31+
options.DriverOpts = cfg.Secrets.Opts
3232
}
33-
if options.Opts == nil {
34-
options.Opts = make(map[string]string)
33+
if options.DriverOpts == nil {
34+
options.DriverOpts = make(map[string]string)
3535
}
3636

3737
if options.Driver == "file" {
38-
if _, ok := options.Opts["path"]; !ok {
39-
options.Opts["path"] = filepath.Join(secretsPath, "filedriver")
38+
if _, ok := options.DriverOpts["path"]; !ok {
39+
options.DriverOpts["path"] = filepath.Join(secretsPath, "filedriver")
4040
}
4141
}
4242

43-
secretID, err := manager.Store(name, data, options.Driver, options.Opts)
43+
secretID, err := manager.Store(name, data, options.Driver, options.DriverOpts)
4444
if err != nil {
4545
return nil, err
4646
}

pkg/domain/infra/tunnel/secrets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
func (ic *ContainerEngine) SecretCreate(ctx context.Context, name string, reader io.Reader, options entities.SecretCreateOptions) (*entities.SecretCreateReport, error) {
1414
opts := new(secrets.CreateOptions).
1515
WithDriver(options.Driver).
16-
WithDriverOpts(options.Opts).
16+
WithDriverOpts(options.DriverOpts).
1717
WithName(name)
1818
created, err := secrets.Create(ic.ClientCtx, reader, opts)
1919
if err != nil {

0 commit comments

Comments
 (0)