Skip to content

Commit febaab8

Browse files
committed
address linter issues
1 parent 1afb2f1 commit febaab8

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

test/integration/prometheus/prometheus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func SelectMetric(metrics map[string]*io_prometheus_client.MetricFamily, name st
8686
// GetMetric is a convenience function to issue a web request to the specified url and then
8787
// select a particular metric that exactly matches the name and labels. The metric is then returned
8888
// and values can be retrieved based on what type of metric it is, for example .GetCounter().GetValue()
89-
func GetMetric(url string, name string, labels map[string]string) (*io_prometheus_client.Metric, error) {
89+
func GetMetric(url, name string, labels map[string]string) (*io_prometheus_client.Metric, error) {
9090
metrics, err := GetMetrics(url)
9191
if err != nil {
9292
return nil, err

test/integration/prometheus/prometheus_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func TestGetMetricValue(t *testing.T) {
119119
require.Error(t, err)
120120
} else {
121121
require.NoError(t, err)
122-
require.Equal(t, tt.expectedVal, val)
122+
require.InDelta(t, tt.expectedVal, val, 0.01)
123123
}
124124
})
125125
}

test/internal/kubernetes/utils.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/Azure/azure-container-networking/test/internal/retry"
1616
ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2"
1717
cilium "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned"
18-
1918
"github.com/pkg/errors"
2019
appsv1 "k8s.io/api/apps/v1"
2120
corev1 "k8s.io/api/core/v1"
@@ -203,7 +202,7 @@ func MustSetUpRBAC(ctx context.Context, clientset *kubernetes.Clientset, rolePat
203202
mustCreateRoleBinding(ctx, roleBindings, roleBinding)
204203
}
205204

206-
func MustSetupConfigMap(ctx context.Context, clientset *kubernetes.Clientset, configMapPath string) (corev1.ConfigMap, func()) {
205+
func MustSetupConfigMap(ctx context.Context, clientset *kubernetes.Clientset, configMapPath string) (corev1.ConfigMap, func()) { // nolint
207206
cm := mustParseConfigMap(configMapPath)
208207
configmaps := clientset.CoreV1().ConfigMaps(cm.Namespace)
209208
mustCreateConfigMap(ctx, configmaps, cm)
@@ -214,7 +213,7 @@ func MustSetupConfigMap(ctx context.Context, clientset *kubernetes.Clientset, co
214213

215214
// MustSetupDaemonset is a convenience function to directly apply the daemonset at dsPath to the cluster,
216215
// returning the parsed daemonset struct and a cleanup function in the process
217-
func MustSetupDaemonset(ctx context.Context, clientset *kubernetes.Clientset, dsPath string) (appsv1.DaemonSet, func()) {
216+
func MustSetupDaemonset(ctx context.Context, clientset *kubernetes.Clientset, dsPath string) (appsv1.DaemonSet, func()) { // nolint
218217
ds := MustParseDaemonSet(dsPath)
219218
dsClient := clientset.AppsV1().DaemonSets(ds.Namespace)
220219
MustCreateDaemonset(ctx, dsClient, ds)
@@ -223,7 +222,7 @@ func MustSetupDaemonset(ctx context.Context, clientset *kubernetes.Clientset, ds
223222
}
224223
}
225224

226-
func MustSetupDeployment(ctx context.Context, clientset *kubernetes.Clientset, depPath string) (appsv1.Deployment, func()) {
225+
func MustSetupDeployment(ctx context.Context, clientset *kubernetes.Clientset, depPath string) (appsv1.Deployment, func()) { // nolint
227226
dep := MustParseDeployment(depPath)
228227
depClient := clientset.AppsV1().Deployments(dep.Namespace)
229228
MustCreateDeployment(ctx, depClient, dep)
@@ -232,7 +231,7 @@ func MustSetupDeployment(ctx context.Context, clientset *kubernetes.Clientset, d
232231
}
233232
}
234233

235-
func MustSetupServiceAccount(ctx context.Context, clientset *kubernetes.Clientset, serviceAccountPath string) (corev1.ServiceAccount, func()) {
234+
func MustSetupServiceAccount(ctx context.Context, clientset *kubernetes.Clientset, serviceAccountPath string) (corev1.ServiceAccount, func()) { // nolint
236235
sa := mustParseServiceAccount(serviceAccountPath)
237236
sas := clientset.CoreV1().ServiceAccounts(sa.Namespace)
238237
mustCreateServiceAccount(ctx, sas, sa)
@@ -241,7 +240,7 @@ func MustSetupServiceAccount(ctx context.Context, clientset *kubernetes.Clientse
241240
}
242241
}
243242

244-
func MustSetupService(ctx context.Context, clientset *kubernetes.Clientset, servicePath string) (corev1.Service, func()) {
243+
func MustSetupService(ctx context.Context, clientset *kubernetes.Clientset, servicePath string) (corev1.Service, func()) { // nolint
245244
svc := mustParseService(servicePath)
246245
svcs := clientset.CoreV1().Services(svc.Namespace)
247246
mustCreateService(ctx, svcs, svc)
@@ -250,7 +249,7 @@ func MustSetupService(ctx context.Context, clientset *kubernetes.Clientset, serv
250249
}
251250
}
252251

253-
func MustSetupLRP(ctx context.Context, clientset *cilium.Clientset, lrpPath string) (ciliumv2.CiliumLocalRedirectPolicy, func()) {
252+
func MustSetupLRP(ctx context.Context, clientset *cilium.Clientset, lrpPath string) (ciliumv2.CiliumLocalRedirectPolicy, func()) { // nolint
254253
lrp := mustParseLRP(lrpPath)
255254
lrps := clientset.CiliumV2().CiliumLocalRedirectPolicies(lrp.Namespace)
256255
mustCreateCiliumLocalRedirectPolicy(ctx, lrps, lrp)

test/internal/kubernetes/utils_create.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111

1212
ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2"
1313
typedciliumv2 "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2"
14-
1514
"github.com/pkg/errors"
1615
appsv1 "k8s.io/api/apps/v1"
1716
corev1 "k8s.io/api/core/v1"

0 commit comments

Comments
 (0)