Skip to content

Commit dd60420

Browse files
Merge pull request #1328 from hongkailiu/openshift-goimports
NO-JIRA: Sort and verify imports
2 parents c38734f + 0d49844 commit dd60420

69 files changed

Lines changed: 123 additions & 30 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,20 @@ format:
3434
go fmt ./...
3535
.PHONY: format
3636

37+
imports:
38+
which goimports || go install -mod=mod golang.org/x/tools/cmd/goimports@latest
39+
go list ./... | sed "s|^github.com/openshift/cluster-version-operator/||" | xargs goimports -w -local "k8s.io,github.com/openshift"
40+
go list ./... | sed "s|^github.com/openshift/cluster-version-operator/||" | xargs goimports -w -local "github.com/openshift/cluster-version-operator"
41+
.PHONY: imports
42+
3743
verify: verify-yaml verify-update
3844
.PHONY: verify
3945

4046
verify-yaml:
4147
hack/verify-yaml.sh
4248
.PHONY: verify-yaml
4349

44-
verify-update: update
50+
verify-update: imports update
4551
git diff --exit-code HEAD
4652
.PHONY: verify-update
4753

cmd/cluster-version-operator/image.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
"github.com/spf13/cobra"
7+
78
"k8s.io/klog/v2"
89

910
"github.com/openshift/cluster-version-operator/pkg/payload"

cmd/cluster-version-operator/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"flag"
55

66
"github.com/spf13/cobra"
7+
78
"k8s.io/klog/v2"
89
)
910

cmd/cluster-version-operator/render.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"os"
66

77
"github.com/spf13/cobra"
8+
89
"k8s.io/klog/v2"
910

1011
"github.com/openshift/cluster-version-operator/pkg/payload"

cmd/cluster-version-operator/start.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55

66
"github.com/spf13/cobra"
7+
78
"k8s.io/klog/v2"
89

910
"github.com/openshift/cluster-version-operator/pkg/start"

cmd/cluster-version-operator/version.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/openshift/cluster-version-operator/pkg/version"
76
"github.com/spf13/cobra"
7+
8+
"github.com/openshift/cluster-version-operator/pkg/version"
89
)
910

1011
var (

hack/cluster-version-util/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"flag"
55

66
"github.com/spf13/cobra"
7+
78
"k8s.io/klog/v2"
89
)
910

hack/cluster-version-util/task_graph.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"time"
77

88
"github.com/spf13/cobra"
9+
910
"k8s.io/apimachinery/pkg/util/sets"
1011

1112
"github.com/openshift/cluster-version-operator/pkg/payload"

lib/capability/capability_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"testing"
66

77
"github.com/google/go-cmp/cmp"
8+
89
"k8s.io/apimachinery/pkg/util/sets"
910

1011
configv1 "github.com/openshift/api/config/v1"

lib/resourceapply/admissionregistration.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import (
44
"context"
55

66
"github.com/google/go-cmp/cmp"
7-
"github.com/openshift/cluster-version-operator/lib/resourcemerge"
7+
88
admissionregv1 "k8s.io/api/admissionregistration/v1"
99
apierrors "k8s.io/apimachinery/pkg/api/errors"
1010
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1111
admissionregclientv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1"
1212
"k8s.io/klog/v2"
1313
"k8s.io/utils/ptr"
14+
15+
"github.com/openshift/cluster-version-operator/lib/resourcemerge"
1416
)
1517

1618
func ApplyValidatingWebhookConfigurationv1(ctx context.Context, client admissionregclientv1.ValidatingWebhookConfigurationsGetter, required *admissionregv1.ValidatingWebhookConfiguration, reconciling bool) (*admissionregv1.ValidatingWebhookConfiguration, bool, error) {

0 commit comments

Comments
 (0)