Skip to content

Commit 72b23f2

Browse files
committed
chore: fix linter complaints
1 parent ce1b5d5 commit 72b23f2

File tree

10 files changed

+27
-24
lines changed

10 files changed

+27
-24
lines changed

internal/ci/workflows/main.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
// Package main is a tool to trigger Github actions workflows
22
//
3-
//
4-
// Examples
3+
// # Examples
4+
// # Examples
55
//
66
// Trigger an integration test workflow for a custom branch:
77
//
8-
// $ go run internal/ci/release/main.go tests.yaml batman
9-
// SUCCESS: the test.yaml workflow has been triggered for batman
8+
// $ go run internal/ci/release/main.go tests.yaml batman
9+
// SUCCESS: the test.yaml workflow has been triggered for batman
1010
//
1111
// Trigger a release testing workflow:
1212
//
13-
// $ go run internal/ci/release/main.go release-testing.yaml <ref> <tag>
14-
// SUCCESS: the release-testing.yaml workflow has been triggered for <ref>
13+
// $ go run internal/ci/release/main.go release-testing.yaml <ref> <tag>
14+
// SUCCESS: the release-testing.yaml workflow has been triggered for <ref>
1515
//
1616
// Tag in this case is the tag that you want the release-testing.yaml workflow
1717
// to create and push to the remote upon success (e.g. `v0.8.3`).
1818
//
1919
// Trigger a release workflow:
2020
//
21-
// $ go run internal/ci/release/main.go release.yaml <ref>
22-
// SUCCESS: the release.yaml workflow has been triggered for <ref>
23-
//
21+
// $ go run internal/ci/release/main.go release.yaml <ref>
22+
// SUCCESS: the release.yaml workflow has been triggered for <ref>
2423
package main
2524

