Skip to content

Commit

Permalink
chore: bump golangci-lint to v1.57.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedosin committed Apr 19, 2024
1 parent 59e1588 commit b96498b
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.55.2
version: v1.57.2
args: --timeout 15m
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ CONTROLLER_GEN_VER := v0.14.0
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)

GOLANGCI_LINT_VER := v1.55.2
GOLANGCI_LINT_VER := v1.57.2
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

Expand Down
1 change: 1 addition & 0 deletions cmd/plugin/cmd/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func TestSelectorFromProvider(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
actual, err := selectorFromProvider(tc.provider)

if tc.expectedErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down
1 change: 0 additions & 1 deletion cmd/plugin/cmd/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ func TestCheckCAPIOpearatorAvailability(t *testing.T) {

if tt.wantErr {
// To generate an error we create two deployments with the same labels.

// Deployment 1.
deployment := generateCAPIOperatorDeployment("capi-operator-controller-manager", "default")
resources = append(resources, deployment)
Expand Down
1 change: 1 addition & 0 deletions cmd/plugin/cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ func GetLatestRelease(ctx context.Context, repo repository.Repository) (string,
if versionCandidates[j].PreRelease() == "" && versionCandidates[i].PreRelease() != "" {
return false
}

if versionCandidates[i].PreRelease() == "" && versionCandidates[j].PreRelease() != "" {
return true
}
Expand Down
2 changes: 2 additions & 0 deletions internal/controller/client_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ func (k *controllerProxy) ListResources(ctx context.Context, labels map[string]s
if err != nil {
return nil, err
}

klog.V(3).InfoS("listed", "kind", resourceKind.Kind, "count", len(objList.Items))

ret = append(ret, objList.Items...)
}
}
Expand Down
1 change: 1 addition & 0 deletions internal/controller/genericprovider_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ releaseSeries:
if labels == nil {
labels = map[string]string{}
}

labels["provider-version"] = tc.newVersion
provider.SetLabels(labels)

Expand Down
6 changes: 6 additions & 0 deletions internal/controller/phases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,12 @@ metadata:
}

got, err := p.configmapRepository(context.TODO(), p.provider.GetSpec().FetchConfig.Selector, "ns1", tt.additionalManifests)

if len(tt.wantErr) > 0 {
g.Expect(err).Should(MatchError(tt.wantErr))
return
}

g.Expect(err).To(Succeed())
gotComponents, err := got.GetFile(ctx, got.DefaultVersion(), got.ComponentsPath())
g.Expect(err).To(Succeed())
Expand Down Expand Up @@ -588,6 +590,7 @@ releaseSeries:
for i := range tt.configMaps {
g.Expect(fakeclient.Create(ctx, &tt.configMaps[i])).To(Succeed())
}

if tt.defaultRepository {
var err error
p.repo, err = p.configmapRepository(ctx, &metav1.LabelSelector{
Expand All @@ -606,14 +609,17 @@ releaseSeries:
g.Expect(err).Should(MatchError(tt.wantErr))
return
}

g.Expect(err).To(Succeed())

meta := got.Metadata(tt.wantDefaultVersion)
metadataData, err := meta.Get(ctx)

if len(tt.metadataErr) > 0 {
g.Expect(err).Should(MatchError(tt.metadataErr))
return
}

g.Expect(err).To(Succeed())
g.Expect(metadataData.ReleaseSeries).To(Equal(tt.wantMetadataSeries))

Expand Down
1 change: 1 addition & 0 deletions internal/patch/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func TestApplyPatches(t *testing.T) {
if tc.expectedError {
g.Expect(err).To(HaveOccurred())
}

g.Expect(err).NotTo(HaveOccurred())

resultYaml, err := utilyaml.FromUnstructured(result)
Expand Down
1 change: 1 addition & 0 deletions internal/webhook/provider_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func TestSetDefaultProviderSpec(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
gs := NewWithT(t)

setDefaultProviderSpec(tc.providerSpec, tc.namespace)
gs.Expect(reflect.DeepEqual(tc.providerSpec, tc.expectedProviderSpec)).To(BeTrue())
})
Expand Down

0 comments on commit b96498b

Please sign in to comment.