-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pr feedback: move configOpt to securitypolicy package.
Signed-off-by: Maksim An <maksiman@microsoft.com>
- Loading branch information
Showing
3 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package securitypolicy | ||
|
||
type ContainerConfigOpt func(*ContainerConfig) error | ||
|
||
// WithEnvVarRules adds environment variable constraints to container policy config. | ||
func WithEnvVarRules(envs []EnvRuleConfig) ContainerConfigOpt { | ||
return func(c *ContainerConfig) error { | ||
c.EnvRules = append(c.EnvRules, envs...) | ||
return nil | ||
} | ||
} | ||
|
||
// WithExpectedMounts adds expected mounts to container policy config. | ||
func WithExpectedMounts(em []string) ContainerConfigOpt { | ||
return func(c *ContainerConfig) error { | ||
c.ExpectedMounts = append(c.ExpectedMounts, em...) | ||
return nil | ||
} | ||
} | ||
|
||
// WithWorkingDir sets working directory in container policy config. | ||
func WithWorkingDir(wd string) ContainerConfigOpt { | ||
return func(c *ContainerConfig) error { | ||
c.WorkingDir = wd | ||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/opts.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.