Skip to content

Commit

Permalink
Merge pull request #2573 from murthy95/main
Browse files Browse the repository at this point in the history
[gwctl] Cleanup import packages in gwctl
  • Loading branch information
k8s-ci-robot authored Nov 9, 2023
2 parents 626e7d6 + cdabb80 commit 99b4d90
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 44 deletions.
5 changes: 2 additions & 3 deletions gwctl/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ package main

import (
"context"
_ "embed"
"flag"
"os"
"path"

"k8s.io/klog/v2"

"github.com/spf13/cobra"
cobraflag "github.com/spf13/pflag"
"k8s.io/klog/v2"

"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/describe"
"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/get"
cmdutils "sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
Expand Down
4 changes: 2 additions & 2 deletions gwctl/pkg/cmd/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"fmt"
"os"

"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"github.com/spf13/cobra"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils/printer"
"sigs.k8s.io/gateway-api/gwctl/pkg/common/resourcehelpers"
Expand Down
1 change: 1 addition & 0 deletions gwctl/pkg/cmd/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"os"

"github.com/spf13/cobra"

"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils/printer"
"sigs.k8s.io/gateway-api/gwctl/pkg/common/resourcehelpers"
Expand Down
6 changes: 3 additions & 3 deletions gwctl/pkg/cmd/utils/printer/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"fmt"
"io"

"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"
"sigs.k8s.io/gateway-api/gwctl/pkg/policymanager"

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/yaml"

"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"
"sigs.k8s.io/gateway-api/gwctl/pkg/policymanager"
)

type BackendsPrinter struct {
Expand Down
7 changes: 3 additions & 4 deletions gwctl/pkg/cmd/utils/printer/gatewayclasses.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ package printer

import (
"context"
_ "embed"
"fmt"
"io"

"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"
"sigs.k8s.io/gateway-api/gwctl/pkg/policymanager"

gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
"sigs.k8s.io/yaml"

"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"
"sigs.k8s.io/gateway-api/gwctl/pkg/policymanager"
)

type GatewayClassesPrinter struct {
Expand Down
10 changes: 5 additions & 5 deletions gwctl/pkg/cmd/utils/printer/gatewayclasses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/common"
"sigs.k8s.io/gateway-api/gwctl/pkg/common/resourcehelpers"
"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"

apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/common"
"sigs.k8s.io/gateway-api/gwctl/pkg/common/resourcehelpers"
"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"
)

func TestGatewayClassesPrinter_PrintDescribeView(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion gwctl/pkg/cmd/utils/printer/gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package printer

import (
"context"
_ "embed"
"fmt"
"io"

Expand Down
10 changes: 5 additions & 5 deletions gwctl/pkg/cmd/utils/printer/gateways_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/common"
"sigs.k8s.io/gateway-api/gwctl/pkg/common/resourcehelpers"
"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"

apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/common"
"sigs.k8s.io/gateway-api/gwctl/pkg/common/resourcehelpers"
"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"
)

func TestGatewaysPrinter_PrintDescribeView(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion gwctl/pkg/cmd/utils/printer/httproutes.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package printer

import (
"context"
_ "embed"
"fmt"
"io"
"strings"
Expand Down
10 changes: 5 additions & 5 deletions gwctl/pkg/cmd/utils/printer/httproutes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/common"
"sigs.k8s.io/gateway-api/gwctl/pkg/common/resourcehelpers"
"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"

apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/common"
"sigs.k8s.io/gateway-api/gwctl/pkg/common/resourcehelpers"
"sigs.k8s.io/gateway-api/gwctl/pkg/effectivepolicy"
)

func TestHTTPRoutesPrinter_PrintDescribeView(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion gwctl/pkg/cmd/utils/printer/policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package printer

import (
_ "embed"
"fmt"
"io"
"sort"
Expand Down
6 changes: 3 additions & 3 deletions gwctl/pkg/cmd/utils/printer/policies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/common"

apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"

"sigs.k8s.io/gateway-api/gwctl/pkg/cmd/utils"
"sigs.k8s.io/gateway-api/gwctl/pkg/common"
)

func TestPoliciesPrinter_Print_And_PrintDescribeView(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions gwctl/pkg/common/resourcehelpers/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/discovery"
"k8s.io/utils/strings/slices"

"sigs.k8s.io/gateway-api/gwctl/pkg/common"
)

Expand Down
2 changes: 1 addition & 1 deletion gwctl/pkg/common/resourcehelpers/gatewayclasses.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package resourcehelpers

import (
"context"
_ "embed"

apimachinerytypes "k8s.io/apimachinery/pkg/types"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"sigs.k8s.io/gateway-api/gwctl/pkg/common"
)

Expand Down
2 changes: 1 addition & 1 deletion gwctl/pkg/common/resourcehelpers/gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ package resourcehelpers

import (
"context"
_ "embed"

apimachinerytypes "k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"sigs.k8s.io/gateway-api/gwctl/pkg/common"
)

Expand Down
2 changes: 1 addition & 1 deletion gwctl/pkg/common/resourcehelpers/httproutes.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ package resourcehelpers

import (
"context"
_ "embed"

apimachinerytypes "k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"sigs.k8s.io/gateway-api/gwctl/pkg/common"
)

Expand Down
6 changes: 3 additions & 3 deletions gwctl/pkg/effectivepolicy/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ package effectivepolicy
import (
"context"

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"sigs.k8s.io/gateway-api/gwctl/pkg/common"
"sigs.k8s.io/gateway-api/gwctl/pkg/common/resourcehelpers"
"sigs.k8s.io/gateway-api/gwctl/pkg/policymanager"

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
)

type backends struct {
Expand Down
5 changes: 2 additions & 3 deletions gwctl/pkg/effectivepolicy/gatewayclasses.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ package effectivepolicy

import (
"context"
_ "embed"

"sigs.k8s.io/gateway-api/gwctl/pkg/policymanager"

gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"sigs.k8s.io/gateway-api/gwctl/pkg/policymanager"
)

type gatewayClasses struct {
Expand Down
1 change: 0 additions & 1 deletion gwctl/pkg/effectivepolicy/gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package effectivepolicy

import (
"context"
_ "embed"

gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

Expand Down
1 change: 0 additions & 1 deletion gwctl/pkg/effectivepolicy/httproutes.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package effectivepolicy

import (
"context"
_ "embed"
"fmt"

gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
Expand Down

0 comments on commit 99b4d90

Please sign in to comment.