Skip to content

Commit

Permalink
Bump golangci-lint to 1.56.1 (#386)
Browse files Browse the repository at this point in the history
* bump golangci-lint to v1.56.1

* fix lint error
  • Loading branch information
petersutter authored Feb 20, 2024
1 parent 9361f7f commit d9f95d0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # [email protected]
with:
version: v1.54.2
version: v1.56.1
args: --verbose --timeout 5m
1 change: 0 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ linters-settings:
revive:
rules:
- name: dot-imports
disabled: true # remove/enable once golangci-lint 1.55.3 is released where allowedPackages is supported
arguments:
- allowedPackages:
- "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion hack/golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
fi

# Install golangci-lint (linting tool)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.56.1

cd "$SOURCE_PATH"

Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ func initConfig(f *util.FactoryImpl) {
if ok {
envHomeDir, err = homedir.Expand(envHomeDir)
cobra.CheckErr(err)

configFile = envHomeDir
viper.AddConfigPath(envHomeDir)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/providerenv/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ func printProviderEnv(o *options, shoot *gardencorev1beta1.Shoot, secret *corev1
}

s := env.Shell(o.Shell)

return o.Template.ExecuteTemplate(o.IOStreams.Out, "printf", map[string]interface{}{
"format": messages.String() + "\n%s %s\n%s\n",
"arguments": []string{
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/ssh/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ func createOrPatchBastion(ctx context.Context, gardenClient client.Client, key c
if len(bastion.Annotations) == 0 {
bastion.Annotations = map[string]string{}
}

bastion.Annotations[corev1beta1constants.GardenerOperation] = corev1beta1constants.GardenerOperationKeepalive
bastion.Spec.ShootRef = corev1.LocalObjectReference{
Name: shoot.Name,
Expand Down Expand Up @@ -965,6 +966,7 @@ func waitForBastion(ctx context.Context, o *SSHOptions, gardenClient client.Clie
case cond.Status != gardencorev1beta1.ConditionTrue:
lastCheckErr = errors.New(cond.Message)
logger.Error(lastCheckErr, "Still waiting")

return false, nil
}

Expand Down
14 changes: 7 additions & 7 deletions pkg/cmd/version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
. "github.com/onsi/gomega"

"github.com/gardener/gardenctl-v2/internal/util"
. "github.com/gardener/gardenctl-v2/pkg/cmd/version"
"github.com/gardener/gardenctl-v2/pkg/cmd/version"
)

var _ = Describe("Version Command", func() {
var (
o *VersionOptions
o *version.VersionOptions
factory util.Factory
streams util.IOStreams
buf *util.SafeBytesBuffer
Expand All @@ -27,13 +27,13 @@ var _ = Describe("Version Command", func() {

BeforeEach(func() {
streams, _, buf, _ = util.NewTestIOStreams()
o = NewVersionOptions(streams)
o = version.NewVersionOptions(streams)
factory = &util.FactoryImpl{}
args = make([]string, 0, 5)
})

It("should run the command without any flags", func() {
cmd := NewCmdVersion(factory, o)
cmd := version.NewCmdVersion(factory, o)
cmd.SetArgs(args)
Expect(cmd.Execute()).To(Succeed())
Expect(o.Short).To(BeFalse())
Expand All @@ -42,7 +42,7 @@ var _ = Describe("Version Command", func() {
})

It("should run the command with flags --short", func() {
cmd := NewCmdVersion(factory, o)
cmd := version.NewCmdVersion(factory, o)
cmd.SetArgs(append(args, "--short"))
Expect(cmd.Execute()).To(Succeed())
Expect(o.Short).To(BeTrue())
Expand All @@ -51,7 +51,7 @@ var _ = Describe("Version Command", func() {
})

It("should run the command with flags --output json", func() {
cmd := NewCmdVersion(factory, o)
cmd := version.NewCmdVersion(factory, o)
cmd.SetArgs(append(args, "--output", "json"))
Expect(o.Short).To(BeFalse())
Expect(cmd.Execute()).To(Succeed())
Expand All @@ -62,7 +62,7 @@ var _ = Describe("Version Command", func() {
})

It("should run the command with flags --short --output json", func() {
cmd := NewCmdVersion(factory, o)
cmd := version.NewCmdVersion(factory, o)
cmd.SetArgs(append(args, "--short", "--output", "json"))
Expect(cmd.Execute()).To(Succeed())
Expect(o.Short).To(BeTrue())
Expand Down

0 comments on commit d9f95d0

Please sign in to comment.