Skip to content

Commit 5922818

Browse files
committed
Fix remaining golangci-lint issues
1 parent eeb0a23 commit 5922818

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

internal/cmd/agent/deployer/internal/diff/diff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ func normalizeEndpoint(un *unstructured.Unstructured, o options) {
488488
if gvk.Group != "" || gvk.Kind != "Endpoints" {
489489
return
490490
}
491-
//nolint: staticcheck // Endpoints is deprecated but still supported; see fleet#3760.
491+
//nolint:staticcheck // Endpoints is deprecated but still supported; see fleet#3760.
492492
var ep corev1.Endpoints
493493
err := runtime.DefaultUnstructuredConverter.FromUnstructured(un.Object, &ep)
494494
if err != nil {

internal/cmd/agent/deployer/internal/diff/kubernetes_vendor/pkg/api/v1/endpoints/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func hashObject(hasher hash.Hash, obj interface{}) []byte {
6363
return hasher.Sum(nil)
6464
}
6565

66-
//nolint:staticcheck // EndpointSubset is deprecated but still supported; see fleet#3760.
66+
//nolint:staticcheck,nolintlint // EndpointSubset is deprecated but still supported; see fleet#3760.
6767
type subsetsByHash []v1.EndpointSubset
6868

6969
func (sl subsetsByHash) Len() int { return len(sl) }

internal/cmd/controller/agentmanagement/agent/manifest_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ func TestManifestAgentTolerations(t *testing.T) {
112112
t.Fatal("there were no deployments returned from the manifests")
113113
}
114114

115+
//nolint:SA5011 // agent is checked for nil above; t.Fatal prevents execution if nil
115116
if !cmp.Equal(agent.Spec.Template.Spec.Tolerations, testCase.expectedTolerations, cmpOpt) {
116117
t.Fatalf("tolerations were not as expected: %v", agent.Spec.Template.Spec.Tolerations)
117118
}
@@ -160,6 +161,7 @@ func TestManifestAgentHostNetwork(t *testing.T) {
160161
t.Fatal("there were no deployments returned from the manifests")
161162
}
162163

164+
//nolint:SA5011 // agent is checked for nil above; t.Fatal prevents execution if nil
163165
if !cmp.Equal(agent.Spec.Template.Spec.HostNetwork, testCase.expectedNetwork) {
164166
t.Fatalf("hostNetwork is not as expected: %v", agent.Spec.Template.Spec.HostNetwork)
165167
}
@@ -232,6 +234,7 @@ func TestManifestAgentAffinity(t *testing.T) {
232234
t.Fatal("there were no deployments returned from the manifests")
233235
}
234236

237+
//nolint:SA5011 // agent is checked for nil above; t.Fatal prevents execution if nil
235238
if !cmp.Equal(agent.Spec.Template.Spec.Affinity, testCase.expectedAffinity) {
236239
t.Fatalf("affinity was not as expected: %v %v", testCase.expectedAffinity, agent.Spec.Template.Spec.Affinity)
237240
}

0 commit comments

Comments
 (0)