From d4092189a5a531d8c44f5bf6201791c145ff500f Mon Sep 17 00:00:00 2001 From: Heba <31887807+helayoty@users.noreply.github.com> Date: Wed, 1 May 2024 16:06:18 -0700 Subject: [PATCH] feat: Add feature gates flag (#368) **Reason for Change**: - Add `feature-gates` flag to the Kaito controller. - Support the `karpenter` feature gate with default value, `false`. - Enable setting the feature gate flag via helm chart. In addition to some chores: - Exclude the auto generated and mock files from unit test coverage. - Upgrade k8s version using in the tests to the current supported version. **Requirements** - [x] added unit tests and e2e tests (if applicable). **Issue Fixed**: **Notes for Reviewers**: --------- Signed-off-by: Heba Elayoty --- pkg/tuning/preset-tuning_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/tuning/preset-tuning_test.go b/pkg/tuning/preset-tuning_test.go index 7553e47d0..38b4996de 100644 --- a/pkg/tuning/preset-tuning_test.go +++ b/pkg/tuning/preset-tuning_test.go @@ -186,6 +186,7 @@ func TestEnsureTuningConfigMap(t *testing.T) { os.Setenv(consts.DefaultReleaseNamespaceEnvVar, "release-namespace") }, callMocks: func(c *test.MockClient) { + os.Setenv(consts.DefaultReleaseNamespaceEnvVar, "release-namespace") c.On("Get", mock.IsType(context.Background()), mock.Anything, mock.IsType(&corev1.ConfigMap{}), mock.Anything).Return(nil) }, workspaceObj: &kaitov1alpha1.Workspace{ @@ -211,6 +212,7 @@ func TestEnsureTuningConfigMap(t *testing.T) { os.Setenv(consts.DefaultReleaseNamespaceEnvVar, "release-namespace") }, callMocks: func(c *test.MockClient) { + os.Setenv(consts.DefaultReleaseNamespaceEnvVar, "release-namespace") c.On("Get", mock.IsType(context.Background()), mock.Anything, mock.IsType(&corev1.ConfigMap{}), mock.Anything).Return(errors.NewNotFound(schema.GroupResource{}, "config-template")) }, workspaceObj: &kaitov1alpha1.Workspace{