Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pkg/api/serialization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ func originFuzzer(t *testing.T, seed int64) *fuzz.Fuzzer {
scc.SupplementalGroups.Type = supGroupTypes[c.Rand.Intn(len(supGroupTypes))]
fsGroupTypes := []securityapi.FSGroupStrategyType{securityapi.FSGroupStrategyMustRunAs, securityapi.FSGroupStrategyRunAsAny}
scc.FSGroup.Type = fsGroupTypes[c.Rand.Intn(len(fsGroupTypes))]
// avoid the defaulting logic for this field by making it never nil
allowPrivilegeEscalation := c.RandBool()
scc.AllowPrivilegeEscalation = &allowPrivilegeEscalation

// when fuzzing the volume types ensure it is set to avoid the defaulter's expansion.
// Do not use FSTypeAll or host dir setting to steer clear of defaulting mechanics
Expand All @@ -532,11 +535,6 @@ func originFuzzer(t *testing.T, seed int64) *fuzz.Fuzzer {
securityapi.FSTypeRBD,
securityapi.FSTypeSecret}
scc.Volumes = []securityapi.FSType{volumeTypes[c.Rand.Intn(len(volumeTypes))]}

// match to the defaulting logic that is used to be backward compatible
yes := true
scc.AllowPrivilegeEscalation = &yes
scc.DefaultAllowPrivilegeEscalation = nil
},
)
return f
Expand Down
Loading