Skip to content

Commit

Permalink
Merge pull request #480 from cpanato/fix
Browse files Browse the repository at this point in the history
update golangci-lint
  • Loading branch information
cpanato authored Jan 15, 2025
2 parents 9b56d1d + 0a7c5a4 commit fc5ec37
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: '1.22'
go-version: '1.23'
check-latest: true

- name: Run GoReleaser
Expand Down
2 changes: 1 addition & 1 deletion hack/verify-golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail

VERSION=v1.58.0
VERSION=v1.63.4
URL_BASE=https://raw.githubusercontent.com/golangci/golangci-lint
URL=$URL_BASE/$VERSION/install.sh

Expand Down
12 changes: 6 additions & 6 deletions klient/wait/conditions/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (c *Condition) JobConditionMatch(job k8s.Object, conditionType batchv1.JobC
if err := c.resources.Get(ctx, job.GetName(), job.GetNamespace(), job); err != nil {
return false, err
}
status := job.(*batchv1.Job).Status
status := job.(*batchv1.Job).Status // nolint: errcheck
log.V(4).InfoS("Current Status of the job resource", "status", status)
for _, cond := range status.Conditions {
if cond.Type == conditionType && cond.Status == conditionState {
Expand All @@ -225,7 +225,7 @@ func (c *Condition) DeploymentConditionMatch(deployment k8s.Object, conditionTyp
if err := c.resources.Get(ctx, deployment.GetName(), deployment.GetNamespace(), deployment); err != nil {
return false, err
}
for _, cond := range deployment.(*appsv1.Deployment).Status.Conditions {
for _, cond := range deployment.(*appsv1.Deployment).Status.Conditions { // nolint: errcheck
if cond.Type == conditionType && cond.Status == conditionState {
done = true
}
Expand All @@ -242,7 +242,7 @@ func (c *Condition) PodConditionMatch(pod k8s.Object, conditionType v1.PodCondit
if err := c.resources.Get(ctx, pod.GetName(), pod.GetNamespace(), pod); err != nil {
return false, err
}
status := pod.(*v1.Pod).Status
status := pod.(*v1.Pod).Status // nolint: errcheck
log.V(4).InfoS("Current Status of the pod resource", "status", status)
for _, cond := range status.Conditions {
if cond.Type == conditionType && cond.Status == conditionState {
Expand All @@ -262,8 +262,8 @@ func (c *Condition) PodPhaseMatch(pod k8s.Object, phase v1.PodPhase) apimachiner
if err := c.resources.Get(context.Background(), pod.GetName(), pod.GetNamespace(), pod); err != nil {
return false, err
}
log.V(4).InfoS("Current phase", "phase", pod.(*v1.Pod).Status.Phase)
return pod.(*v1.Pod).Status.Phase == phase, nil
log.V(4).InfoS("Current phase", "phase", pod.(*v1.Pod).Status.Phase) // nolint: errcheck
return pod.(*v1.Pod).Status.Phase == phase, nil // nolint: errcheck
}
}

Expand Down Expand Up @@ -310,7 +310,7 @@ func (c *Condition) DaemonSetReady(daemonset k8s.Object) apimachinerywait.Condit
if err := c.resources.Get(ctx, daemonset.GetName(), daemonset.GetNamespace(), daemonset); err != nil {
return false, err
}
status := daemonset.(*appsv1.DaemonSet).Status
status := daemonset.(*appsv1.DaemonSet).Status // nolint: errcheck
if status.NumberReady == status.DesiredNumberScheduled && status.NumberUnavailable == 0 {
done = true
}
Expand Down
6 changes: 3 additions & 3 deletions klient/wait/wait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestResourceScaled(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
err = wait.For(conditions.New(getResourceManager()).ResourceScaled(deployment, func(object k8s.Object) int32 {
return object.(*appsv1.Deployment).Status.ReadyReplicas
return object.(*appsv1.Deployment).Status.ReadyReplicas // nolint: errcheck
}, 2), wait.WithContext(ctx))
if err != nil {
t.Error("failed waiting for resource to be scaled", err)
Expand Down Expand Up @@ -147,7 +147,7 @@ func TestResourceListMatchN(t *testing.T) {
createDeployment("d4", 5, t)
pods := &v1.PodList{}
err = wait.For(conditions.New(getResourceManager()).ResourceListMatchN(pods, 5, func(object k8s.Object) bool {
for _, c := range object.(*v1.Pod).Spec.Containers {
for _, c := range object.(*v1.Pod).Spec.Containers { // nolint: errcheck
if c.Image == "nginx" {
return true
}
Expand Down Expand Up @@ -175,7 +175,7 @@ func TestResourcesMatch(t *testing.T) {
},
}
err = wait.For(conditions.New(getResourceManager()).ResourcesMatch(pods, func(object k8s.Object) bool {
return object.(*v1.Pod).Status.Phase == v1.PodRunning
return object.(*v1.Pod).Status.Phase == v1.PodRunning // nolint: errcheck
}))
if err != nil {
t.Error("failed waiting for deployment pods to start running", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/env/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestAction_Run(t *testing.T) {
setup: func(ctx context.Context, cfg *envconf.Config) (val int, err error) {
funcs := []types.EnvFunc{
func(ctx context.Context, cfg *envconf.Config) (context.Context, error) {
i := ctx.Value(&ctxTestKeyString{}).(int) + 2
i := ctx.Value(&ctxTestKeyString{}).(int) + 2 // nolint: errcheck
val = i
return ctx, nil
},
Expand Down
10 changes: 5 additions & 5 deletions pkg/env/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func TestEnv_Test(t *testing.T) {
})

out := env.Test(t, f.Feature())
return out.Value(&ctxTestKeyString{}).([]string)
return out.Value(&ctxTestKeyString{}).([]string) // nolint: errcheck
},
},
{
Expand Down Expand Up @@ -392,7 +392,7 @@ func TestEnv_Test(t *testing.T) {
}).Feature()

out := env.Test(t, f1, f2)
return out.Value(&ctxTestKeyString{}).([]string)
return out.Value(&ctxTestKeyString{}).([]string) // nolint: errcheck
},
},
{
Expand Down Expand Up @@ -442,7 +442,7 @@ func TestEnv_Test(t *testing.T) {
}).Feature()

out := env.TestInParallel(t, f1, f2)
return out.Value(&ctxTestKeyString{}).([]string)
return out.Value(&ctxTestKeyString{}).([]string) // nolint: errcheck
},
},
{
Expand Down Expand Up @@ -928,15 +928,15 @@ func getFeaturesForTest() []features.Feature {
Assess("log a message", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
t.Log("Running in parallel 1 1")
if i := ctx.Value(ctxRunsKeyString{}); i != nil {
return context.WithValue(ctx, ctxRunsKeyString{}, i.(int)+1)
return context.WithValue(ctx, ctxRunsKeyString{}, i.(int)+1) // nolint: errcheck
}
return context.WithValue(ctx, ctxRunsKeyString{}, 1)
}).Feature()
f2 := features.New("parallel one").
Assess("log a message", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
t.Log("Running in parallel 1 2")
if i := ctx.Value(ctxRunsKeyString{}); i != nil {
return context.WithValue(ctx, ctxRunsKeyString{}, i.(int)+1)
return context.WithValue(ctx, ctxRunsKeyString{}, i.(int)+1) // nolint: errcheck
}
return context.WithValue(ctx, ctxRunsKeyString{}, 1)
}).Feature()
Expand Down
2 changes: 1 addition & 1 deletion pkg/envfuncs/kind_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
func GetKindClusterFromContext(ctx context.Context, clusterName string) (*kind.Cluster, bool) {
provider, ok := GetClusterFromContext(ctx, clusterName)
if ok {
return provider.(*kind.Cluster), ok
return provider.(*kind.Cluster), ok // nolint: errcheck
}
return nil, ok
}
Expand Down

0 comments on commit fc5ec37

Please sign in to comment.