Skip to content

Commit

Permalink
fix: controller manager polling (#146)
Browse files Browse the repository at this point in the history
* fix controller manager polling

* fix unit tests
  • Loading branch information
zreigz authored Mar 18, 2024
1 parent efeca26 commit 8f9e335
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/controller/controller_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ func (cm *ControllerManager) Start() error {
go func() {
defer controller.Do.ShutdownQueue()
defer controller.Do.WipeCache()
_ = wait.PollUntilContextTimeout(cm.ctx, cm.Refresh, time.Minute, true, func(ctx context.Context) (done bool, err error) {
//nolint:all
_ = wait.PollImmediateInfinite(cm.Refresh, func() (done bool, err error) {
return controller.Do.Poll(cm.ctx)
})
}()
Expand All @@ -94,7 +95,8 @@ func (cm *ControllerManager) Start() error {
}

go func() {
_ = wait.PollUntilContextTimeout(cm.ctx, cm.Refresh, time.Minute, true, func(ctx context.Context) (done bool, err error) {
//nolint:all
_ = wait.PollImmediateInfinite(cm.Refresh, func() (done bool, err error) {
return false, cm.Socket.Join()
})
}()
Expand Down
4 changes: 4 additions & 0 deletions pkg/manifests/template/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ var _ = Describe("Helm template", func() {
svc := &console.GetServiceDeploymentForAgent_ServiceDeployment{
Namespace: "default",
Name: "test",
Cluster: &console.GetServiceDeploymentForAgent_ServiceDeployment_Cluster{
ID: "123",
Name: "test",
},
}

r := gin.Default()
Expand Down
4 changes: 4 additions & 0 deletions pkg/manifests/template/raw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ var _ = Describe("Raw template", func() {
Value: name,
},
}
svc.Cluster = &console.GetServiceDeploymentForAgent_ServiceDeployment_Cluster{
ID: "123",
Name: "test",
}
resp, err := NewRaw(dir).Render(svc, utilFactory)
Expect(err).NotTo(HaveOccurred())
Expect(len(resp)).To(Equal(1))
Expand Down

0 comments on commit 8f9e335

Please sign in to comment.