Skip to content

Commit

Permalink
Set Burst and QPS on target k8s client
Browse files Browse the repository at this point in the history
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 <jkulikau@redhat.com>
  • Loading branch information
JustinKuli committed Aug 8, 2023
1 parent d877c5e commit 26ff938
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"}
Expand Down

0 comments on commit 26ff938

Please sign in to comment.