Skip to content

Commit c91307b

Browse files
author
Mrunal Patel
authored
Merge pull request #298 from Mashimiao/generate-fix-remove-all-parse
generate: fix *-remove-all parse bug
2 parents 015f898 + 346850a commit c91307b

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

cmd/oci-runtime-tool/generate.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
260260
}
261261
}
262262

263-
privileged := false
264-
if context.IsSet("privileged") {
265-
privileged = context.Bool("privileged")
266-
}
267-
g.SetupPrivileged(privileged)
263+
g.SetupPrivileged(context.Bool("privileged"))
268264

269265
if context.IsSet("cap-add") {
270266
addCaps := context.StringSlice("cap-add")
@@ -482,7 +478,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
482478
}
483479
}
484480

485-
if context.IsSet("rlimits-remove-all") {
481+
if context.Bool("rlimits-remove-all") {
486482
g.ClearProcessRlimits()
487483
}
488484

@@ -680,7 +676,7 @@ func addSeccomp(context *cli.Context, g *generate.Generator) error {
680676
}
681677
}
682678

683-
if context.IsSet("seccomp-remove-all") {
679+
if context.Bool("seccomp-remove-all") {
684680
err := g.RemoveAllSeccompRules()
685681
if err != nil {
686682
return err

0 commit comments

Comments
 (0)