Skip to content

Commit

Permalink
build: Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mrueg committed Aug 25, 2023
1 parent 2181414 commit 6071db7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion internal/store/cronjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
)

var (
descCronJobAnnotationsName = "kube_cronjob_annotations"
descCronJobAnnotationsName = "kube_cronjob_annotations" //nolint:gosec
descCronJobAnnotationsHelp = "Kubernetes annotations converted to Prometheus labels."
descCronJobLabelsName = "kube_cronjob_labels"
descCronJobLabelsHelp = "Kubernetes labels converted to Prometheus labels."
Expand Down
2 changes: 1 addition & 1 deletion internal/store/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
)

var (
descIngressAnnotationsName = "kube_ingress_annotations"
descIngressAnnotationsName = "kube_ingress_annotations" //nolint:gosec
descIngressAnnotationsHelp = "Kubernetes annotations converted to Prometheus labels."
descIngressLabelsName = "kube_ingress_labels"
descIngressLabelsHelp = "Kubernetes labels converted to Prometheus labels."
Expand Down
2 changes: 1 addition & 1 deletion internal/store/ingressclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
var (
descIngressClassAnnotationsName = "kube_ingressclass_annotations"
descIngressClassAnnotationsHelp = "Kubernetes annotations converted to Prometheus labels."
descIngressClassLabelsName = "kube_ingressclass_labels"
descIngressClassLabelsName = "kube_ingressclass_labels" //nolint:gosec
descIngressClassLabelsHelp = "Kubernetes labels converted to Prometheus labels."
descIngressClassLabelsDefaultLabels = []string{"ingressclass"}
)
Expand Down
4 changes: 2 additions & 2 deletions internal/store/persistentvolume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

generator "k8s.io/kube-state-metrics/v2/pkg/metric_generator"
)
Expand Down Expand Up @@ -415,7 +415,7 @@ func TestPersistentVolumeStore(t *testing.T) {
Spec: v1.PersistentVolumeSpec{
PersistentVolumeSource: v1.PersistentVolumeSource{
Local: &v1.LocalVolumeSource{
FSType: pointer.String("ext4"),
FSType: ptr.To("ext4"),
Path: "/mnt/data",
},
},
Expand Down
4 changes: 2 additions & 2 deletions internal/store/serviceaccount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

generator "k8s.io/kube-state-metrics/v2/pkg/metric_generator"
)
Expand All @@ -38,7 +38,7 @@ func TestServiceAccountStore(t *testing.T) {
Namespace: "serviceAccountNS",
UID: "serviceAccountUID",
},
AutomountServiceAccountToken: pointer.Bool(true),
AutomountServiceAccountToken: ptr.To(true),
Secrets: []v1.ObjectReference{
{
APIVersion: "v1",
Expand Down
6 changes: 3 additions & 3 deletions pkg/customresourcestate/custom_resource_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"testing"

"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
)

func TestNewCustomResourceMetrics(t *testing.T) {
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestNewCustomResourceMetrics(t *testing.T) {
},
},
},
MetricNamePrefix: pointer.String("apps_deployment"),
MetricNamePrefix: ptr.To("apps_deployment"),
},
wantErr: false,
wantResult: &customResourceMetrics{
Expand Down Expand Up @@ -193,7 +193,7 @@ func TestNewCustomResourceMetrics(t *testing.T) {
},
},
},
MetricNamePrefix: pointer.String("apps_deployment"),
MetricNamePrefix: ptr.To("apps_deployment"),
},
wantErr: true,
wantResult: &customResourceMetrics{
Expand Down
6 changes: 3 additions & 3 deletions pkg/customresourcestate/registry_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

"k8s.io/kube-state-metrics/v2/pkg/metric"
)
Expand Down Expand Up @@ -454,15 +454,15 @@ func Test_fullName(t *testing.T) {
{
name: "no prefix",
args: args{
resource: r(pointer.String("")),
resource: r(ptr.To("")),
f: count,
},
want: "count",
},
{
name: "custom",
args: args{
resource: r(pointer.String("bar_baz")),
resource: r(ptr.To("bar_baz")),
f: count,
},
want: "bar_baz_count",
Expand Down
4 changes: 2 additions & 2 deletions pkg/options/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func TestNamespaceList_GetNamespaces(t *testing.T) {
},
}

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

0 comments on commit 6071db7

Please sign in to comment.