Skip to content

Commit e9a20b1

Browse files
author
Rohit Patil
committed
fix MustRunAs
1 parent d199cf5 commit e9a20b1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pkg/security/apis/security/v1/defaults.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,17 @@ func AddDefaultingFuncs(scheme *runtime.Scheme) error {
1212
scc := obj.(*v1.SecurityContextConstraints)
1313
sccdefaults.SetDefaults_SCC(scc)
1414

15-
// Default RunAsGroup to RunAsAny if not set
15+
// Default RunAsGroup to MustRunAs with ranges if not set
1616
if len(scc.RunAsGroup.Type) == 0 {
17-
scc.RunAsGroup.Type = v1.RunAsGroupStrategyRunAsAny
17+
min := int64(1000)
18+
max := int64(65534)
19+
scc.RunAsGroup.Type = v1.RunAsGroupStrategyMustRunAs
20+
scc.RunAsGroup.Ranges = []v1.RunAsGroupIDRange{
21+
{
22+
Min: &min,
23+
Max: &max,
24+
},
25+
}
1826
}
1927
})
2028

0 commit comments

Comments
 (0)