aboutsummaryrefslogtreecommitdiff
path: root/pkg/domain/infra
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-21 13:15:28 +0200
committerGitHub <noreply@github.com>2022-09-21 13:15:28 +0200
commitffa73c58a52b470d9708a8ae38536fa0dc443d8b (patch)
tree5f946382c70e75a60595966442c2ce48924816b8 /pkg/domain/infra
parentfea325327106aebc08fd6b11bc77c434e614c3e9 (diff)
parent9bb51e8e96f98ab74d416a9af9bd708c7c503bdf (diff)
downloadpodman-ffa73c58a52b470d9708a8ae38536fa0dc443d8b.tar.gz
podman-ffa73c58a52b470d9708a8ae38536fa0dc443d8b.tar.bz2
podman-ffa73c58a52b470d9708a8ae38536fa0dc443d8b.zip
Merge pull request #15842 from ashley-cui/seclabels
Add labels to secrets
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/abi/secrets.go5
-rw-r--r--pkg/domain/infra/tunnel/secrets.go3
2 files changed, 7 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/secrets.go b/pkg/domain/infra/abi/secrets.go
index 47159d65a..2a377288b 100644
--- a/pkg/domain/infra/abi/secrets.go
+++ b/pkg/domain/infra/abi/secrets.go
@@ -45,6 +45,7 @@ func (ic *ContainerEngine) SecretCreate(ctx context.Context, name string, reader
storeOpts := secrets.StoreOptions{
DriverOpts: options.DriverOpts,
+ Labels: options.Labels,
}
secretID, err := manager.Store(name, data, options.Driver, storeOpts)
@@ -74,6 +75,9 @@ func (ic *ContainerEngine) SecretInspect(ctx context.Context, nameOrIDs []string
return nil, nil, fmt.Errorf("inspecting secret %s: %w", nameOrID, err)
}
}
+ if secret.Labels == nil {
+ secret.Labels = make(map[string]string)
+ }
report := &entities.SecretInfoReport{
ID: secret.ID,
CreatedAt: secret.CreatedAt,
@@ -84,6 +88,7 @@ func (ic *ContainerEngine) SecretInspect(ctx context.Context, nameOrIDs []string
Name: secret.Driver,
Options: secret.DriverOptions,
},
+ Labels: secret.Labels,
},
}
reports = append(reports, report)
diff --git a/pkg/domain/infra/tunnel/secrets.go b/pkg/domain/infra/tunnel/secrets.go
index d26718b12..aa48cb764 100644
--- a/pkg/domain/infra/tunnel/secrets.go
+++ b/pkg/domain/infra/tunnel/secrets.go
@@ -14,7 +14,8 @@ func (ic *ContainerEngine) SecretCreate(ctx context.Context, name string, reader
opts := new(secrets.CreateOptions).
WithDriver(options.Driver).
WithDriverOpts(options.DriverOpts).
- WithName(name)
+ WithName(name).
+ WithLabels(options.Labels)
created, err := secrets.Create(ic.ClientCtx, reader, opts)
if err != nil {
return nil, err