Skip to content

Commit 8f9e335

Browse files
authored
fix: controller manager polling (#146)
* fix controller manager polling * fix unit tests
1 parent efeca26 commit 8f9e335

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

pkg/controller/controller_manager.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ func (cm *ControllerManager) Start() error {
8383
go func() {
8484
defer controller.Do.ShutdownQueue()
8585
defer controller.Do.WipeCache()
86-
_ = wait.PollUntilContextTimeout(cm.ctx, cm.Refresh, time.Minute, true, func(ctx context.Context) (done bool, err error) {
86+
//nolint:all
87+
_ = wait.PollImmediateInfinite(cm.Refresh, func() (done bool, err error) {
8788
return controller.Do.Poll(cm.ctx)
8889
})
8990
}()
@@ -94,7 +95,8 @@ func (cm *ControllerManager) Start() error {
9495
}
9596

9697
go func() {
97-
_ = wait.PollUntilContextTimeout(cm.ctx, cm.Refresh, time.Minute, true, func(ctx context.Context) (done bool, err error) {
98+
//nolint:all
99+
_ = wait.PollImmediateInfinite(cm.Refresh, func() (done bool, err error) {
98100
return false, cm.Socket.Join()
99101
})
100102
}()

pkg/manifests/template/helm_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ var _ = Describe("Helm template", func() {
1919
svc := &console.GetServiceDeploymentForAgent_ServiceDeployment{
2020
Namespace: "default",
2121
Name: "test",
22+
Cluster: &console.GetServiceDeploymentForAgent_ServiceDeployment_Cluster{
23+
ID: "123",
24+
Name: "test",
25+
},
2226
}
2327

2428
r := gin.Default()

pkg/manifests/template/raw_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ var _ = Describe("Raw template", func() {
2525
Value: name,
2626
},
2727
}
28+
svc.Cluster = &console.GetServiceDeploymentForAgent_ServiceDeployment_Cluster{
29+
ID: "123",
30+
Name: "test",
31+
}
2832
resp, err := NewRaw(dir).Render(svc, utilFactory)
2933
Expect(err).NotTo(HaveOccurred())
3034
Expect(len(resp)).To(Equal(1))

0 commit comments

Comments
 (0)