Skip to content

Commit

Permalink
🌱 format the go files import
Browse files Browse the repository at this point in the history
Signed-off-by: zhujian <jiazhu@redhat.com>
  • Loading branch information
zhujian7 committed Jun 8, 2023
1 parent eda9f46 commit 55bb1a7
Show file tree
Hide file tree
Showing 261 changed files with 783 additions and 577 deletions.
3 changes: 1 addition & 2 deletions cmd/placement/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ import (
goflag "flag"
"fmt"
"math/rand"
"open-cluster-management.io/ocm/pkg/cmd/hub"
"os"
"time"

"github.com/spf13/cobra"
"github.com/spf13/pflag"

utilflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/logs"

"open-cluster-management.io/ocm/pkg/cmd/hub"
"open-cluster-management.io/ocm/pkg/version"
)

Expand Down
5 changes: 2 additions & 3 deletions cmd/registration-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import (
goflag "flag"
"fmt"
"math/rand"
"open-cluster-management.io/ocm/pkg/cmd/hub"
"open-cluster-management.io/ocm/pkg/cmd/spoke"
"os"
"time"

"github.com/spf13/cobra"
"github.com/spf13/pflag"

utilflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/logs"

"open-cluster-management.io/ocm/pkg/cmd/hub"
"open-cluster-management.io/ocm/pkg/cmd/spoke"
"open-cluster-management.io/ocm/pkg/version"
)

Expand Down
5 changes: 2 additions & 3 deletions cmd/registration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import (
goflag "flag"
"fmt"
"math/rand"
"open-cluster-management.io/ocm/pkg/cmd/hub"
"open-cluster-management.io/ocm/pkg/cmd/spoke"
"os"
"time"

"github.com/spf13/cobra"
"github.com/spf13/pflag"

utilflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/logs"

"open-cluster-management.io/ocm/pkg/cmd/hub"
"open-cluster-management.io/ocm/pkg/cmd/spoke"
"open-cluster-management.io/ocm/pkg/cmd/webhook"
"open-cluster-management.io/ocm/pkg/version"
)
Expand Down
5 changes: 2 additions & 3 deletions cmd/work/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import (
goflag "flag"
"fmt"
"math/rand"
"open-cluster-management.io/ocm/pkg/cmd/hub"
"open-cluster-management.io/ocm/pkg/cmd/spoke"
"os"
"time"

"github.com/spf13/cobra"
"github.com/spf13/pflag"

utilflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/logs"

"open-cluster-management.io/ocm/pkg/cmd/hub"
"open-cluster-management.io/ocm/pkg/cmd/spoke"
"open-cluster-management.io/ocm/pkg/cmd/webhook"
"open-cluster-management.io/ocm/pkg/version"
)
Expand Down
1 change: 1 addition & 0 deletions dependencymagnet/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package dependencymagnet

