Skip to content

Commit

Permalink
Delete old command workflows and dead code (#7815)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-gaston authored Mar 13, 2024
1 parent 87c08f8 commit 5c2d6c0
Show file tree
Hide file tree
Showing 56 changed files with 491 additions and 9,217 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ mocks: ## Generate mocks
${MOCKGEN} -destination=pkg/providers/vsphere/setupuser/mocks/client.go -package=mocks "github.com/aws/eks-anywhere/pkg/providers/vsphere/setupuser" GovcClient
${MOCKGEN} -destination=pkg/govmomi/mocks/client.go -package=mocks "github.com/aws/eks-anywhere/pkg/govmomi" VSphereClient,VMOMIAuthorizationManager,VMOMIFinder,VMOMISessionBuilder,VMOMIFinderBuilder,VMOMIAuthorizationManagerBuilder
${MOCKGEN} -destination=pkg/filewriter/mocks/filewriter.go -package=mocks "github.com/aws/eks-anywhere/pkg/filewriter" FileWriter
${MOCKGEN} -destination=pkg/clustermanager/mocks/client_and_networking.go -package=mocks "github.com/aws/eks-anywhere/pkg/clustermanager" ClusterClient,Networking,AwsIamAuth,EKSAComponents,KubernetesClient,ClientFactory,ClusterApplier,CAPIClient
${MOCKGEN} -destination=pkg/clustermanager/mocks/client_and_networking.go -package=mocks "github.com/aws/eks-anywhere/pkg/clustermanager" ClusterClient,AwsIamAuth,EKSAComponents,KubernetesClient,ClientFactory,ClusterApplier,CAPIClient
${MOCKGEN} -destination=pkg/gitops/flux/mocks/client.go -package=mocks "github.com/aws/eks-anywhere/pkg/gitops/flux" FluxClient,KubeClient,GitOpsFluxClient,GitClient,Templater
${MOCKGEN} -destination=pkg/task/mocks/task.go -package=mocks "github.com/aws/eks-anywhere/pkg/task" Task
${MOCKGEN} -destination=pkg/bootstrapper/mocks/client.go -package=mocks "github.com/aws/eks-anywhere/pkg/bootstrapper" KindClient,KubernetesClient
Expand All @@ -578,14 +578,9 @@ mocks: ## Generate mocks
${MOCKGEN} -destination=pkg/validations/mocks/tls.go -package=mocks -source "pkg/validations/tls.go" TlsValidator
${MOCKGEN} -destination=pkg/diagnostics/interfaces/mocks/diagnostics.go -package=mocks -source "pkg/diagnostics/interfaces.go" DiagnosticBundle,AnalyzerFactory,CollectorFactory,BundleClient
${MOCKGEN} -destination=pkg/clusterapi/mocks/capiclient.go -package=mocks -source "pkg/clusterapi/manager.go" CAPIClient,KubectlClient
${MOCKGEN} -destination=pkg/clusterapi/mocks/fetch.go -package=mocks -source "pkg/clusterapi/fetch.go"
${MOCKGEN} -destination=pkg/crypto/mocks/crypto.go -package=mocks -source "pkg/crypto/certificategen.go" CertificateGenerator
${MOCKGEN} -destination=pkg/crypto/mocks/validator.go -package=mocks -source "pkg/crypto/validator.go" TlsValidator
${MOCKGEN} -destination=pkg/networking/cilium/mocks/clients.go -package=mocks -source "pkg/networking/cilium/client.go"
${MOCKGEN} -destination=pkg/networking/cilium/mocks/helm.go -package=mocks -source "pkg/networking/cilium/templater.go"
${MOCKGEN} -destination=pkg/networking/cilium/mocks/upgrader.go -package=mocks -source "pkg/networking/cilium/upgrader.go"
${MOCKGEN} -destination=pkg/networking/kindnetd/mocks/client.go -package=mocks -source "pkg/networking/kindnetd/kindnetd.go"
${MOCKGEN} -destination=pkg/networking/cilium/mocks/installer.go -package=mocks -source "pkg/networking/cilium/installer.go"
${MOCKGEN} -destination=pkg/networkutils/mocks/client.go -package=mocks -source "pkg/networkutils/netclient.go" NetClient
${MOCKGEN} -destination=pkg/providers/tinkerbell/hardware/mocks/translate.go -package=mocks -source "pkg/providers/tinkerbell/hardware/translate.go" MachineReader,MachineWriter,MachineValidator
${MOCKGEN} -destination=pkg/providers/tinkerbell/stack/mocks/stack.go -package=mocks -source "pkg/providers/tinkerbell/stack/stack.go" Docker,Helm,StackInstaller
Expand Down
4 changes: 1 addition & 3 deletions cmd/eksctl-anywhere/cmd/createcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ func (cc *createClusterOptions) createCluster(cmd *cobra.Command, _ []string) er

if features.UseNewWorkflows().IsActive() {
deps, err = factory.
WithCNIInstaller(clusterSpec, deps.Provider).
Build(ctx)
if err != nil {
return err
Expand All @@ -236,8 +235,7 @@ func (cc *createClusterOptions) createCluster(cmd *cobra.Command, _ []string) er
Spec: clusterSpec,
Bootstrapper: deps.Bootstrapper,
CreateBootstrapClusterOptions: deps.Provider,
CNIInstaller: deps.CNIInstaller,
Cluster: clustermanager.NewCreateClusterShim(clusterSpec, deps.ClusterManager, deps.Provider),
Cluster: clustermanager.NewCreateClusterShim(clusterSpec, deps.Provider),
FS: deps.Writer,
}
wflw.WithHookRegistrar(awsiamauth.NewHookRegistrar(deps.AwsIamAuth, clusterSpec))
Expand Down
64 changes: 0 additions & 64 deletions pkg/cluster/mocks/helm.go

This file was deleted.

9 changes: 0 additions & 9 deletions pkg/cluster/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,3 @@ func kubeDistroRepository(image *eksdv1alpha1.AssetImage) (repo, tag string) {
func (vb *VersionsBundle) Ovas() []v1alpha1.Archive {
return vb.VersionsBundle.Ovas()
}

func BundlesRefDefaulter() Defaulter {
return func(c *Config) error {
if c.Cluster.Spec.BundlesRef == nil {
c.Cluster.Spec.BundlesRef = &eksav1alpha1.BundlesRef{}
}
return nil
}
}
66 changes: 0 additions & 66 deletions pkg/cluster/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,72 +138,6 @@ func TestSpecDeepCopy(t *testing.T) {
g.Expect(spec.DeepCopy()).To(Equal(spec))
}

func TestBundlesRefDefaulter(t *testing.T) {
tests := []struct {
name string
bundles *releasev1.Bundles
config, want *cluster.Config
}{
{
name: "no bundles ref",
bundles: &releasev1.Bundles{
ObjectMeta: metav1.ObjectMeta{
Name: "bundles-1",
Namespace: "eksa-system",
},
},
config: &cluster.Config{
Cluster: &anywherev1.Cluster{},
},
want: &cluster.Config{
Cluster: &anywherev1.Cluster{
Spec: anywherev1.ClusterSpec{
BundlesRef: &anywherev1.BundlesRef{},
},
},
},
},
{
name: "with previous bundles ref",
bundles: &releasev1.Bundles{
ObjectMeta: metav1.ObjectMeta{
Name: "bundles-1",
},
},
config: &cluster.Config{
Cluster: &anywherev1.Cluster{
Spec: anywherev1.ClusterSpec{
BundlesRef: &anywherev1.BundlesRef{
Name: "bundles-2",
Namespace: "default",
APIVersion: "anywhere.eks.amazonaws.com/v1alpha1",
},
},
},
},
want: &cluster.Config{
Cluster: &anywherev1.Cluster{
Spec: anywherev1.ClusterSpec{
BundlesRef: &anywherev1.BundlesRef{
Name: "bundles-2",
Namespace: "default",
APIVersion: "anywhere.eks.amazonaws.com/v1alpha1",
},
},
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
defaulter := cluster.BundlesRefDefaulter()
g.Expect(defaulter(tt.config)).To(Succeed())
g.Expect(tt.config).To(Equal(tt.want))
})
}
}

func validateSpecFromSimpleBundle(t *testing.T, gotSpec *cluster.Spec) {
VersionsBundle := gotSpec.RootVersionsBundle()
validateVersionedRepo(t, VersionsBundle.KubeDistro.Kubernetes, "public.ecr.aws/eks-distro/kubernetes", "v1.19.8-eks-1-19-4")
Expand Down
47 changes: 0 additions & 47 deletions pkg/clusterapi/fetch.go

This file was deleted.

Loading

0 comments on commit 5c2d6c0

Please sign in to comment.