Skip to content

Commit 6071db7

Browse files
committed
build: Fix lint
1 parent 2181414 commit 6071db7

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

internal/store/cronjob.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
)
3737

3838
var (
39-
descCronJobAnnotationsName = "kube_cronjob_annotations"
39+
descCronJobAnnotationsName = "kube_cronjob_annotations" //nolint:gosec
4040
descCronJobAnnotationsHelp = "Kubernetes annotations converted to Prometheus labels."
4141
descCronJobLabelsName = "kube_cronjob_labels"
4242
descCronJobLabelsHelp = "Kubernetes labels converted to Prometheus labels."

internal/store/ingress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
)
3535

3636
var (
37-
descIngressAnnotationsName = "kube_ingress_annotations"
37+
descIngressAnnotationsName = "kube_ingress_annotations" //nolint:gosec
3838
descIngressAnnotationsHelp = "Kubernetes annotations converted to Prometheus labels."
3939
descIngressLabelsName = "kube_ingress_labels"
4040
descIngressLabelsHelp = "Kubernetes labels converted to Prometheus labels."

internal/store/ingressclass.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
var (
3333
descIngressClassAnnotationsName = "kube_ingressclass_annotations"
3434
descIngressClassAnnotationsHelp = "Kubernetes annotations converted to Prometheus labels."
35-
descIngressClassLabelsName = "kube_ingressclass_labels"
35+
descIngressClassLabelsName = "kube_ingressclass_labels" //nolint:gosec
3636
descIngressClassLabelsHelp = "Kubernetes labels converted to Prometheus labels."
3737
descIngressClassLabelsDefaultLabels = []string{"ingressclass"}
3838
)

internal/store/persistentvolume_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
v1 "k8s.io/api/core/v1"
2424
"k8s.io/apimachinery/pkg/api/resource"
2525
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
26-
"k8s.io/utils/pointer"
26+
"k8s.io/utils/ptr"
2727

2828
generator "k8s.io/kube-state-metrics/v2/pkg/metric_generator"
2929
)
@@ -415,7 +415,7 @@ func TestPersistentVolumeStore(t *testing.T) {
415415
Spec: v1.PersistentVolumeSpec{
416416
PersistentVolumeSource: v1.PersistentVolumeSource{
417417
Local: &v1.LocalVolumeSource{
418-
FSType: pointer.String("ext4"),
418+
FSType: ptr.To("ext4"),
419419
Path: "/mnt/data",
420420
},
421421
},

internal/store/serviceaccount_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
v1 "k8s.io/api/core/v1"
2424
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25-
"k8s.io/utils/pointer"
25+
"k8s.io/utils/ptr"
2626

2727
generator "k8s.io/kube-state-metrics/v2/pkg/metric_generator"
2828
)
@@ -38,7 +38,7 @@ func TestServiceAccountStore(t *testing.T) {
3838
Namespace: "serviceAccountNS",
3939
UID: "serviceAccountUID",
4040
},
41-
AutomountServiceAccountToken: pointer.Bool(true),
41+
AutomountServiceAccountToken: ptr.To(true),
4242
Secrets: []v1.ObjectReference{
4343
{
4444
APIVersion: "v1",

pkg/customresourcestate/custom_resource_metrics_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"testing"
2323

2424
"k8s.io/apimachinery/pkg/runtime/schema"
25-
"k8s.io/utils/pointer"
25+
"k8s.io/utils/ptr"
2626
)
2727

2828
func TestNewCustomResourceMetrics(t *testing.T) {
@@ -130,7 +130,7 @@ func TestNewCustomResourceMetrics(t *testing.T) {
130130
},
131131
},
132132
},
133-
MetricNamePrefix: pointer.String("apps_deployment"),
133+
MetricNamePrefix: ptr.To("apps_deployment"),
134134
},
135135
wantErr: false,
136136
wantResult: &customResourceMetrics{
@@ -193,7 +193,7 @@ func TestNewCustomResourceMetrics(t *testing.T) {
193193
},
194194
},
195195
},
196-
MetricNamePrefix: pointer.String("apps_deployment"),
196+
MetricNamePrefix: ptr.To("apps_deployment"),
197197
},
198198
wantErr: true,
199199
wantResult: &customResourceMetrics{

pkg/customresourcestate/registry_factory_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"testing"
2424

2525
"github.com/stretchr/testify/assert"
26-
"k8s.io/utils/pointer"
26+
"k8s.io/utils/ptr"
2727

2828
"k8s.io/kube-state-metrics/v2/pkg/metric"
2929
)
@@ -454,15 +454,15 @@ func Test_fullName(t *testing.T) {
454454
{
455455
name: "no prefix",
456456
args: args{
457-
resource: r(pointer.String("")),
457+
resource: r(ptr.To("")),
458458
f: count,
459459
},
460460
want: "count",
461461
},
462462
{
463463
name: "custom",
464464
args: args{
465-
resource: r(pointer.String("bar_baz")),
465+
resource: r(ptr.To("bar_baz")),
466466
f: count,
467467
},
468468
want: "bar_baz_count",

pkg/options/types_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ func TestNamespaceList_GetNamespaces(t *testing.T) {
109109
},
110110
}
111111

112-
for _, test := range tests {
113-
ns := &test.Namespaces
112+
for i, test := range tests {
113+
ns := &tests[i].Namespaces
114114
allowedNamespaces := ns.GetNamespaces()
115115
if !reflect.DeepEqual(allowedNamespaces, test.Wanted) {
116116
t.Errorf("Test error for Desc: %s. Want: %+v. Got: %+v.", test.Desc, test.Wanted, allowedNamespaces)

0 commit comments

Comments
 (0)