mirror of
https://github.com/lukaszraczylo/kubernetes-images-sync-operator.git
synced 2026-12-06 07:14:14 +00:00
ci(pr): grant actions read and stop using the deprecated Requeue
* ci(pr): grant actions read so the shared PR checks start go-pr.yaml's CodeQL job asks for actions: read. A reusable workflow cannot ask for more than its caller grants, so the whole PR run failed at startup with no jobs. Grant the missing scope. * refactor(controller): use RequeueAfter instead of the deprecated Requeue controller-runtime deprecates Result.Requeue (SA1019), which the PR checks now report because they finally start. Requeue after 30 seconds, the interval the cluster image controller already uses for its max-parallel wait. --------- Co-authored-by: Bug Fixer <[email protected]>
This commit is contained in:
@@ -162,7 +162,7 @@ func (s *ControllerTestSuite) TestClusterImageReconcile_InitialStatus_Pending()
|
||||
|
||||
result, err := reconciler.Reconcile(s.ctx, req)
|
||||
require.NoError(s.T(), err)
|
||||
assert.True(s.T(), result.Requeue) //nolint:staticcheck // testing controller's actual behavior
|
||||
assert.Positive(s.T(), result.RequeueAfter)
|
||||
|
||||
// Verify status was updated to PENDING
|
||||
updatedImage := &raczylocomv1.ClusterImage{}
|
||||
@@ -529,7 +529,7 @@ func (s *ControllerTestSuite) TestClusterImage_ConcurrentUpdates() {
|
||||
// First reconciliation should set status to PENDING
|
||||
result, err := reconciler.Reconcile(s.ctx, req)
|
||||
assert.NoError(s.T(), err)
|
||||
assert.True(s.T(), result.Requeue) //nolint:staticcheck // testing controller's actual behavior
|
||||
assert.Positive(s.T(), result.RequeueAfter)
|
||||
|
||||
// Verify status was set
|
||||
finalImage := &raczylocomv1.ClusterImage{}
|
||||
@@ -633,7 +633,7 @@ func (s *ControllerTestSuite) TestClusterImage_SHAPinnedImages() {
|
||||
|
||||
result, err := reconciler.Reconcile(s.ctx, req)
|
||||
assert.NoError(s.T(), err)
|
||||
assert.True(s.T(), result.Requeue) //nolint:staticcheck // testing controller's actual behavior
|
||||
assert.Positive(s.T(), result.RequeueAfter)
|
||||
}
|
||||
|
||||
func (s *ControllerTestSuite) TestClusterImage_MultipleRegistries() {
|
||||
@@ -678,7 +678,7 @@ func (s *ControllerTestSuite) TestClusterImage_MultipleRegistries() {
|
||||
|
||||
result, err := reconciler.Reconcile(s.ctx, req)
|
||||
assert.NoError(s.T(), err, "Failed for registry: %s", reg.name)
|
||||
assert.True(s.T(), result.Requeue) //nolint:staticcheck // testing controller's actual behavior
|
||||
assert.Positive(s.T(), result.RequeueAfter)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -785,7 +785,7 @@ func (s *ControllerTestSuite) TestClusterImage_EmptySpec() {
|
||||
result, err := reconciler.Reconcile(s.ctx, req)
|
||||
// Should not error, just set to pending
|
||||
assert.NoError(s.T(), err)
|
||||
assert.True(s.T(), result.Requeue) //nolint:staticcheck // testing controller's actual behavior
|
||||
assert.Positive(s.T(), result.RequeueAfter)
|
||||
}
|
||||
|
||||
func (s *ControllerTestSuite) TestClusterImageExport_EmptyNamespaces() {
|
||||
@@ -891,7 +891,7 @@ func (s *ControllerTestSuite) TestClusterImage_WithImagePullSecrets() {
|
||||
|
||||
result, err := reconciler.Reconcile(s.ctx, req)
|
||||
assert.NoError(s.T(), err)
|
||||
assert.True(s.T(), result.Requeue) //nolint:staticcheck // testing controller's actual behavior
|
||||
assert.Positive(s.T(), result.RequeueAfter)
|
||||
}
|
||||
|
||||
func (s *ControllerTestSuite) TestClusterImage_WithJobAnnotations() {
|
||||
@@ -923,7 +923,7 @@ func (s *ControllerTestSuite) TestClusterImage_WithJobAnnotations() {
|
||||
|
||||
result, err := reconciler.Reconcile(s.ctx, req)
|
||||
assert.NoError(s.T(), err)
|
||||
assert.True(s.T(), result.Requeue) //nolint:staticcheck // testing controller's actual behavior
|
||||
assert.Positive(s.T(), result.RequeueAfter)
|
||||
}
|
||||
|
||||
// ==================== Job Status Tests ====================
|
||||
|
||||
Reference in New Issue
Block a user