Skip to content

Commit

Permalink
Remove generated clientsets
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpiritXIII committed Nov 17, 2023
1 parent 08a10de commit c5eeee3
Show file tree
Hide file tree
Showing 46 changed files with 4 additions and 4,269 deletions.
23 changes: 4 additions & 19 deletions e2e/operator_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/selection"
"k8s.io/client-go/discovery"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
Expand All @@ -55,7 +54,6 @@ import (
"github.com/GoogleCloudPlatform/prometheus-engine/e2e/kubeutil"
"github.com/GoogleCloudPlatform/prometheus-engine/pkg/operator"
monitoringv1 "github.com/GoogleCloudPlatform/prometheus-engine/pkg/operator/apis/monitoring/v1"
clientset "github.com/GoogleCloudPlatform/prometheus-engine/pkg/operator/generated/clientset/versioned"
)

const (
Expand Down Expand Up @@ -200,9 +198,7 @@ type OperatorContext struct {

namespace, pubNamespace string

kClient DelegatingClient
kubeClient kubernetes.Interface
operatorClient clientset.Interface
kClient DelegatingClient
}

func newOperatorContext(t *testing.T) *OperatorContext {
Expand All @@ -211,15 +207,6 @@ func newOperatorContext(t *testing.T) *OperatorContext {
t.Fatalf("Build Kubernetes client: %s", err)
}

kubeClient, err := kubernetes.NewForConfig(kubeconfig)
if err != nil {
t.Fatalf("Build Kubernetes clientset: %s", err)
}
operatorClient, err := clientset.NewForConfig(kubeconfig)
if err != nil {
t.Fatalf("Build operator clientset: %s", err)
}

ctx, cancel := context.WithCancel(context.Background())
// Create a namespace per test and run. This is to ensure that repeated runs of
// tests don't falsify results. Either by old test resources not being cleaned up
Expand All @@ -228,11 +215,9 @@ func newOperatorContext(t *testing.T) *OperatorContext {
pubNamespace := fmt.Sprintf("%s-pub", namespace)

tctx := &OperatorContext{
T: t,
namespace: namespace,
pubNamespace: pubNamespace,
kubeClient: kubeClient,
operatorClient: operatorClient,
T: t,
namespace: namespace,
pubNamespace: pubNamespace,
}
tctx.kClient = NewLabelWriterClient(c, tctx.getSubTestLabels())
t.Cleanup(func() {
Expand Down
7 changes: 0 additions & 7 deletions hack/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ update_codegen() {
--go-header-file "${REPO_ROOT}"/hack/boilerplate.go.txt \
--output-base "${REPO_ROOT}"

bash "${CODEGEN_PKG}"/code-generator.sh "client,informer,lister" \
github.com/GoogleCloudPlatform/prometheus-engine/pkg/operator/generated github.com/GoogleCloudPlatform/prometheus-engine/pkg/operator/apis \
monitoring:v1 \
--go-header-file "${REPO_ROOT}"/hack/boilerplate.go.txt \
--plural-exceptions "Rules:Rules,ClusterRules:ClusterRules,GlobalRules:GlobalRules" \
--output-base "${REPO_ROOT}"

cp -r "$REPO_ROOT"/github.com/GoogleCloudPlatform/prometheus-engine/* "$REPO_ROOT"
rm -r "$REPO_ROOT/github.com"
}
Expand Down
118 changes: 0 additions & 118 deletions pkg/operator/generated/clientset/versioned/clientset.go

This file was deleted.

18 changes: 0 additions & 18 deletions pkg/operator/generated/clientset/versioned/doc.go

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions pkg/operator/generated/clientset/versioned/fake/doc.go

This file was deleted.

54 changes: 0 additions & 54 deletions pkg/operator/generated/clientset/versioned/fake/register.go

This file was deleted.

18 changes: 0 additions & 18 deletions pkg/operator/generated/clientset/versioned/scheme/doc.go

This file was deleted.

Loading

0 comments on commit c5eeee3

Please sign in to comment.