test: satisfy Go 1.27 modernization lint
This commit is contained in:
@@ -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"},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user