diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/adapter/pods.go | 34 | ||||
-rw-r--r-- | pkg/adapter/runtime.go | 2 | ||||
-rw-r--r-- | pkg/varlinkapi/system.go | 4 |
3 files changed, 21 insertions, 19 deletions
diff --git a/pkg/adapter/pods.go b/pkg/adapter/pods.go index ded805de2..70293a2c5 100644 --- a/pkg/adapter/pods.go +++ b/pkg/adapter/pods.go @@ -683,25 +683,27 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container containerConfig.User = imageData.Config.User } - if containerConfig.SecurityOpts != nil { - if containerYAML.SecurityContext.ReadOnlyRootFilesystem != nil { - containerConfig.ReadOnlyRootfs = *containerYAML.SecurityContext.ReadOnlyRootFilesystem - } - if containerYAML.SecurityContext.Privileged != nil { - containerConfig.Privileged = *containerYAML.SecurityContext.Privileged - } + if containerYAML.SecurityContext != nil { + if containerConfig.SecurityOpts != nil { + if containerYAML.SecurityContext.ReadOnlyRootFilesystem != nil { + containerConfig.ReadOnlyRootfs = *containerYAML.SecurityContext.ReadOnlyRootFilesystem + } + if containerYAML.SecurityContext.Privileged != nil { + containerConfig.Privileged = *containerYAML.SecurityContext.Privileged + } - if containerYAML.SecurityContext.AllowPrivilegeEscalation != nil { - containerConfig.NoNewPrivs = !*containerYAML.SecurityContext.AllowPrivilegeEscalation - } + if containerYAML.SecurityContext.AllowPrivilegeEscalation != nil { + containerConfig.NoNewPrivs = !*containerYAML.SecurityContext.AllowPrivilegeEscalation + } - } - if caps := containerYAML.SecurityContext.Capabilities; caps != nil { - for _, capability := range caps.Add { - containerConfig.CapAdd = append(containerConfig.CapAdd, string(capability)) } - for _, capability := range caps.Drop { - containerConfig.CapDrop = append(containerConfig.CapDrop, string(capability)) + if caps := containerYAML.SecurityContext.Capabilities; caps != nil { + for _, capability := range caps.Add { + containerConfig.CapAdd = append(containerConfig.CapAdd, string(capability)) + } + for _, capability := range caps.Drop { + containerConfig.CapDrop = append(containerConfig.CapDrop, string(capability)) + } } } diff --git a/pkg/adapter/runtime.go b/pkg/adapter/runtime.go index 0537308f8..dd15e1d15 100644 --- a/pkg/adapter/runtime.go +++ b/pkg/adapter/runtime.go @@ -185,7 +185,7 @@ func (r *LocalRuntime) CreateVolume(ctx context.Context, c *cliconfig.VolumeCrea options = append(options, libpod.WithVolumeLabels(labels)) } - if len(options) != 0 { + if len(opts) != 0 { options = append(options, libpod.WithVolumeOptions(opts)) } newVolume, err := r.NewVolume(ctx, options...) diff --git a/pkg/varlinkapi/system.go b/pkg/varlinkapi/system.go index 2de785b79..f6057f5fc 100644 --- a/pkg/varlinkapi/system.go +++ b/pkg/varlinkapi/system.go @@ -3,9 +3,9 @@ package varlinkapi import ( + "fmt" "github.com/containers/libpod/libpod/define" goruntime "runtime" - "strings" "time" "github.com/containers/libpod/cmd/podman/varlink" @@ -83,7 +83,7 @@ func (i *LibpodAPI) GetInfo(call iopodman.VarlinkCall) error { Images: int64(store["ImageStore"].(map[string]interface{})["number"].(int)), Run_root: store["RunRoot"].(string), Graph_root: store["GraphRoot"].(string), - Graph_driver_options: strings.Join(store["GraphOptions"].([]string), ", "), + Graph_driver_options: fmt.Sprintf("%v", store["GraphOptions"]), Graph_status: graphStatus, } |