Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce staticcheck linter for deprecations #1798

Merged
merged 2 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ GOLANGCI_LINT_VER := v1.47.2
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_GOBIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

STATICCHECK_VER := 2022.1
STATICCHECK_BIN := staticcheck
STATICCHECK := $(TOOLS_GOBIN_DIR)/$(STATICCHECK_BIN)-$(STATICCHECK_VER)

GOTESTSUM_VER := v1.8.1
GOTESTSUM_BIN := gotestsum
GOTESTSUM := $(abspath $(TOOLS_DIR))/$(GOTESTSUM_BIN)-$(GOTESTSUM_VER)
Expand Down Expand Up @@ -103,8 +107,13 @@ install:
$(GOLANGCI_LINT):
GOBIN=$(TOOLS_GOBIN_DIR) $(GO_INSTALL) github.com/golangci/golangci-lint/cmd/golangci-lint $(GOLANGCI_LINT_BIN) $(GOLANGCI_LINT_VER)

lint: $(GOLANGCI_LINT)
$(STATICCHECK):
GOBIN=$(TOOLS_GOBIN_DIR) $(GO_INSTALL) honnef.co/go/tools/cmd/staticcheck $(STATICCHECK_BIN) $(STATICCHECK_VER)

lint: $(GOLANGCI_LINT) $(STATICCHECK)
$(GOLANGCI_LINT) run --timeout=10m ./...
$(STATICCHECK) -checks ST1019,ST1005 ./...

.PHONY: lint

