CI: Bump golangci-lint to 2.0.2 (#103572)
This commit is contained in:
committed by
GitHub
parent
b58b6e828e
commit
757be6365a
@@ -63,8 +63,8 @@ func RunTestCreate(ctx context.Context, t *testing.T, store storage.Interface, v
|
||||
return
|
||||
}
|
||||
// basic tests of the output
|
||||
if tt.inputObj.ObjectMeta.Name != out.ObjectMeta.Name {
|
||||
t.Errorf("pod name want=%s, get=%s", tt.inputObj.ObjectMeta.Name, out.ObjectMeta.Name)
|
||||
if tt.inputObj.Name != out.Name {
|
||||
t.Errorf("pod name want=%s, get=%s", tt.inputObj.Name, out.Name)
|
||||
}
|
||||
if out.ResourceVersion == "" {
|
||||
t.Errorf("output should have non-empty resource version")
|
||||
@@ -360,7 +360,7 @@ func RunTestDeleteWithSuggestionAndConflict(ctx context.Context, t *testing.T, s
|
||||
if err := store.GuaranteedUpdate(ctx, key, updatedPod, false, nil,
|
||||
storage.SimpleUpdate(func(obj runtime.Object) (runtime.Object, error) {
|
||||
pod := obj.(*example.Pod)
|
||||
pod.ObjectMeta.Labels = map[string]string{"foo": "bar"}
|
||||
pod.Labels = map[string]string{"foo": "bar"}
|
||||
return pod, nil
|
||||
}), nil); err != nil {
|
||||
t.Errorf("Unexpected failure during updated: %v", err)
|
||||
@@ -374,7 +374,7 @@ func RunTestDeleteWithSuggestionAndConflict(ctx context.Context, t *testing.T, s
|
||||
if err := store.Get(ctx, key, storage.GetOptions{}, &example.Pod{}); !storage.IsNotFound(err) {
|
||||
t.Errorf("Unexpected error on reading object: %v", err)
|
||||
}
|
||||
updatedPod.ObjectMeta.ResourceVersion = out.ObjectMeta.ResourceVersion
|
||||
updatedPod.ResourceVersion = out.ResourceVersion
|
||||
expectNoDiff(t, "incorrect pod:", updatedPod, out)
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ func RunTestDeleteWithConflict(ctx context.Context, t *testing.T, store storage.
|
||||
if err := store.GuaranteedUpdate(ctx, key, updatedPod, false, nil,
|
||||
storage.SimpleUpdate(func(obj runtime.Object) (runtime.Object, error) {
|
||||
pod := obj.(*example.Pod)
|
||||
pod.ObjectMeta.Labels = map[string]string{"foo": "bar"}
|
||||
pod.Labels = map[string]string{"foo": "bar"}
|
||||
return pod, nil
|
||||
}), nil); err != nil {
|
||||
t.Errorf("Unexpected failure during updated: %v", err)
|
||||
@@ -419,7 +419,7 @@ func RunTestDeleteWithConflict(ctx context.Context, t *testing.T, store storage.
|
||||
if err := store.Get(ctx, key, storage.GetOptions{}, &example.Pod{}); !storage.IsNotFound(err) {
|
||||
t.Errorf("Unexpected error on reading object: %v", err)
|
||||
}
|
||||
updatedPod.ObjectMeta.ResourceVersion = out.ObjectMeta.ResourceVersion
|
||||
updatedPod.ResourceVersion = out.ResourceVersion
|
||||
expectNoDiff(t, "incorrect pod:", updatedPod, out)
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ func RunTestValidateDeletionWithSuggestion(ctx context.Context, t *testing.T, st
|
||||
if err := store.GuaranteedUpdate(ctx, key, updatedPod, false, nil,
|
||||
storage.SimpleUpdate(func(obj runtime.Object) (runtime.Object, error) {
|
||||
pod := obj.(*example.Pod)
|
||||
pod.ObjectMeta.Labels = map[string]string{"foo": "bar"}
|
||||
pod.Labels = map[string]string{"foo": "bar"}
|
||||
return pod, nil
|
||||
}), nil); err != nil {
|
||||
t.Errorf("Unexpected failure during updated: %v", err)
|
||||
@@ -472,7 +472,7 @@ func RunTestValidateDeletionWithSuggestion(ctx context.Context, t *testing.T, st
|
||||
validateFresh := func(_ context.Context, obj runtime.Object) error {
|
||||
calls++
|
||||
pod := obj.(*example.Pod)
|
||||
if pod.ObjectMeta.Labels == nil || pod.ObjectMeta.Labels["foo"] != "bar" {
|
||||
if pod.Labels == nil || pod.Labels["foo"] != "bar" {
|
||||
return fmt.Errorf("stale object")
|
||||
}
|
||||
return nil
|
||||
@@ -518,7 +518,7 @@ func RunTestValidateDeletionWithOnlySuggestionValid(ctx context.Context, t *test
|
||||
if err := store.GuaranteedUpdate(ctx, key, updatedPod, false, nil,
|
||||
storage.SimpleUpdate(func(obj runtime.Object) (runtime.Object, error) {
|
||||
pod := obj.(*example.Pod)
|
||||
pod.ObjectMeta.Labels = map[string]string{"foo": "barbar"}
|
||||
pod.Labels = map[string]string{"foo": "barbar"}
|
||||
return pod, nil
|
||||
}), nil); err != nil {
|
||||
t.Errorf("Unexpected failure during updated: %v", err)
|
||||
@@ -528,7 +528,7 @@ func RunTestValidateDeletionWithOnlySuggestionValid(ctx context.Context, t *test
|
||||
validateFresh := func(_ context.Context, obj runtime.Object) error {
|
||||
calls++
|
||||
pod := obj.(*example.Pod)
|
||||
if pod.ObjectMeta.Labels == nil || pod.ObjectMeta.Labels["foo"] != "bar" {
|
||||
if pod.Labels == nil || pod.Labels["foo"] != "bar" {
|
||||
return fmt.Errorf("stale object")
|
||||
}
|
||||
return nil
|
||||
@@ -559,7 +559,7 @@ func RunTestPreconditionalDeleteWithSuggestion(ctx context.Context, t *testing.T
|
||||
if err := store.GuaranteedUpdate(ctx, key, updatedPod, false, nil,
|
||||
storage.SimpleUpdate(func(obj runtime.Object) (runtime.Object, error) {
|
||||
pod := obj.(*example.Pod)
|
||||
pod.ObjectMeta.UID = "myUID"
|
||||
pod.UID = "myUID"
|
||||
return pod, nil
|
||||
}), nil); err != nil {
|
||||
t.Errorf("Unexpected failure during updated: %v", err)
|
||||
@@ -587,7 +587,7 @@ func RunTestPreconditionalDeleteWithOnlySuggestionPass(ctx context.Context, t *t
|
||||
if err := store.GuaranteedUpdate(ctx, key, updatedPod, false, nil,
|
||||
storage.SimpleUpdate(func(obj runtime.Object) (runtime.Object, error) {
|
||||
pod := obj.(*example.Pod)
|
||||
pod.ObjectMeta.UID = "otherUID"
|
||||
pod.UID = "otherUID"
|
||||
return pod, nil
|
||||
}), nil); err != nil {
|
||||
t.Errorf("Unexpected failure during updated: %v", err)
|
||||
@@ -2083,7 +2083,7 @@ func RunTestListInconsistentContinuation(ctx context.Context, t *testing.T, stor
|
||||
if !ok {
|
||||
t.Fatalf("expect error of implements the APIStatus interface, got %v", reflect.TypeOf(err))
|
||||
}
|
||||
inconsistentContinueFromSecondItem := status.Status().ListMeta.Continue
|
||||
inconsistentContinueFromSecondItem := status.Status().Continue
|
||||
if len(inconsistentContinueFromSecondItem) == 0 {
|
||||
t.Fatalf("expect non-empty continue token")
|
||||
}
|
||||
@@ -2345,8 +2345,8 @@ func RunTestGuaranteedUpdate(ctx context.Context, t *testing.T, store InterfaceW
|
||||
if err != nil {
|
||||
t.Fatalf("%s: GuaranteedUpdate failed: %v", tt.name, err)
|
||||
}
|
||||
if !reflect.DeepEqual(out.ObjectMeta.Annotations, annotations) {
|
||||
t.Errorf("%s: pod annotations want=%s, get=%s", tt.name, annotations, out.ObjectMeta.Annotations)
|
||||
if !reflect.DeepEqual(out.Annotations, annotations) {
|
||||
t.Errorf("%s: pod annotations want=%s, get=%s", tt.name, annotations, out.Annotations)
|
||||
}
|
||||
// nolint:staticcheck
|
||||
if out.SelfLink != "" {
|
||||
|
||||
@@ -1577,8 +1577,8 @@ func namespacedScopedNodeNameAttrFunc(obj runtime.Object) (labels.Set, fields.Se
|
||||
pod := obj.(*example.Pod)
|
||||
return nil, fields.Set{
|
||||
"spec.nodeName": pod.Spec.NodeName,
|
||||
"metadata.name": pod.ObjectMeta.Name,
|
||||
"metadata.namespace": pod.ObjectMeta.Namespace,
|
||||
"metadata.name": pod.Name,
|
||||
"metadata.namespace": pod.Namespace,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -1586,7 +1586,7 @@ func clusterScopedNodeNameAttrFunc(obj runtime.Object) (labels.Set, fields.Set,
|
||||
pod := obj.(*example.Pod)
|
||||
return nil, fields.Set{
|
||||
"spec.nodeName": pod.Spec.NodeName,
|
||||
"metadata.name": pod.ObjectMeta.Name,
|
||||
"metadata.name": pod.Name,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user