summaryrefslogtreecommitdiff
path: root/pkg/spec/security.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-01-08 15:34:11 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-01-08 15:44:30 +0100
commit1d1519b08b685af594ee4577f24c24b94e992b63 (patch)
treed7275651e2d750e01c0e2a49fa6080734a2a7348 /pkg/spec/security.go
parent83764b84ec1aebfae0053a52b67d7f357545b6c9 (diff)
downloadpodman-1d1519b08b685af594ee4577f24c24b94e992b63.tar.gz
podman-1d1519b08b685af594ee4577f24c24b94e992b63.tar.bz2
podman-1d1519b08b685af594ee4577f24c24b94e992b63.zip
fix lint - pkg/spec
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/spec/security.go')
-rw-r--r--pkg/spec/security.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/spec/security.go b/pkg/spec/security.go
index 05ed94e66..372fe87c6 100644
--- a/pkg/spec/security.go
+++ b/pkg/spec/security.go
@@ -11,6 +11,8 @@ import (
"github.com/pkg/errors"
)
+// ToCreateOptions convert the SecurityConfig to a slice of container create
+// options.
func (c *SecurityConfig) ToCreateOptions() ([]libpod.CtrCreateOption, error) {
options := make([]libpod.CtrCreateOption, 0)
options = append(options, libpod.WithSecLabels(c.LabelOpts))
@@ -18,6 +20,8 @@ func (c *SecurityConfig) ToCreateOptions() ([]libpod.CtrCreateOption, error) {
return options, nil
}
+// SetLabelOpts sets the label options of the SecurityConfig according to the
+// input.
func (c *SecurityConfig) SetLabelOpts(runtime *libpod.Runtime, pidConfig *PidConfig, ipcConfig *IpcConfig) error {
if c.Privileged {
c.LabelOpts = label.DisableSecOpt()
@@ -57,6 +61,7 @@ func (c *SecurityConfig) SetLabelOpts(runtime *libpod.Runtime, pidConfig *PidCon
return nil
}
+// SetSecurityOpts the the security options (labels, apparmor, seccomp, etc.).
func (c *SecurityConfig) SetSecurityOpts(runtime *libpod.Runtime, securityOpts []string) error {
for _, opt := range securityOpts {
if opt == "no-new-privileges" {
@@ -91,6 +96,7 @@ func (c *SecurityConfig) SetSecurityOpts(runtime *libpod.Runtime, securityOpts [
return nil
}
+// ConfigureGenerator configures the generator according to the input.
func (c *SecurityConfig) ConfigureGenerator(g *generate.Generator, user *UserConfig) error {
// HANDLE CAPABILITIES
// NOTE: Must happen before SECCOMP