summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-05 17:56:36 +0100
committerGitHub <noreply@github.com>2022-01-05 17:56:36 +0100
commit50e156b60536017fc1841ef6b875565cb1a08a4e (patch)
tree4dfe1e4929f29470cc5e99b955d47b7080ac1555 /libpod/options.go
parent2157414cf83a3b99accc2f52ac8da3f2f05bd8dd (diff)
parent289270375a54c26b86f9e2d99aab18b427e56b88 (diff)
downloadpodman-50e156b60536017fc1841ef6b875565cb1a08a4e.tar.gz
podman-50e156b60536017fc1841ef6b875565cb1a08a4e.tar.bz2
podman-50e156b60536017fc1841ef6b875565cb1a08a4e.zip
Merge pull request #12208 from cdoern/podSecurityOpt
Pod Security Option support and Infra Inheritance changes
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 204f2a457..6edb9972b 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1816,6 +1816,25 @@ func WithSelectedPasswordManagement(passwd *bool) CtrCreateOption {
}
}
+// WithInfraConfig allows for inheritance of compatible config entities from the infra container
+func WithInfraConfig(compatibleOptions InfraInherit) CtrCreateOption {
+ return func(ctr *Container) error {
+ if ctr.valid {
+ return define.ErrCtrFinalized
+ }
+ compatMarshal, err := json.Marshal(compatibleOptions)
+ if err != nil {
+ return errors.New("Could not marshal compatible options")
+ }
+
+ err = json.Unmarshal(compatMarshal, ctr.config)
+ if err != nil {
+ return errors.New("Could not unmarshal compatible options into contrainer config")
+ }
+ return nil
+ }
+}
+
// Pod Creation Options
// WithPodCreateCommand adds the full command plus arguments of the current