2625
import (

internal/utils/cluster_init.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import (
55
"fmt"
66
"time"
77

8-
"github.com/kong/kubernetes-testing-framework/pkg/clusters"
98
corev1 "k8s.io/api/core/v1"
109
rbacv1 "k8s.io/api/rbac/v1"
1110
"k8s.io/apimachinery/pkg/api/errors"
1211
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12+
13+
"github.com/kong/kubernetes-testing-framework/pkg/clusters"
1314
)
1415

1516
const (

pkg/clusters/addons/httpbin/addon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
"context"
55
"fmt"
66

7+
"github.com/google/uuid"
78
corev1 "k8s.io/api/core/v1"
89
"k8s.io/apimachinery/pkg/api/errors"
910
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1011
"k8s.io/apimachinery/pkg/runtime"
1112

12-
"github.com/google/uuid"
1313
"github.com/kong/kubernetes-testing-framework/internal/utils"
1414
"github.com/kong/kubernetes-testing-framework/pkg/clusters"
1515
"github.com/kong/kubernetes-testing-framework/pkg/utils/kubernetes/generators"

pkg/clusters/addons/kong/addon.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func (a *Addon) Name() clusters.AddonName {
148148
return AddonName
149149
}
150150

151-
func (a *Addon) Dependencies(ctx context.Context, cluster clusters.Cluster) []clusters.AddonName {
151+
func (a *Addon) Dependencies(_ context.Context, cluster clusters.Cluster) []clusters.AddonName {
152152
if _, ok := cluster.(*kind.Cluster); ok {
153153
if a.proxyAdminServiceTypeLoadBalancer {
154154
return []clusters.AddonName{
@@ -291,7 +291,7 @@ func (a *Addon) Deploy(ctx context.Context, cluster clusters.Cluster) error {
291291
return runUDPServiceHack(ctx, cluster, DefaultNamespace)
292292
}
293293

294-
func (a *Addon) Delete(ctx context.Context, cluster clusters.Cluster) error {
294+
func (a *Addon) Delete(_ context.Context, cluster clusters.Cluster) error {
295295
// generate a temporary kubeconfig since we're going to be using the helm CLI
296296
kubeconfig, err := clusters.TempKubeconfig(cluster)
297297
if err != nil {
@@ -394,7 +394,8 @@ func exposePortsDefault() []string {
394394
}
395395

396396
// TODO: this is a hack in place to workaround problems in the Kong helm chart when UDP ports are in use:
397-
// See: https://github.com/Kong/charts/issues/329
397+
//
398+
// See: https://github.com/Kong/charts/issues/329
398399
func runUDPServiceHack(ctx context.Context, cluster clusters.Cluster, namespace string) error {
399400
udpServicePorts := []corev1.ServicePort{{
400401
Name: DefaultUDPServiceName,

pkg/clusters/addons/kuma/addon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (a *Addon) Deploy(ctx context.Context, cluster clusters.Cluster) error {
167167
return nil
168168
}
169169

170-
func (a *Addon) Delete(ctx context.Context, cluster clusters.Cluster) error {
170+
func (a *Addon) Delete(_ context.Context, cluster clusters.Cluster) error {
171171
// generate a temporary kubeconfig since we're going to be using the helm CLI
172172
kubeconfig, err := clusters.TempKubeconfig(cluster)
173173
if err != nil {

pkg/clusters/addons/loadimage/addon.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (a *Addon) Dependencies(_ context.Context, _ clusters.Cluster) []clusters.A
4040
return nil
4141
}
4242

43-
func (a *Addon) Deploy(ctx context.Context, cluster clusters.Cluster) error {
43+
func (a *Addon) Deploy(_ context.Context, cluster clusters.Cluster) error {
4444
switch ctype := cluster.Type(); ctype {
4545
case kind.KindClusterType:
4646
if err := a.loadIntoKind(cluster); err != nil {
@@ -53,7 +53,7 @@ func (a *Addon) Deploy(ctx context.Context, cluster clusters.Cluster) error {
5353
return nil
5454
}
5555

56-
func (a *Addon) Delete(ctx context.Context, cluster clusters.Cluster) error {
56+
func (a *Addon) Delete(_ context.Context, cluster clusters.Cluster) error {
5757
switch ctype := cluster.Type(); ctype {
5858
case kind.KindClusterType:
5959
// per https://github.com/kubernetes-sigs/kind/issues/658 this is basically impossible
@@ -66,7 +66,7 @@ func (a *Addon) Delete(ctx context.Context, cluster clusters.Cluster) error {
6666
}
6767
}
6868

69-
func (a *Addon) Ready(ctx context.Context, cluster clusters.Cluster) ([]runtime.Object, bool, error) {
69+
func (a *Addon) Ready(_ context.Context, _ clusters.Cluster) ([]runtime.Object, bool, error) {
7070
// no way to verify this, we rely on Deploy's cmd.Run() not failing
7171
return nil, a.loaded, nil
7272
}

pkg/clusters/types/kind/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
"strings"
88
"sync"
99

10+
"github.com/blang/semver/v4"
1011
"k8s.io/client-go/kubernetes"
1112
"k8s.io/client-go/rest"
1213

13-
"github.com/blang/semver/v4"
1414
"github.com/kong/kubernetes-testing-framework/pkg/clusters"
1515
)
1616

pkg/clusters/utils.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ import (
1111
"strings"
1212

1313
"github.com/google/uuid"
14-
"github.com/kong/kubernetes-testing-framework/pkg/utils/kubernetes/generators"
1514
corev1 "k8s.io/api/core/v1"
1615
extv1beta1 "k8s.io/api/extensions/v1beta1"
1716
netv1 "k8s.io/api/networking/v1"
1817
netv1beta1 "k8s.io/api/networking/v1beta1"
1918
"k8s.io/apimachinery/pkg/api/errors"
2019
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2120
"k8s.io/apimachinery/pkg/runtime"
21+
22+
"github.com/kong/kubernetes-testing-framework/pkg/utils/kubernetes/generators"
2223
)
2324

2425
// -----------------------------------------------------------------------------
@@ -101,7 +102,7 @@ func GetIngressLoadbalancerStatus(ctx context.Context, c Cluster, namespace stri
101102
}
102103

103104
// CreateNamespace creates a new namespace in the given cluster provided a name.
104-
func CreateNamespace(ctx context.Context, cluster Cluster, namespace string) error {
105+
func CreateNamespace(_ context.Context, cluster Cluster, namespace string) error {
105106
nsName := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: namespace}}
106107
_, err := cluster.Client().CoreV1().Namespaces().Create(context.Background(), nsName, metav1.CreateOptions{})
107108
if err != nil {

pkg/utils/github/release.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ const releaseURLFormatter = "https://api.github.com/repos/%s/%s/releases/latest"
1515
// repository given an Organization and Repository name.
1616
//
1717
// NOTE: latest release in this context does not necessarily mean the newest
18-
// version: if a repo releases a patch for an older release for instance
19-
// the the returned version could be that instead.
18+
//
19+
// version: if a repo releases a patch for an older release for instance
20+
// the the returned version could be that instead.
2021
func FindLatestReleaseForRepo(org, repo string) (*semver.Version, error) {
2122
rawTag, err := FindRawLatestReleaseForRepo(org, repo)
2223
if err != nil {

pkg/utils/kong/fake_admin_api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"net/http"
77
"testing"
88

9+
"github.com/kong/go-kong/kong"
910
"github.com/stretchr/testify/assert"
1011

11-
"github.com/kong/go-kong/kong"
1212
kongt "github.com/kong/kubernetes-testing-framework/pkg/utils/kong"
1313
)
1414

0 commit comments

Comments
 (0)