Skip to content

Commit

Permalink
set work agent status-sync-interval when the replica is 1
Browse files Browse the repository at this point in the history
Signed-off-by: zhujian <jiazhu@redhat.com>
  • Loading branch information
zhujian7 committed Sep 18, 2023
1 parent bd4982f commit 0e0069b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ spec:
- "--terminate-on-files=/spoke/hub-kubeconfig/kubeconfig"
{{if eq .Replica 1}}
- "--disable-leader-election"
- "--status-sync-interval=60s"
{{end}}
{{if gt .ClientCertExpirationSeconds 0}}
- "--client-cert-expiration-seconds={{ .ClientCertExpirationSeconds }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ spec:
- "--terminate-on-files=/spoke/hub-kubeconfig/kubeconfig"
{{if eq .Replica 1}}
- "--disable-leader-election"
- "--status-sync-interval=60s"
{{end}}
env:
- name: POD_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func assertWorkDeployment(t *testing.T, actions []clienttesting.Action, verb, cl
expectArgs = append(expectArgs, "--terminate-on-files=/spoke/hub-kubeconfig/kubeconfig")

if *deployment.Spec.Replicas == 1 {
expectArgs = append(expectArgs, "--disable-leader-election")
expectArgs = append(expectArgs, "--disable-leader-election", "--status-sync-interval=60s")
}

if !equality.Semantic.DeepEqual(args, expectArgs) {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/operator/klusterlet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ var _ = ginkgo.Describe("Klusterlet", func() {
gomega.Expect(len(actual.Spec.Template.Spec.Containers)).Should(gomega.Equal(1))
// klusterlet has no condition, replica is 0
gomega.Expect(actual.Status.Replicas).Should(gomega.Equal(int32(0)))
gomega.Expect(len(actual.Spec.Template.Spec.Containers[0].Args)).Should(gomega.Equal(7))
gomega.Expect(len(actual.Spec.Template.Spec.Containers[0].Args)).Should(gomega.Equal(8))
return actual.Spec.Template.Spec.Containers[0].Args[2] != "--spoke-cluster-name=cluster2"
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeTrue())

Expand Down

0 comments on commit 0e0069b

Please sign in to comment.