From 4ba20cd9d89eaed4f16af1b01e1e7b0f5c9afe48 Mon Sep 17 00:00:00 2001 From: Melisa Griffin Date: Fri, 28 Jun 2024 13:01:44 -0400 Subject: [PATCH] Update test to actually test for UID and Group --- control-plane/api-gateway/gatekeeper/gatekeeper_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/control-plane/api-gateway/gatekeeper/gatekeeper_test.go b/control-plane/api-gateway/gatekeeper/gatekeeper_test.go index 003d653379..7bcee54d8a 100644 --- a/control-plane/api-gateway/gatekeeper/gatekeeper_test.go +++ b/control-plane/api-gateway/gatekeeper/gatekeeper_test.go @@ -20,6 +20,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" gwv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" @@ -1479,6 +1480,11 @@ func validateResourcesExist(t *testing.T, client client.Client, helmConfig commo assert.Equal(t, helmConfig.InitContainerResources.Limits, container.Resources.Limits) assert.Equal(t, helmConfig.InitContainerResources.Requests, container.Resources.Requests) } + + if helmConfig.EnableOpenShift { + assert.Equal(t, container.SecurityContext.RunAsUser, pointer.Int64(1000700000)) + assert.Equal(t, container.SecurityContext.RunAsGroup, pointer.Int64(1000700000)) + } } } assert.True(t, hasInitContainer)