vendor: ## Vendor the dependencies
Expand Down
6 changes: 3 additions & 3 deletions cmd/sharded-test-server/frontproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func startFrontProxy(ctx context.Context, args []string, servingCA *crypto.CA, h
proxy_client_cert: .kcp-front-proxy/requestheader.crt
proxy_client_key: .kcp-front-proxy/requestheader.key
`), 0644); err != nil {
return fmt.Errorf("failed to create front-proxy mapping.yaml: %w\n", err)
return fmt.Errorf("failed to create front-proxy mapping.yaml: %w", err)
}

// write root shard kubeconfig
Expand All @@ -87,10 +87,10 @@ func startFrontProxy(ctx context.Context, args []string, servingCA *crypto.CA, h
klog.Infof("Creating kcp-front-proxy serving cert with hostnames %v", hostnames)
cert, err := servingCA.MakeServerCert(hostnames, 365)
if err != nil {
return fmt.Errorf("failed to create server cert: %w\n", err)
return fmt.Errorf("failed to create server cert: %w", err)
}
if err := cert.WriteCertConfigFile(filepath.Join(workDirPath, ".kcp-front-proxy/apiserver.crt"), filepath.Join(workDirPath, ".kcp-front-proxy/apiserver.key")); err != nil {
return fmt.Errorf("failed to write server cert: %w\n", err)
return fmt.Errorf("failed to write server cert: %w", err)
}

// run front-proxy command
Expand Down
12 changes: 6 additions & 6 deletions cmd/sharded-test-server/third_party/library-go/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func GetTLSCertificateConfig(certFile, keyFile string) (*TLSCertificateConfig, e
}
certs, err := cert.ParseCertsPEM(certPEMBlock)
if err != nil {
return nil, fmt.Errorf("Error reading %s: %s", certFile, err)
return nil, fmt.Errorf("error reading %s: %s", certFile, err)
}

keyPEMBlock, err := ioutil.ReadFile(keyFile)
Expand All @@ -434,7 +434,7 @@ func GetTLSCertificateConfigFromBytes(certBytes, keyBytes []byte) (*TLSCertifica

certs, err := cert.ParseCertsPEM(certBytes)
if err != nil {
return nil, fmt.Errorf("Error reading cert: %s", err)
return nil, fmt.Errorf("error reading cert: %s", err)
}

keyPairCert, err := tls.X509KeyPair(certBytes, keyBytes)
Expand Down Expand Up @@ -733,7 +733,7 @@ func GetServerCert(certFile, keyFile string, hostnames sets.String) (*TLSCertifi
return server, nil
}

return nil, fmt.Errorf("Existing server certificate in %s was missing some hostnames (%v) or IP addresses (%v).", certFile, missingDns, missingIps)
return nil, fmt.Errorf("existing server certificate in %s was missing some hostnames (%v) or IP addresses (%v)", certFile, missingDns, missingIps)
}

func (ca *CA) MakeAndWriteServerCert(certFile, keyFile string, hostnames sets.String, expireDays int) (*TLSCertificateConfig, error) {
Expand Down Expand Up @@ -1045,7 +1045,7 @@ func CertsFromPEM(pemCerts []byte) ([]*x509.Certificate, error) {
}

if !ok {
return certs, errors.New("Could not read any certificates")
return certs, errors.New("could not read any certificates")
}
return certs, nil
}
Expand Down Expand Up @@ -1099,7 +1099,7 @@ func signCertificate(template *x509.Certificate, requestKey crypto.PublicKey, is
return nil, err
}
if len(certs) != 1 {
return nil, errors.New("Expected a single certificate")
return nil, errors.New("expected a single certificate")
}
return certs[0], nil
}
Expand Down Expand Up @@ -1129,7 +1129,7 @@ func encodeKey(key crypto.PrivateKey) ([]byte, error) {
return []byte{}, err
}
default:
return []byte{}, errors.New("Unrecognized key type")
return []byte{}, errors.New("unrecognized key type")

}
return b.Bytes(), nil
Expand Down
5 changes: 2 additions & 3 deletions pkg/authorization/apibinding_authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac"

"github.com/kcp-dev/kcp/pkg/apis/apis/v1alpha1"
apisv1alpha1 "github.com/kcp-dev/kcp/pkg/apis/apis/v1alpha1"
kcpinformers "github.com/kcp-dev/kcp/pkg/client/informers/externalversions"
rbacwrapper "github.com/kcp-dev/kcp/pkg/virtual/framework/wrappers/rbac"
Expand Down Expand Up @@ -176,14 +175,14 @@ func (a *apiBindingAccessAuthorizer) getAPIBindingReference(attr authorizer.Attr
return nil, false, nil
}

func (a *apiBindingAccessAuthorizer) getAPIExport(exportRef *apisv1alpha1.ExportReference) (*v1alpha1.APIExport, bool, error) {
func (a *apiBindingAccessAuthorizer) getAPIExport(exportRef *apisv1alpha1.ExportReference) (*apisv1alpha1.APIExport, bool, error) {
objs, err := a.apiExportIndexer.ByIndex(byWorkspaceIndex, exportRef.Workspace.Path)
if err != nil {
return nil, false, err
}

for _, obj := range objs {
apiExport := obj.(*v1alpha1.APIExport)
apiExport := obj.(*apisv1alpha1.APIExport)
if apiExport.Name == exportRef.Workspace.ExportName {
return apiExport, true, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/crdpuller/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ func (sc *SchemaConverter) VisitKind(k *proto.Kind) {
func (sc *SchemaConverter) VisitReference(r proto.Reference) {
reference := r.Reference()
if sc.visited.Has(reference) {
*sc.errors = append(*sc.errors, fmt.Errorf("Recursive schema are not supported: %s", reference))
*sc.errors = append(*sc.errors, fmt.Errorf("recursive schema are not supported: %s", reference))
return
}
if knownSchema, schemaIsKnown := knownSchemas[reference]; schemaIsKnown {
Expand Down
5 changes: 2 additions & 3 deletions pkg/localenvoy/controlplane/controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
listener "github.com/envoyproxy/go-control-plane/envoy/service/listener/v3"
route "github.com/envoyproxy/go-control-plane/envoy/service/route/v3"
cachetypes "github.com/envoyproxy/go-control-plane/pkg/cache/types"
"github.com/envoyproxy/go-control-plane/pkg/cache/v3"
envoycachev3 "github.com/envoyproxy/go-control-plane/pkg/cache/v3"
"github.com/envoyproxy/go-control-plane/pkg/resource/v3"
xds "github.com/envoyproxy/go-control-plane/pkg/server/v3"
Expand Down Expand Up @@ -68,13 +67,13 @@ type EnvoyControlPlane struct {
ingressLister v1.IngressLister
translator *translator
managementPort uint
snapshotCache cache.SnapshotCache
snapshotCache envoycachev3.SnapshotCache
callbacks xds.Callbacks
}

// NewEnvoyControlPlane creates a new EnvoyControlPlane instance.
func NewEnvoyControlPlane(managementPort, envoyListenPort uint, ingressLister v1.IngressLister, callbacks xds.Callbacks) *EnvoyControlPlane {
snapshotCache := cache.NewSnapshotCache(true, cache.IDHash{}, nil)
snapshotCache := envoycachev3.NewSnapshotCache(true, envoycachev3.IDHash{}, nil)

ecp := EnvoyControlPlane{
managementPort: managementPort,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (c *Controller) patchIfNeeded(ctx context.Context, old, obj *tenancyv1alpha

if specOrObjectMetaChanged && statusChanged {
// enqueue again to take care of the spec change, assuming the patch did nothing
return fmt.Errorf("Programmer error: spec and status changed in same reconcile iteration:\n%s", cmp.Diff(old, obj))
return fmt.Errorf("programmer error: spec and status changed in same reconcile iteration:\n%s", cmp.Diff(old, obj))
}

return nil
Expand Down
3 changes: 1 addition & 2 deletions pkg/reconciler/workload/apiexport/apiresourceschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"

"github.com/kcp-dev/kcp/pkg/apis/apiresource/v1alpha1"
apiresourcev1alpha1 "github.com/kcp-dev/kcp/pkg/apis/apiresource/v1alpha1"
apisv1alpha1 "github.com/kcp-dev/kcp/pkg/apis/apis/v1alpha1"
)

func toAPIResourceSchema(r *v1alpha1.NegotiatedAPIResource, name string) *apisv1alpha1.APIResourceSchema {
func toAPIResourceSchema(r *apiresourcev1alpha1.NegotiatedAPIResource, name string) *apisv1alpha1.APIResourceSchema {
group := r.Spec.CommonAPIResourceSpec.GroupVersion.Group
if group == "core" {
group = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (c *Controller) reconcile(ctx context.Context, deployment *appsv1.Deploymen
return err
}
if !exists {
return fmt.Errorf("Root deployment not found: %s", rootDeploymentName)
return fmt.Errorf("root deployment not found: %s", rootDeploymentName)
}

rootDeployment = rootIf.(*appsv1.Deployment)
Expand Down
1 change: 0 additions & 1 deletion pkg/server/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (

kcpadmission "github.com/kcp-dev/kcp/pkg/admission"
etcdoptions "github.com/kcp-dev/kcp/pkg/embeddedetcd/options"
_ "github.com/kcp-dev/kcp/pkg/features"
kcpfeatures "github.com/kcp-dev/kcp/pkg/features"
"github.com/kcp-dev/kcp/pkg/server/options/batteries"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/syncer/spec/spec_process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/dynamic/dynamicinformer"
"k8s.io/client-go/dynamic/fake"
dynamicfake "k8s.io/client-go/dynamic/fake"
clienttesting "k8s.io/client-go/testing"
"k8s.io/client-go/tools/clusters"
Expand Down Expand Up @@ -451,7 +450,7 @@ func TestDeepEqualApartFromStatus(t *testing.T) {
var _ dynamic.ClusterInterface = (*mockedDynamicCluster)(nil)

type mockedDynamicCluster struct {
client *fake.FakeDynamicClient
client *dynamicfake.FakeDynamicClient
}

func (mdc *mockedDynamicCluster) Cluster(name logicalcluster.Name) dynamic.Interface {
Expand Down
3 changes: 1 addition & 2 deletions pkg/syncer/status/status_process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/dynamic/dynamicinformer"
"k8s.io/client-go/dynamic/fake"
dynamicfake "k8s.io/client-go/dynamic/fake"
clienttesting "k8s.io/client-go/testing"
"k8s.io/client-go/tools/cache"
Expand Down Expand Up @@ -293,7 +292,7 @@ func TestDeepEqualFinalizersAndStatus(t *testing.T) {
var _ dynamic.ClusterInterface = (*mockedDynamicCluster)(nil)

type mockedDynamicCluster struct {
client *fake.FakeDynamicClient
client *dynamicfake.FakeDynamicClient
}

func (mdc *mockedDynamicCluster) Cluster(name logicalcluster.Name) dynamic.Interface {
Expand Down
2 changes: 1 addition & 1 deletion pkg/virtual/framework/authorization/authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ func (a *virtualWorkspaceAuthorizer) Authorize(ctx context.Context, attrs author

// This should never happen if a virtual workspace name has been set in the context by the
// ResolveRootPath method of one of the virtual workspaces.
return authorizer.DecisionNoOpinion, "", fmt.Errorf("Virtual Workspace %q not found", virtualWorkspaceName)
return authorizer.DecisionNoOpinion, "", fmt.Errorf("virtual Workspace %q not found", virtualWorkspaceName)
}
3 changes: 1 addition & 2 deletions pkg/virtual/framework/fixedgvs/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apiserver/pkg/endpoints/discovery"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/registry/rest"
restStorage "k8s.io/apiserver/pkg/registry/rest"
genericapiserver "k8s.io/apiserver/pkg/server"

Expand Down Expand Up @@ -119,7 +118,7 @@ func (c completedConfig) New(virtualWorkspaceName string, groupManager discovery

codecs := serializer.NewCodecFactory(scheme)

storage := map[string]rest.Storage{}
storage := map[string]restStorage.Storage{}
for resource, storageBuilder := range c.ExtraConfig.StorageBuilders {
restStorage, err := storageBuilder(c.GenericConfig)
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions pkg/virtual/framework/forwardingregistry/rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down Expand Up @@ -252,7 +251,7 @@ func TestWatch(t *testing.T) {
ctx := request.WithNamespace(context.Background(), "default")
ctx = request.WithCluster(ctx, request.Cluster{Name: logicalcluster.New("foo")})

watchedError := &v1.Status{
watchedError := &metav1.Status{
Status: "Failure",
Message: "message",
}
Expand Down Expand Up @@ -296,7 +295,7 @@ func TestWildcardWatchWithPIExportIdentity(t *testing.T) {
ctx := request.WithNamespace(context.Background(), "default")
ctx = request.WithCluster(ctx, request.Cluster{Name: logicalcluster.Wildcard, Wildcard: true})

watchedError := &v1.Status{
watchedError := &metav1.Status{
Status: "Failure",
Message: "message",
}
Expand Down
21 changes: 10 additions & 11 deletions test/e2e/conformance/cross_logical_cluster_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
"k8s.io/client-go/kubernetes"

configcrds "github.com/kcp-dev/kcp/config/crds"
tenancyapi "github.com/kcp-dev/kcp/pkg/apis/tenancy/v1alpha1"
tenancyv1alpha1 "github.com/kcp-dev/kcp/pkg/apis/tenancy/v1alpha1"
kcpclientset "github.com/kcp-dev/kcp/pkg/client/clientset/versioned"
"github.com/kcp-dev/kcp/pkg/indexers"
Expand All @@ -66,16 +65,16 @@ func TestCrossLogicalClusterList(t *testing.T) {

// Note: we put all consumer workspaces onto root shard in order to enforce conflicts.
logicalClusters := []logicalcluster.Name{
framework.NewOrganizationFixture(t, server, framework.WithShardConstraints(tenancyapi.ShardConstraints{Name: "root"})),
framework.NewOrganizationFixture(t, server, framework.WithShardConstraints(tenancyapi.ShardConstraints{Name: "root"})),
framework.NewOrganizationFixture(t, server, framework.WithShardConstraints(tenancyv1alpha1.ShardConstraints{Name: "root"})),
framework.NewOrganizationFixture(t, server, framework.WithShardConstraints(tenancyv1alpha1.ShardConstraints{Name: "root"})),
}
expectedWorkspaces := sets.NewString()
for i, lcluster := range logicalClusters {
wsName := fmt.Sprintf("ws-%d", i)

clustername := lcluster
t.Logf("Creating ClusterWorkspace CRs in logical cluster %s", lcluster)
sourceWorkspace := &tenancyapi.ClusterWorkspace{
sourceWorkspace := &tenancyv1alpha1.ClusterWorkspace{
ObjectMeta: metav1.ObjectMeta{
Name: wsName,
},
Expand All @@ -91,7 +90,7 @@ func TestCrossLogicalClusterList(t *testing.T) {
}

t.Logf("Listing ClusterWorkspace CRs across logical clusters with identity")
tenancyExport, err := kcpClusterClient.ApisV1alpha1().APIExports().Get(logicalcluster.WithCluster(ctx, tenancyapi.RootCluster), "tenancy.kcp.dev", metav1.GetOptions{})
tenancyExport, err := kcpClusterClient.ApisV1alpha1().APIExports().Get(logicalcluster.WithCluster(ctx, tenancyv1alpha1.RootCluster), "tenancy.kcp.dev", metav1.GetOptions{})
require.NoError(t, err, "error getting tenancy API export")
require.NotEmptyf(t, tenancyExport.Status.IdentityHash, "tenancy API export has no identity hash")
dynamicClusterClient, err := kcpdynamic.NewClusterDynamicClientForConfig(rootShardCfg)
Expand Down Expand Up @@ -134,11 +133,11 @@ func TestCRDCrossLogicalClusterListPartialObjectMetadata(t *testing.T) {
// Note: we put all consumer workspaces onto root shard in order to enforce conflicts.

// These 2 workspaces will have the same sheriffs CRD schema as normal CRDs
wsNormalCRD1a := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyapi.ShardConstraints{Name: "root"}))
wsNormalCRD1b := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyapi.ShardConstraints{Name: "root"}))
wsNormalCRD1a := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyv1alpha1.ShardConstraints{Name: "root"}))
wsNormalCRD1b := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyv1alpha1.ShardConstraints{Name: "root"}))

// This workspace will have a different sherrifs CRD schema as a normal CRD - will conflict with 1a/1b.
wsNormalCRD2 := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyapi.ShardConstraints{Name: "root"}))
wsNormalCRD2 := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyv1alpha1.ShardConstraints{Name: "root"}))

// These 2 workspaces will export a sheriffs API with the same schema
wsExport1a := framework.NewWorkspaceFixture(t, server, org)
Expand All @@ -148,13 +147,13 @@ func TestCRDCrossLogicalClusterListPartialObjectMetadata(t *testing.T) {
wsExport2 := framework.NewWorkspaceFixture(t, server, org)

// This workspace will consume from wsExport1a
wsConsume1a := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyapi.ShardConstraints{Name: "root"}))
wsConsume1a := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyv1alpha1.ShardConstraints{Name: "root"}))

// This workspace will consume from wsExport1b
wsConsume1b := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyapi.ShardConstraints{Name: "root"}))
wsConsume1b := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyv1alpha1.ShardConstraints{Name: "root"}))

// This workspace will consume from wsExport2
wsConsume2 := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyapi.ShardConstraints{Name: "root"}))
wsConsume2 := framework.NewWorkspaceFixture(t, server, org, framework.WithShardConstraints(tenancyv1alpha1.ShardConstraints{Name: "root"}))

cfg := server.BaseConfig(t)
rootShardConfig := server.RootShardSystemMasterBaseConfig(t)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/framework/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (c *testConfig) PClusterKubeconfig() string {
func (c *testConfig) KCPKubeconfig() string {
// TODO(marun) How to validate before use given that the testing package is calling flags.Parse()?
if c.useDefaultKCPServer && len(c.kcpKubeconfig) > 0 {
panic(errors.New("Only one of --use-default-kcp-server and --kcp-kubeconfig should be set."))
panic(errors.New("only one of --use-default-kcp-server and --kcp-kubeconfig should be set"))
}

if c.useDefaultKCPServer {
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/framework/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
kubernetesclientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
Expand Down Expand Up @@ -334,7 +333,7 @@ type StartedSyncerFixture struct {
// Provide cluster-admin config and client for test purposes. The downstream config in
// SyncerConfig will be less privileged.
DownstreamConfig *rest.Config
DownstreamKubeClient kubernetes.Interface
DownstreamKubeClient kubernetesclientset.Interface
}

// WaitForClusterReady waits for the cluster to be ready with the given reason.
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/reconciler/clusterworkspace/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (

tenancyv1alpha1 "github.com/kcp-dev/kcp/pkg/apis/tenancy/v1alpha1"
utilconditions "github.com/kcp-dev/kcp/pkg/apis/third_party/conditions/util/conditions"
clientset "github.com/kcp-dev/kcp/pkg/client/clientset/versioned"
kcpclientset "github.com/kcp-dev/kcp/pkg/client/clientset/versioned"
"github.com/kcp-dev/kcp/test/e2e/framework"
)
Expand All @@ -45,7 +44,7 @@ func TestWorkspaceController(t *testing.T) {

type runningServer struct {
framework.RunningServer
rootKcpClient, orgKcpClient clientset.Interface
rootKcpClient, orgKcpClient kcpclientset.Interface
orgExpect framework.RegisterClusterWorkspaceExpectation
rootExpectShard framework.RegisterWorkspaceShardExpectation
}
Expand Down
Loading