test: satisfy Go 1.27 modernization lint
Verify / test (pull_request) Failing after 5m11s
Verify / lint (pull_request) Failing after 6m5s

This commit is contained in:
2026-09-17 19:06:39 +00:00
parent 4846ff2aba
commit 5bd0455940
+3 -3
View File
@@ -48,7 +48,7 @@ func TestJobCRDValidation(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
ctx := context.Background() ctx := context.Background()
namespace := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "api-validation"}} namespace := &corev1.Namespace{ObjectMeta: {Name: "api-validation"}}
if err := client.Create(ctx, namespace); err != nil { if err := client.Create(ctx, namespace); err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -70,7 +70,7 @@ func TestJobCRDValidation(t *testing.T) {
Name: "TOKEN", Name: "TOKEN",
Value: &literal, Value: &literal,
ValueFrom: &executionv1alpha1.EnvVarSource{ ValueFrom: &executionv1alpha1.EnvVarSource{
SecretKeyRef: &corev1.SecretKeySelector{LocalObjectReference: corev1.LocalObjectReference{Name: "token"}, Key: "value"}, SecretKeyRef: &corev1.SecretKeySelector{LocalObjectReference: {Name: "token"}, Key: "value"},
}, },
}} }}
if err := client.Create(ctx, job); !apierrors.IsInvalid(err) { if err := client.Create(ctx, job); !apierrors.IsInvalid(err) {
@@ -107,7 +107,7 @@ func TestJobCRDValidation(t *testing.T) {
func validJob(name string) *executionv1alpha1.Job { func validJob(name string) *executionv1alpha1.Job {
return &executionv1alpha1.Job{ return &executionv1alpha1.Job{
ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: "api-validation"}, ObjectMeta: {Name: name, Namespace: "api-validation"},
Spec: executionv1alpha1.JobSpec{ Spec: executionv1alpha1.JobSpec{
Task: executionv1alpha1.TaskSpec{Image: "docker.io/library/alpine:3.22"}, Task: executionv1alpha1.TaskSpec{Image: "docker.io/library/alpine:3.22"},
}, },