Skip to content

Commit e666f92

Browse files
author
Ma Shimiao
committed
cap: drop existent item before validating
Signed-off-by: Ma Shimiao <[email protected]>
1 parent d09d81a commit e666f92

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

generate/generate.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,9 +1050,6 @@ func (g *Generator) AddProcessCapability(c string) error {
10501050
// DropProcessCapability drops a process capability from g.spec.Process.Capabilities.
10511051
func (g *Generator) DropProcessCapability(c string) error {
10521052
cp := strings.ToUpper(c)
1053-
if err := validate.CapValid(cp, false); err != nil {
1054-
return err
1055-
}
10561053

10571054
g.initSpecProcessCapabilities()
10581055

@@ -1092,6 +1089,10 @@ func (g *Generator) DropProcessCapability(c string) error {
10921089
}
10931090
}
10941091

1092+
if err := validate.CapValid(cp, false); err != nil {
1093+
return err
1094+
}
1095+
10951096
return nil
10961097
}
10971098

0 commit comments

Comments
 (0)