Skip to content

Commit 0a7c5a4

Browse files
committed
fix lints
Signed-off-by: cpanato <[email protected]>
1 parent 9d99c16 commit 0a7c5a4

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

klient/wait/conditions/conditions.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func (c *Condition) JobConditionMatch(job k8s.Object, conditionType batchv1.JobC
208208
if err := c.resources.Get(ctx, job.GetName(), job.GetNamespace(), job); err != nil {
209209
return false, err
210210
}
211-
status := job.(*batchv1.Job).Status
211+
status := job.(*batchv1.Job).Status // nolint: errcheck
212212
log.V(4).InfoS("Current Status of the job resource", "status", status)
213213
for _, cond := range status.Conditions {
214214
if cond.Type == conditionType && cond.Status == conditionState {
@@ -225,7 +225,7 @@ func (c *Condition) DeploymentConditionMatch(deployment k8s.Object, conditionTyp
225225
if err := c.resources.Get(ctx, deployment.GetName(), deployment.GetNamespace(), deployment); err != nil {
226226
return false, err
227227
}
228-
for _, cond := range deployment.(*appsv1.Deployment).Status.Conditions {
228+
for _, cond := range deployment.(*appsv1.Deployment).Status.Conditions { // nolint: errcheck
229229
if cond.Type == conditionType && cond.Status == conditionState {
230230
done = true
231231
}
@@ -242,7 +242,7 @@ func (c *Condition) PodConditionMatch(pod k8s.Object, conditionType v1.PodCondit
242242
if err := c.resources.Get(ctx, pod.GetName(), pod.GetNamespace(), pod); err != nil {
243243
return false, err
244244
}
245-
status := pod.(*v1.Pod).Status
245+
status := pod.(*v1.Pod).Status // nolint: errcheck
246246
log.V(4).InfoS("Current Status of the pod resource", "status", status)
247247
for _, cond := range status.Conditions {
248248
if cond.Type == conditionType && cond.Status == conditionState {
@@ -262,8 +262,8 @@ func (c *Condition) PodPhaseMatch(pod k8s.Object, phase v1.PodPhase) apimachiner
262262
if err := c.resources.Get(context.Background(), pod.GetName(), pod.GetNamespace(), pod); err != nil {
263263
return false, err
264264
}
265-
log.V(4).InfoS("Current phase", "phase", pod.(*v1.Pod).Status.Phase)
266-
return pod.(*v1.Pod).Status.Phase == phase, nil
265+
log.V(4).InfoS("Current phase", "phase", pod.(*v1.Pod).Status.Phase) // nolint: errcheck
266+
return pod.(*v1.Pod).Status.Phase == phase, nil // nolint: errcheck
267267
}
268268
}
269269

@@ -310,7 +310,7 @@ func (c *Condition) DaemonSetReady(daemonset k8s.Object) apimachinerywait.Condit
310310
if err := c.resources.Get(ctx, daemonset.GetName(), daemonset.GetNamespace(), daemonset); err != nil {
311311
return false, err
312312
}
313-
status := daemonset.(*appsv1.DaemonSet).Status
313+
status := daemonset.(*appsv1.DaemonSet).Status // nolint: errcheck
314314
if status.NumberReady == status.DesiredNumberScheduled && status.NumberUnavailable == 0 {
315315
done = true
316316
}

klient/wait/wait_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func TestResourceScaled(t *testing.T) {
113113
ctx, cancel := context.WithCancel(context.Background())
114114
defer cancel()
115115
err = wait.For(conditions.New(getResourceManager()).ResourceScaled(deployment, func(object k8s.Object) int32 {
116-
return object.(*appsv1.Deployment).Status.ReadyReplicas
116+
return object.(*appsv1.Deployment).Status.ReadyReplicas // nolint: errcheck
117117
}, 2), wait.WithContext(ctx))
118118
if err != nil {
119119
t.Error("failed waiting for resource to be scaled", err)
@@ -147,7 +147,7 @@ func TestResourceListMatchN(t *testing.T) {
147147
createDeployment("d4", 5, t)
148148
pods := &v1.PodList{}
149149
err = wait.For(conditions.New(getResourceManager()).ResourceListMatchN(pods, 5, func(object k8s.Object) bool {
150-
for _, c := range object.(*v1.Pod).Spec.Containers {
150+
for _, c := range object.(*v1.Pod).Spec.Containers { // nolint: errcheck
151151
if c.Image == "nginx" {
152152
return true
153153
}
@@ -175,7 +175,7 @@ func TestResourcesMatch(t *testing.T) {
175175
},
176176
}
177177
err = wait.For(conditions.New(getResourceManager()).ResourcesMatch(pods, func(object k8s.Object) bool {
178-
return object.(*v1.Pod).Status.Phase == v1.PodRunning
178+
return object.(*v1.Pod).Status.Phase == v1.PodRunning // nolint: errcheck
179179
}))
180180
if err != nil {
181181
t.Error("failed waiting for deployment pods to start running", err)

pkg/env/action_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func TestAction_Run(t *testing.T) {
7676
setup: func(ctx context.Context, cfg *envconf.Config) (val int, err error) {
7777
funcs := []types.EnvFunc{
7878
func(ctx context.Context, cfg *envconf.Config) (context.Context, error) {
79-
i := ctx.Value(&ctxTestKeyString{}).(int) + 2
79+
i := ctx.Value(&ctxTestKeyString{}).(int) + 2 // nolint: errcheck
8080
val = i
8181
return ctx, nil
8282
},

pkg/env/env_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func TestEnv_Test(t *testing.T) {
317317
})
318318

319319
out := env.Test(t, f.Feature())
320-
return out.Value(&ctxTestKeyString{}).([]string)
320+
return out.Value(&ctxTestKeyString{}).([]string) // nolint: errcheck
321321
},
322322
},
323323
{
@@ -392,7 +392,7 @@ func TestEnv_Test(t *testing.T) {
392392
}).Feature()
393393

394394
out := env.Test(t, f1, f2)
395-
return out.Value(&ctxTestKeyString{}).([]string)
395+
return out.Value(&ctxTestKeyString{}).([]string) // nolint: errcheck
396396
},
397397
},
398398
{
@@ -442,7 +442,7 @@ func TestEnv_Test(t *testing.T) {
442442
}).Feature()
443443

444444
out := env.TestInParallel(t, f1, f2)
445-
return out.Value(&ctxTestKeyString{}).([]string)
445+
return out.Value(&ctxTestKeyString{}).([]string) // nolint: errcheck
446446
},
447447
},
448448
{
@@ -928,15 +928,15 @@ func getFeaturesForTest() []features.Feature {
928928
Assess("log a message", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
929929
t.Log("Running in parallel 1 1")
930930
if i := ctx.Value(ctxRunsKeyString{}); i != nil {
931-
return context.WithValue(ctx, ctxRunsKeyString{}, i.(int)+1)
931+
return context.WithValue(ctx, ctxRunsKeyString{}, i.(int)+1) // nolint: errcheck
932932
}
933933
return context.WithValue(ctx, ctxRunsKeyString{}, 1)
934934
}).Feature()
935935
f2 := features.New("parallel one").
936936
Assess("log a message", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
937937
t.Log("Running in parallel 1 2")
938938
if i := ctx.Value(ctxRunsKeyString{}); i != nil {
939-
return context.WithValue(ctx, ctxRunsKeyString{}, i.(int)+1)
939+
return context.WithValue(ctx, ctxRunsKeyString{}, i.(int)+1) // nolint: errcheck
940940
}
941941
return context.WithValue(ctx, ctxRunsKeyString{}, 1)
942942
}).Feature()

pkg/envfuncs/kind_funcs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
func GetKindClusterFromContext(ctx context.Context, clusterName string) (*kind.Cluster, bool) {
2828
provider, ok := GetClusterFromContext(ctx, clusterName)
2929
if ok {
30-
return provider.(*kind.Cluster), ok
30+
return provider.(*kind.Cluster), ok // nolint: errcheck
3131
}
3232
return nil, ok
3333
}

0 commit comments

Comments
 (0)