Skip to content

Commit

Permalink
feat: versioning --update #125234
Browse files Browse the repository at this point in the history
Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>
  • Loading branch information
nikzayn authored and pacoxu committed Sep 20, 2024
1 parent ab87218 commit 392967e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var (
"net.ipv4.tcp_keepalive_intvl",
"net.ipv4.tcp_keepalive_probes",
)
sysctlsAllowedV1Dot30 = sets.NewString(
sysctlsAllowedV1Dot32 = sets.NewString(
"net.ipv4.tcp_rmem",
"net.ipv4.tcp_wmem",
)
Expand All @@ -124,8 +124,8 @@ func sysctlsV1Dot29(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) Che
return sysctls(podMetadata, podSpec, sysctlsAllowedV1Dot29)
}

func sysctlsV1Dot30(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
return sysctls(podMetadata, podSpec, sysctlsAllowedV1Dot30)
func sysctlsV1Dot32(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec) CheckResult {
return sysctls(podMetadata, podSpec, sysctlsAllowedV1Dot32)
}

func sysctls(podMetadata *metav1.ObjectMeta, podSpec *corev1.PodSpec, sysctls_allowed_set sets.String) CheckResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func TestSysctls_1_30(t *testing.T) {

for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
result := sysctlsV1Dot30(&tc.pod.ObjectMeta, &tc.pod.Spec)
result := sysctlsV1Dot32(&tc.pod.ObjectMeta, &tc.pod.Spec)
if !tc.allowed {
if result.Allowed {
t.Fatal("expected disallowed")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func init() {
fixtureDataV1Dot29,
)

fixtureDataV1Dot30 := fixtureGenerator{
fixtureDataV1Dot32 := fixtureGenerator{
expectErrorSubstring: "forbidden sysctl",
generatePass: func(p *corev1.Pod) []*corev1.Pod {
if p.Spec.SecurityContext == nil {
Expand Down Expand Up @@ -188,7 +188,7 @@ func init() {
},
}
registerFixtureGenerator(
fixtureKey{level: api.LevelBaseline, version: api.MajorMinorVersion(1, 29), check: "sysctls"},
fixtureDataV1Dot30,
fixtureKey{level: api.LevelBaseline, version: api.MajorMinorVersion(1, 32), check: "sysctls"},
fixtureDataV1Dot32,
)
}

0 comments on commit 392967e

Please sign in to comment.