summaryrefslogtreecommitdiff
path: root/pkg/spec/security.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-08 16:58:50 +0100
committerGitHub <noreply@github.com>2020-01-08 16:58:50 +0100
commitc6ad42a176c943aa96a8c053682196cd38fd6a1a (patch)
treeef71ccbda94462f1bee19e8153c361751813df8a /pkg/spec/security.go
parent27caffbb240725255485deaaecd548663adbf1fd (diff)
parentbcf5753276fcb7280924b46c7c49ef3e2388c9b0 (diff)
downloadpodman-c6ad42a176c943aa96a8c053682196cd38fd6a1a.tar.gz
podman-c6ad42a176c943aa96a8c053682196cd38fd6a1a.tar.bz2
podman-c6ad42a176c943aa96a8c053682196cd38fd6a1a.zip
Merge pull request #4816 from vrothberg/lint
Fix golint errors
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