From 26ff9380fab4a0fa437cce2f26fda32a0a92768c Mon Sep 17 00:00:00 2001 From: Justin Kulikauskas Date: Tue, 8 Aug 2023 13:39:49 -0400 Subject: [PATCH] Set Burst and QPS on target k8s client Previously, these settings were not being applied to the config used in 'hosted mode'. This commit also includes a typo fix, and adjusts some settings used by the tests. Signed-off-by: Justin Kulikauskas --- main.go | 5 ++++- main_test.go | 1 + test/e2e/e2e_suite_test.go | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 2e6d49ba..9873e8cc 100644 --- a/main.go +++ b/main.go @@ -266,6 +266,9 @@ func main() { os.Exit(1) } + targetK8sConfig.Burst = int(opts.clientBurst) + targetK8sConfig.QPS = opts.clientQPS + targetK8sClient = kubernetes.NewForConfigOrDie(targetK8sConfig) targetK8sDynamicClient = dynamic.NewForConfigOrDie(targetK8sConfig) @@ -309,7 +312,7 @@ func main() { managerCtx, managerCancel := context.WithCancel(context.Background()) // PeriodicallyExecConfigPolicies is the go-routine that periodically checks the policies - log.V(1).Info("Perodically processing Configuration Policies", "frequency", opts.frequency) + log.V(1).Info("Periodically processing Configuration Policies", "frequency", opts.frequency) go func() { reconciler.PeriodicallyExecConfigPolicies(terminatingCtx, opts.frequency, mgr.Elected()) diff --git a/main_test.go b/main_test.go index e929e2ec..e5175632 100644 --- a/main_test.go +++ b/main_test.go @@ -20,6 +20,7 @@ func TestRunMain(t *testing.T) { args, "--leader-elect=false", fmt.Sprintf("--target-kubeconfig-path=%s", os.Getenv("TARGET_KUBECONFIG_PATH")), + "--log-level=1", ) main() diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index dd871045..9460b89b 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -14,6 +14,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/onsi/gomega/format" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -62,6 +63,8 @@ func init() { } var _ = BeforeSuite(func() { + format.TruncatedDiff = false + By("Setup Hub client") gvrPod = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} gvrNS = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "namespaces"}