import (
_ "github.com/openshift/build-machinery-go"

_ "open-cluster-management.io/api/addon/v1alpha1"
_ "open-cluster-management.io/api/cluster/v1"
_ "open-cluster-management.io/api/cluster/v1alpha1"
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/hub/operator.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package hub

import (
"github.com/spf13/cobra"

"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/spf13/cobra"

"open-cluster-management.io/ocm/pkg/operator/operators/clustermanager"
"open-cluster-management.io/ocm/pkg/version"
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/hub/placement.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package hub

import (
"github.com/spf13/cobra"

"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/spf13/cobra"

controllers "open-cluster-management.io/ocm/pkg/placement/controllers"
"open-cluster-management.io/ocm/pkg/version"
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/hub/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package hub
import (
"time"

"github.com/spf13/cobra"

"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/spf13/cobra"

"open-cluster-management.io/ocm/pkg/registration/hub"
"open-cluster-management.io/ocm/pkg/version"
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/hub/work.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package hub

import (
"github.com/spf13/cobra"

"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/spf13/cobra"

"open-cluster-management.io/ocm/pkg/version"
"open-cluster-management.io/ocm/pkg/work/hub"
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/spoke/operator.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package spoke

import (
"github.com/spf13/cobra"

"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/spf13/cobra"

"open-cluster-management.io/ocm/pkg/operator/operators/klusterlet"
"open-cluster-management.io/ocm/pkg/version"
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/spoke/registration.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package spoke

import (
"github.com/spf13/cobra"

"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/spf13/cobra"

"open-cluster-management.io/ocm/pkg/registration/spoke"
"open-cluster-management.io/ocm/pkg/version"
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/spoke/work.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package spoke

import (
"github.com/spf13/cobra"

"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/spf13/cobra"

"open-cluster-management.io/ocm/pkg/version"
"open-cluster-management.io/ocm/pkg/work/spoke"
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/webhook/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package webhook

import (
"github.com/spf13/cobra"

"open-cluster-management.io/ocm/pkg/features"
"open-cluster-management.io/ocm/pkg/registration/webhook"
)
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/webhook/work.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package webhook

import (
"github.com/spf13/cobra"

"open-cluster-management.io/ocm/pkg/features"
_ "open-cluster-management.io/ocm/pkg/features"
"open-cluster-management.io/ocm/pkg/work/webhook"
Expand Down
3 changes: 2 additions & 1 deletion pkg/common/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package options

import (
"fmt"
"strings"

"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/spf13/pflag"
apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"strings"
)

// AgentOptions is the common agent options
Expand Down
5 changes: 3 additions & 2 deletions pkg/common/testing/assertion.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package testing

import (
"strings"
"testing"

"github.com/davecgh/go-spew/spew"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
clienttesting "k8s.io/client-go/testing"
"strings"
"testing"
)

// AssertError asserts the actual error representation is the same with the expected,
Expand Down
3 changes: 2 additions & 1 deletion pkg/common/testing/fake_sync_context.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package testing

import (
"testing"

"github.com/openshift/library-go/pkg/operator/events"
"github.com/openshift/library-go/pkg/operator/events/eventstesting"
"k8s.io/client-go/util/workqueue"
"testing"
)

type FakeSyncContext struct {
Expand Down
1 change: 1 addition & 0 deletions pkg/features/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package features
import (
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/component-base/featuregate"

ocmfeature "open-cluster-management.io/api/feature"
)

Expand Down
7 changes: 3 additions & 4 deletions pkg/operator/certrotation/cabundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ import (
"fmt"
"reflect"

"github.com/openshift/library-go/pkg/crypto"
"github.com/openshift/library-go/pkg/operator/events"
"github.com/openshift/library-go/pkg/operator/resource/resourceapply"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
corev1listers "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/util/cert"

"github.com/openshift/library-go/pkg/crypto"
"github.com/openshift/library-go/pkg/operator/events"
"github.com/openshift/library-go/pkg/operator/resource/resourceapply"
)

// CABundleRotation maintains a CA bundle config map, but adding new CA certs and removing expired old ones.
Expand Down
9 changes: 4 additions & 5 deletions pkg/operator/certrotation/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import (
"fmt"
"time"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/openshift/library-go/pkg/certs"
"github.com/openshift/library-go/pkg/crypto"
"github.com/openshift/library-go/pkg/operator/events"
"github.com/openshift/library-go/pkg/operator/resource/resourceapply"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
corev1listers "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/util/cert"
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"k8s.io/klog/v2"
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
apiregistrationclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1"

operatorv1client "open-cluster-management.io/api/client/operator/clientset/versioned/typed/operator/v1"
operatorapiv1 "open-cluster-management.io/api/operator/v1"
)
Expand Down
7 changes: 4 additions & 3 deletions pkg/operator/helpers/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import (
"testing"
"time"

"k8s.io/component-base/featuregate"
ocmfeature "open-cluster-management.io/api/feature"

"github.com/google/go-cmp/cmp"
"github.com/openshift/library-go/pkg/assets"
"github.com/openshift/library-go/pkg/operator/events"
Expand All @@ -33,9 +30,13 @@ import (
clienttesting "k8s.io/client-go/testing"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
clientcmdlatest "k8s.io/client-go/tools/clientcmd/api/latest"
"k8s.io/component-base/featuregate"
fakeapiregistration "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/fake"

opereatorfake "open-cluster-management.io/api/client/operator/clientset/versioned/fake"
ocmfeature "open-cluster-management.io/api/feature"
operatorapiv1 "open-cluster-management.io/api/operator/v1"

"open-cluster-management.io/ocm/manifests"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/operator/helpers/queuekey.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import (
"fmt"
"strings"

"github.com/openshift/library-go/pkg/controller/factory"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"

"github.com/openshift/library-go/pkg/controller/factory"

operatorlister "open-cluster-management.io/api/client/operator/listers/operator/v1"
operatorapiv1 "open-cluster-management.io/api/operator/v1"
)
Expand Down
2 changes: 2 additions & 0 deletions pkg/operator/helpers/testing/assertion.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"

opratorapiv1 "open-cluster-management.io/api/operator/v1"

"open-cluster-management.io/ocm/pkg/operator/helpers"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
operatorinformer "open-cluster-management.io/api/client/operator/informers/externalversions/operator/v1"
operatorlister "open-cluster-management.io/api/client/operator/listers/operator/v1"
operatorv1 "open-cluster-management.io/api/operator/v1"

"open-cluster-management.io/ocm/pkg/operator/certrotation"
"open-cluster-management.io/ocm/pkg/operator/helpers"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import (
"testing"
"time"

"k8s.io/apimachinery/pkg/fields"
corev1informers "k8s.io/client-go/informers/core/v1"

"github.com/openshift/library-go/pkg/controller/factory"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/runtime"
kubeinformers "k8s.io/client-go/informers"
corev1informers "k8s.io/client-go/informers/core/v1"
"k8s.io/client-go/kubernetes"
fakekube "k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/util/cert"

fakeoperatorclient "open-cluster-management.io/api/client/operator/clientset/versioned/fake"
operatorinformers "open-cluster-management.io/api/client/operator/informers/externalversions"
operatorapiv1 "open-cluster-management.io/api/operator/v1"

testingcommon "open-cluster-management.io/ocm/pkg/common/testing"
"open-cluster-management.io/ocm/pkg/operator/helpers"
)
Expand Down
Loading

0 comments on commit 55bb1a7

Please sign in to comment.