Skip to content

Commit d17cbb1

Browse files
authored
Merge pull request #298 from authzed/1292
Add 1.29.5 to the stable channel
2 parents 69f5f60 + a3ad09d commit d17cbb1

14 files changed

+298
-41
lines changed

cmd/spicedb-operator/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func main() {
2323
versionCmd := &cobra.Command{
2424
Use: "version",
2525
Short: "display operator version information",
26-
Run: func(cmd *cobra.Command, args []string) {
26+
Run: func(_ *cobra.Command, _ []string) {
2727
fmt.Println(version.UsageVersion(includeDeps))
2828
},
2929
}

pkg/cmd/run/run.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func NewCmdRun(o *Options) *cobra.Command {
6161
Use: "run [flags]",
6262
DisableFlagsInUseLine: true,
6363
Short: "run SpiceDB operator",
64-
Run: func(cmd *cobra.Command, args []string) {
64+
Run: func(_ *cobra.Command, _ []string) {
6565
ctx := genericapiserver.SetupSignalContext()
6666
cmdutil.CheckErr(o.Validate())
6767
cmdutil.CheckErr(o.Run(ctx, f))

pkg/controller/check_migrations_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ func TestCheckMigrationsHandler(t *testing.T) {
115115
var called handler.Key
116116
h := &MigrationCheckHandler{
117117
recorder: recorder,
118-
nextDeploymentHandler: handler.ContextHandlerFunc(func(ctx context.Context) {
118+
nextDeploymentHandler: handler.ContextHandlerFunc(func(_ context.Context) {
119119
called = HandlerDeploymentKey
120120
}),
121-
nextWaitForJobHandler: handler.ContextHandlerFunc(func(ctx context.Context) {
121+
nextWaitForJobHandler: handler.ContextHandlerFunc(func(_ context.Context) {
122122
called = HandlerWaitForMigrationsKey
123123
}),
124-
nextMigrationRunHandler: handler.ContextHandlerFunc(func(ctx context.Context) {
124+
nextMigrationRunHandler: handler.ContextHandlerFunc(func(_ context.Context) {
125125
called = HandlerMigrationRunKey
126126
}),
127127
}

pkg/controller/cleanup_job_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,17 @@ func TestCleanupJobsHandler(t *testing.T) {
159159
deletedPods := make([]string, 0)
160160
deletedJobs := make([]string, 0)
161161
h := &JobCleanupHandler{
162-
getJobs: func(ctx context.Context) []*batchv1.Job {
162+
getJobs: func(_ context.Context) []*batchv1.Job {
163163
return tt.existingJobs
164164
},
165-
getJobPods: func(ctx context.Context) []*corev1.Pod {
165+
getJobPods: func(_ context.Context) []*corev1.Pod {
166166
return tt.existingJobPods
167167
},
168-
deletePod: func(ctx context.Context, nn types.NamespacedName) error {
168+
deletePod: func(_ context.Context, nn types.NamespacedName) error {
169169
deletedPods = append(deletedPods, nn.Name)
170170
return nil
171171
},
172-
deleteJob: func(ctx context.Context, nn types.NamespacedName) error {
172+
deleteJob: func(_ context.Context, nn types.NamespacedName) error {
173173
deletedJobs = append(deletedJobs, nn.Name)
174174
return nil
175175
},

pkg/controller/controller.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ func NewController(ctx context.Context, registry *typed.Registry, dclient dynami
108108
if len(configFilePath) > 0 {
109109
inf := fileInformerFactory.ForResource(fileinformer.FileGroupVersion.WithResource(configFilePath)).Informer()
110110
if _, err := inf.AddEventHandler(cache.ResourceEventHandlerFuncs{
111-
AddFunc: func(obj interface{}) { c.loadConfig(configFilePath) },
112-
UpdateFunc: func(_, obj interface{}) { c.loadConfig(configFilePath) },
113-
DeleteFunc: func(obj interface{}) { c.loadConfig(configFilePath) },
111+
AddFunc: func(_ any) { c.loadConfig(configFilePath) },
112+
UpdateFunc: func(_, _ any) { c.loadConfig(configFilePath) },
113+
DeleteFunc: func(_ any) { c.loadConfig(configFilePath) },
114114
}); err != nil {
115115
return nil, err
116116
}
@@ -126,8 +126,8 @@ func NewController(ctx context.Context, registry *typed.Registry, dclient dynami
126126
nil,
127127
)
128128
if _, err := ownedInformerFactory.ForResource(v1alpha1ClusterGVR).Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
129-
AddFunc: func(obj interface{}) { c.enqueue(v1alpha1ClusterGVR, obj) },
130-
UpdateFunc: func(_, obj interface{}) { c.enqueue(v1alpha1ClusterGVR, obj) },
129+
AddFunc: func(obj any) { c.enqueue(v1alpha1ClusterGVR, obj) },
130+
UpdateFunc: func(_, obj any) { c.enqueue(v1alpha1ClusterGVR, obj) },
131131
// Delete is not used right now, we rely on ownerrefs to clean up
132132
}); err != nil {
133133
return nil, err
@@ -158,9 +158,9 @@ func NewController(ctx context.Context, registry *typed.Registry, dclient dynami
158158
return nil, err
159159
}
160160
if _, err := inf.AddEventHandler(cache.ResourceEventHandlerFuncs{
161-
AddFunc: func(obj interface{}) { c.syncExternalResource(obj) },
162-
UpdateFunc: func(_, obj interface{}) { c.syncExternalResource(obj) },
163-
DeleteFunc: func(obj interface{}) { c.syncExternalResource(obj) },
161+
AddFunc: func(obj any) { c.syncExternalResource(obj) },
162+
UpdateFunc: func(_, obj any) { c.syncExternalResource(obj) },
163+
DeleteFunc: func(obj any) { c.syncExternalResource(obj) },
164164
}); err != nil {
165165
return nil, err
166166
}
@@ -447,7 +447,7 @@ func (c *Controller) secretAdopter(next ...handler.Handler) handler.Handler {
447447
QueueOps.RequeueAPIErr(ctx, err)
448448
}
449449
// keep checking to see if the secret is added
450-
QueueOps.Requeue(ctx)
450+
QueueOps.RequeueErr(ctx, err)
451451
},
452452
typed.IndexerFor[*corev1.Secret](c.Registry, typed.NewRegistryKey(DependentFactoryKey, secretsGVR)),
453453
func(ctx context.Context, secret *applycorev1.SecretApplyConfiguration, options metav1.ApplyOptions) (*corev1.Secret, error) {

pkg/controller/ensure_deployment_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -366,22 +366,22 @@ func TestEnsureDeploymentHandler(t *testing.T) {
366366

367367
var called handler.Key
368368
h := &DeploymentHandler{
369-
applyDeployment: func(ctx context.Context, dep *applyappsv1.DeploymentApplyConfiguration) (*appsv1.Deployment, error) {
369+
applyDeployment: func(_ context.Context, _ *applyappsv1.DeploymentApplyConfiguration) (*appsv1.Deployment, error) {
370370
applyCalled = true
371371
return nil, nil
372372
},
373-
deleteDeployment: func(ctx context.Context, nn types.NamespacedName) error {
373+
deleteDeployment: func(_ context.Context, _ types.NamespacedName) error {
374374
deleteCalled = true
375375
return nil
376376
},
377-
getDeploymentPods: func(ctx context.Context) []*corev1.Pod {
377+
getDeploymentPods: func(_ context.Context) []*corev1.Pod {
378378
return tt.pods
379379
},
380-
patchStatus: func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error {
380+
patchStatus: func(_ context.Context, _ *v1alpha1.SpiceDBCluster) error {
381381
patchCalled = true
382382
return nil
383383
},
384-
next: handler.ContextHandlerFunc(func(ctx context.Context) {
384+
next: handler.ContextHandlerFunc(func(_ context.Context) {
385385
called = nextKey
386386
}),
387387
}

pkg/controller/pause_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func TestPauseHandler(t *testing.T) {
107107
ctx = CtxCluster.WithValue(ctx, tt.cluster)
108108
ctx = CtxCluster.WithValue(ctx, tt.cluster)
109109
var called handler.Key
110-
NewPauseHandler(func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error {
110+
NewPauseHandler(func(_ context.Context, patch *v1alpha1.SpiceDBCluster) error {
111111
patchCalled = true
112112

113113
if tt.patchError != nil {
@@ -123,7 +123,7 @@ func TestPauseHandler(t *testing.T) {
123123
}), "conditions not equal:\na: %#v\nb: %#v", tt.expectConditions, patch.Status.Conditions)
124124

125125
return nil
126-
}, handler.ContextHandlerFunc(func(ctx context.Context) {
126+
}, handler.ContextHandlerFunc(func(_ context.Context) {
127127
called = nextKey
128128
})).Handle(ctx)
129129

pkg/controller/run_migration_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ func TestRunMigrationHandler(t *testing.T) {
102102
ctx = CtxMigrationHash.WithValue(ctx, tt.migrationHash)
103103

104104
h := &MigrationRunHandler{
105-
patchStatus: func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error {
105+
patchStatus: func(_ context.Context, _ *v1alpha1.SpiceDBCluster) error {
106106
return nil
107107
},
108-
applyJob: func(ctx context.Context, job *applybatchv1.JobApplyConfiguration) error {
108+
applyJob: func(_ context.Context, _ *applybatchv1.JobApplyConfiguration) error {
109109
applyCalled = true
110110
return tt.jobApplyErr
111111
},
112-
deleteJob: func(ctx context.Context, nn types.NamespacedName) error {
112+
deleteJob: func(_ context.Context, _ types.NamespacedName) error {
113113
deleteCalled = true
114114
return tt.jobDeleteErr
115115
},

pkg/controller/secret_adoption_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestSecretAdopterHandler(t *testing.T) {
3030
err error
3131
}
3232

33-
secretNotFound := func(name string) error {
33+
secretNotFound := func(_ string) error {
3434
return apierrors.NewNotFound(
3535
corev1.SchemeGroupVersion.WithResource("secrets").GroupResource(),
3636
"test")
@@ -308,21 +308,21 @@ func TestSecretAdopterHandler(t *testing.T) {
308308
applyCallIndex := 0
309309
s := NewSecretAdoptionHandler(
310310
recorder,
311-
func(ctx context.Context) (*corev1.Secret, error) {
311+
func(_ context.Context) (*corev1.Secret, error) {
312312
return tt.secretInCache, tt.cacheErr
313313
},
314-
func(ctx context.Context, err error) {
314+
func(_ context.Context, err error) {
315315
require.Equal(t, tt.expectObjectMissingErr, err)
316316
},
317317
typed.NewIndexer[*corev1.Secret](indexer),
318-
func(ctx context.Context, secret *applycorev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Secret, err error) {
318+
func(_ context.Context, secret *applycorev1.SecretApplyConfiguration, _ metav1.ApplyOptions) (result *corev1.Secret, err error) {
319319
defer func() { applyCallIndex++ }()
320320
call := tt.applyCalls[applyCallIndex]
321321
call.called = true
322322
require.Equal(t, call.input, secret, "error on call %d", applyCallIndex)
323323
return call.result, call.err
324324
},
325-
func(ctx context.Context, nn types.NamespacedName) error {
325+
func(_ context.Context, _ types.NamespacedName) error {
326326
return tt.secretExistsErr
327327
},
328328
handler.NewHandlerFromFunc(func(ctx context.Context) {

pkg/controller/validate_config_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@ func TestValidateConfigHandler(t *testing.T) {
243243
})
244244
var called handler.Key
245245
h := &ValidateConfigHandler{
246-
patchStatus: func(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error {
246+
patchStatus: func(_ context.Context, _ *v1alpha1.SpiceDBCluster) error {
247247
patchCalled = true
248248
return nil
249249
},
250250
recorder: recorder,
251-
next: handler.ContextHandlerFunc(func(ctx context.Context) {
251+
next: handler.ContextHandlerFunc(func(_ context.Context) {
252252
called = nextKey
253253
}),
254254
}

pkg/controller/wait_for_migrations_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ func TestWaitForMigrationsHandler(t *testing.T) {
6666
var called handler.Key
6767
h := &WaitForMigrationsHandler{
6868
recorder: recorder,
69-
nextSelfPause: handler.ContextHandlerFunc(func(ctx context.Context) {
69+
nextSelfPause: handler.ContextHandlerFunc(func(_ context.Context) {
7070
called = HandlerSelfPauseKey
7171
}),
72-
nextDeploymentHandler: handler.ContextHandlerFunc(func(ctx context.Context) {
72+
nextDeploymentHandler: handler.ContextHandlerFunc(func(_ context.Context) {
7373
called = HandlerDeploymentKey
7474
}),
7575
}

0 commit comments

Comments
 (0)