From dc35e6fc725e60fa00536adb0c8644e56488c46e Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 17 Jun 2020 17:34:43 +0000 Subject: [PATCH 1/5] Rename 'BareMetal' to 'ExistingInfra' Also standardise the import name 'existinginfrav1' --- cmd/controller/main.go | 4 +- cmd/wksctl/main.go | 4 +- ...er.weave.works_existinginfraclusters.yaml} | 10 +-- ...r.weave.works_existinginframachiness.yaml} | 10 +-- docs/cluster.md | 6 +- .../controller/manifests/yaml/02_rbac.yaml | 8 +- .../controller/wksctl/cluster_controller.go | 12 +-- .../controller/wksctl/machine_controller.go | 38 +++++----- pkg/apis/wksprovider/machine/os/os.go | 28 +++---- pkg/cluster/machine/machine.go | 22 +++--- pkg/cluster/machine/machine_test.go | 44 +++++------ pkg/cluster/machine/machines_manifest.go | 6 +- pkg/{baremetal => existinginfra}/doc.go | 2 +- .../v1alpha3/doc.go | 0 .../v1alpha3/register.go | 8 +- .../v1alpha3/types.go | 30 ++++---- .../v1alpha3/zz_generated.deepcopy.go | 76 +++++++++---------- pkg/plan/recipe/install_plans.go | 4 +- pkg/plan/runners/ssh/ssh.go | 4 +- pkg/specs/parse_test.go | 21 ++--- pkg/specs/specs.go | 22 +++--- pkg/specs/validation.go | 14 ++-- pkg/specs/validation_test.go | 32 ++++---- pkg/utilities/manifest/manifest.go | 6 +- pkg/utilities/manifest/manifest_test.go | 16 ++-- .../integration/container/multimaster_test.go | 20 ++--- test/integration/test/apply_test.go | 22 +++--- test/integration/test/assets/cluster.yaml | 4 +- 28 files changed, 237 insertions(+), 236 deletions(-) rename config/crd/{cluster.weave.works_baremetalclusters.yaml => cluster.weave.works_existinginfraclusters.yaml} (96%) rename config/crd/{cluster.weave.works_baremetalmachines.yaml => cluster.weave.works_existinginframachiness.yaml} (92%) rename pkg/{baremetal => existinginfra}/doc.go (73%) rename pkg/{baremetal => existinginfra}/v1alpha3/doc.go (100%) rename pkg/{baremetal => existinginfra}/v1alpha3/register.go (87%) rename pkg/{baremetal => existinginfra}/v1alpha3/types.go (82%) rename pkg/{baremetal => existinginfra}/v1alpha3/zz_generated.deepcopy.go (80%) diff --git a/cmd/controller/main.go b/cmd/controller/main.go index 22317c3b..153ba5fd 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -8,8 +8,8 @@ import ( log "github.com/sirupsen/logrus" "github.com/spf13/cobra" wks "github.com/weaveworks/wksctl/pkg/apis/wksprovider/controller/wksctl" - baremetalv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" machineutil "github.com/weaveworks/wksctl/pkg/cluster/machine" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "k8s.io/client-go/kubernetes" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/controller-runtime/pkg/client" @@ -91,7 +91,7 @@ func run(cmd *cobra.Command, args []string) { } log.Info("registering scheme for all resources") - if err := baremetalv1.AddToScheme(mgr.GetScheme()); err != nil { + if err := existinginfrav1.AddToScheme(mgr.GetScheme()); err != nil { log.Fatal(err) } if err := clusterv1.AddToScheme(mgr.GetScheme()); err != nil { diff --git a/cmd/wksctl/main.go b/cmd/wksctl/main.go index 761b78e9..901bfc90 100644 --- a/cmd/wksctl/main.go +++ b/cmd/wksctl/main.go @@ -20,7 +20,7 @@ import ( "github.com/weaveworks/wksctl/cmd/wksctl/registrysynccommands" "github.com/weaveworks/wksctl/cmd/wksctl/version" "github.com/weaveworks/wksctl/cmd/wksctl/zshcompletions" - baremetalv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" v "github.com/weaveworks/wksctl/pkg/version" ) @@ -48,7 +48,7 @@ func main() { if err := clusterv1.AddToScheme(scheme.Scheme); err != nil { log.Fatal(err) } - if err := baremetalv1.AddToScheme(scheme.Scheme); err != nil { + if err := existinginfrav1.AddToScheme(scheme.Scheme); err != nil { log.Fatal(err) } diff --git a/config/crd/cluster.weave.works_baremetalclusters.yaml b/config/crd/cluster.weave.works_existinginfraclusters.yaml similarity index 96% rename from config/crd/cluster.weave.works_baremetalclusters.yaml rename to config/crd/cluster.weave.works_existinginfraclusters.yaml index 6dbb0480..bf8396a6 100644 --- a/config/crd/cluster.weave.works_baremetalclusters.yaml +++ b/config/crd/cluster.weave.works_existinginfraclusters.yaml @@ -6,16 +6,16 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.3.0 creationTimestamp: null - name: baremetalclusters.cluster.weave.works + name: existinginfraclusters.cluster.weave.works labels: cluster.x-k8s.io/v1alpha3: v1alpha3 spec: group: cluster.weave.works names: - kind: BareMetalCluster - listKind: BareMetalClusterList - plural: baremetalclusters - singular: baremetalcluster + kind: ExistingInfraCluster + listKind: ExistingInfraClusterList + plural: existinginfraclusters + singular: existinginfracluster scope: Namespaced validation: openAPIV3Schema: diff --git a/config/crd/cluster.weave.works_baremetalmachines.yaml b/config/crd/cluster.weave.works_existinginframachiness.yaml similarity index 92% rename from config/crd/cluster.weave.works_baremetalmachines.yaml rename to config/crd/cluster.weave.works_existinginframachiness.yaml index 15a731d1..d33bbc82 100644 --- a/config/crd/cluster.weave.works_baremetalmachines.yaml +++ b/config/crd/cluster.weave.works_existinginframachiness.yaml @@ -6,16 +6,16 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.3.0 creationTimestamp: null - name: baremetalmachines.cluster.weave.works + name: existinginframachines.cluster.weave.works labels: cluster.x-k8s.io/v1alpha3: v1alpha3 spec: group: cluster.weave.works names: - kind: BareMetalMachine - listKind: BareMetalMachineList - plural: baremetalmachines - singular: baremetalmachine + kind: ExistingInfraMachine + listKind: ExistingInfraMachineList + plural: existinginframachines + singular: existinginframachine scope: Namespaced validation: openAPIV3Schema: diff --git a/docs/cluster.md b/docs/cluster.md index 1b4f8c4e..e580bce2 100644 --- a/docs/cluster.md +++ b/docs/cluster.md @@ -2,7 +2,7 @@ Here's an example of the cluster definition. It is spread across two objects: a `Cluster` which is defined by Kubernetes ClusterAPI and a -`BareMetalCluster` defined by Weaveworks. Here, both objects have the +`ExistingInfraCluster` defined by Weaveworks. Here, both objects have the same name `example`, and the field `infrastructureRef` points from one to the other. @@ -20,11 +20,11 @@ spec: serviceDomain: cluster.local infrastructureRef: apiVersion: cluster.weave.works/v1alpha3 - kind: BareMetalCluster + kind: ExistingInfraCluster name: example --- apiVersion: cluster.weave.works/v1alpha3 -kind: BareMetalCluster +kind: ExistingInfraCluster metadata: name: example spec: diff --git a/pkg/apis/wksprovider/controller/manifests/yaml/02_rbac.yaml b/pkg/apis/wksprovider/controller/manifests/yaml/02_rbac.yaml index 9af31c88..ba5ae57b 100644 --- a/pkg/apis/wksprovider/controller/manifests/yaml/02_rbac.yaml +++ b/pkg/apis/wksprovider/controller/manifests/yaml/02_rbac.yaml @@ -19,10 +19,10 @@ rules: - apiGroups: - cluster.weave.works resources: - - baremetalclusters - - baremetalclusters/status - - baremetalmachines - - baremetalmachines/status + - existinginfraclusters + - existinginfraclusters/status + - existinginframachines + - existinginframachines/status verbs: - get - list diff --git a/pkg/apis/wksprovider/controller/wksctl/cluster_controller.go b/pkg/apis/wksprovider/controller/wksctl/cluster_controller.go index c5fea5f9..4f2b3393 100644 --- a/pkg/apis/wksprovider/controller/wksctl/cluster_controller.go +++ b/pkg/apis/wksprovider/controller/wksctl/cluster_controller.go @@ -5,7 +5,7 @@ import ( "errors" log "github.com/sirupsen/logrus" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" corev1 "k8s.io/api/core/v1" apierrs "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" @@ -30,7 +30,7 @@ func (a *ClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e contextLog := log.WithField("name", req.NamespacedName) // request only contains the name of the object, so fetch it from the api-server - bmc := &baremetalspecv1.BareMetalCluster{} + bmc := &existinginfrav1.ExistingInfraCluster{} err := a.client.Get(ctx, req.NamespacedName, bmc) if err != nil { if apierrs.IsNotFound(err) { // isn't there; give in @@ -51,7 +51,7 @@ func (a *ClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e contextLog = contextLog.WithField("cluster", cluster.Name) if util.IsPaused(cluster, bmc) { - contextLog.Info("BareMetalCluster or linked Cluster is marked as paused. Won't reconcile") + contextLog.Info("ExistingInfraCluster or linked Cluster is marked as paused. Won't reconcile") return ctrl.Result{}, nil } @@ -61,10 +61,10 @@ func (a *ClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e return ctrl.Result{}, err } - // Attempt to Patch the BareMetalMachine object and status after each reconciliation. + // Attempt to Patch the ExistingInfraMachine object and status after each reconciliation. defer func() { if err := patchHelper.Patch(ctx, bmc); err != nil { - contextLog.Errorf("failed to patch BareMetalCluster: %v", err) + contextLog.Errorf("failed to patch ExistingInfraCluster: %v", err) if reterr == nil { reterr = err } @@ -85,7 +85,7 @@ func (a *ClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e func (r *ClusterReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { controller, err := ctrl.NewControllerManagedBy(mgr). WithOptions(options). - For(&baremetalspecv1.BareMetalCluster{}). + For(&existinginfrav1.ExistingInfraCluster{}). WithEventFilter(pausedPredicates()). Build(r) diff --git a/pkg/apis/wksprovider/controller/wksctl/machine_controller.go b/pkg/apis/wksprovider/controller/wksctl/machine_controller.go index 0763b306..0121683e 100644 --- a/pkg/apis/wksprovider/controller/wksctl/machine_controller.go +++ b/pkg/apis/wksprovider/controller/wksctl/machine_controller.go @@ -14,8 +14,8 @@ import ( log "github.com/sirupsen/logrus" "github.com/weaveworks/wksctl/pkg/apis/wksprovider/machine/config" "github.com/weaveworks/wksctl/pkg/apis/wksprovider/machine/os" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" machineutil "github.com/weaveworks/wksctl/pkg/cluster/machine" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "github.com/weaveworks/wksctl/pkg/kubernetes/drain" "github.com/weaveworks/wksctl/pkg/plan" "github.com/weaveworks/wksctl/pkg/plan/recipe" @@ -70,7 +70,7 @@ func (r *MachineController) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e contextLog := log.WithField("name", req.NamespacedName) // request only contains the name of the object, so fetch it from the api-server - bmm := &baremetalspecv1.BareMetalMachine{} + bmm := &existinginfrav1.ExistingInfraMachine{} err := r.client.Get(ctx, req.NamespacedName, bmm) if err != nil { if apierrs.IsNotFound(err) { // isn't there; give in @@ -98,22 +98,22 @@ func (r *MachineController) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e } if util.IsPaused(cluster, bmm) { - contextLog.Info("BareMetalMachine or linked Cluster is marked as paused. Won't reconcile") + contextLog.Info("ExistingInfraMachine or linked Cluster is marked as paused. Won't reconcile") return ctrl.Result{}, nil } contextLog = contextLog.WithField("cluster", cluster.Name) - // Now go from the Cluster to the BareMetalCluster + // Now go from the Cluster to the ExistingInfraCluster if cluster.Spec.InfrastructureRef == nil || cluster.Spec.InfrastructureRef.Name == "" { contextLog.Info("Cluster is missing infrastructureRef") return ctrl.Result{}, nil } - bmc := &baremetalspecv1.BareMetalCluster{} + bmc := &existinginfrav1.ExistingInfraCluster{} if err := r.client.Get(ctx, client.ObjectKey{ Namespace: bmm.Namespace, Name: cluster.Spec.InfrastructureRef.Name, }, bmc); err != nil { - contextLog.Info("BareMetalCluster is not available yet") + contextLog.Info("ExistingInfraCluster is not available yet") return ctrl.Result{}, nil } @@ -122,10 +122,10 @@ func (r *MachineController) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e if err != nil { return ctrl.Result{}, err } - // Attempt to Patch the BareMetalMachine object and status after each reconciliation. + // Attempt to Patch the ExistingInfraMachine object and status after each reconciliation. defer func() { if err := patchHelper.Patch(ctx, bmm); err != nil { - contextLog.Errorf("failed to patch BareMetalMachine: %v", err) + contextLog.Errorf("failed to patch ExistingInfraMachine: %v", err) if reterr == nil { reterr = err } @@ -148,7 +148,7 @@ func (r *MachineController) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e return ctrl.Result{}, err } -func (a *MachineController) create(ctx context.Context, installer *os.OS, c *baremetalspecv1.BareMetalCluster, machine *clusterv1.Machine, bmm *baremetalspecv1.BareMetalMachine) error { +func (a *MachineController) create(ctx context.Context, installer *os.OS, c *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, bmm *existinginfrav1.ExistingInfraMachine) error { contextLog := log.WithFields(log.Fields{"machine": machine.Name, "cluster": c.Name}) contextLog.Info("creating machine...") @@ -180,7 +180,7 @@ func (a *MachineController) create(ctx context.Context, installer *os.OS, c *bar return nil } -func (a *MachineController) connectTo(ctx context.Context, c *baremetalspecv1.BareMetalCluster, m *baremetalspecv1.BareMetalMachine) (*os.OS, io.Closer, error) { +func (a *MachineController) connectTo(ctx context.Context, c *existinginfrav1.ExistingInfraCluster, m *existinginfrav1.ExistingInfraMachine) (*os.OS, io.Closer, error) { sshKey, err := a.sshKey(ctx) if err != nil { return nil, nil, gerrors.Wrap(err, "failed to read SSH key") @@ -315,7 +315,7 @@ func (a *MachineController) installNewBootstrapToken(ctx context.Context, ns str } // Delete the machine. If no error is returned, it is assumed that all dependent resources have been cleaned up. -func (a *MachineController) delete(ctx context.Context, c *baremetalspecv1.BareMetalCluster, machine *clusterv1.Machine, bmm *baremetalspecv1.BareMetalMachine) error { +func (a *MachineController) delete(ctx context.Context, c *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, bmm *existinginfrav1.ExistingInfraMachine) error { contextLog := log.WithFields(log.Fields{"machine": machine.Name, "cluster": c.Name}) contextLog.Info("deleting machine ...") @@ -356,7 +356,7 @@ func (a *MachineController) delete(ctx context.Context, c *baremetalspecv1.BareM } // Update the machine to the provided definition. -func (a *MachineController) update(ctx context.Context, c *baremetalspecv1.BareMetalCluster, machine *clusterv1.Machine, bmm *baremetalspecv1.BareMetalMachine) error { +func (a *MachineController) update(ctx context.Context, c *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, bmm *existinginfrav1.ExistingInfraMachine) error { contextLog := log.WithFields(log.Fields{"machine": machine.Name, "cluster": c.Name}) contextLog.Info("updating machine...") installer, closer, err := a.connectTo(ctx, c, bmm) @@ -531,7 +531,7 @@ func (a *MachineController) performActualUpdate( machine *clusterv1.Machine, node *corev1.Node, nodePlan *plan.Plan, - cluster *baremetalspecv1.BareMetalCluster) error { + cluster *existinginfrav1.ExistingInfraCluster) error { if err := drain.Drain(node, a.clientSet, drain.Params{ Force: true, DeleteLocalData: true, @@ -548,7 +548,7 @@ func (a *MachineController) performActualUpdate( return nil } -func (a *MachineController) getNodePlan(ctx context.Context, provider *baremetalspecv1.BareMetalCluster, machine *clusterv1.Machine, machineAddress string, installer *os.OS) (*plan.Plan, error) { +func (a *MachineController) getNodePlan(ctx context.Context, provider *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, machineAddress string, installer *os.OS) (*plan.Plan, error) { namespace := a.controllerNamespace secrets, err := a.kubeadmJoinSecrets(ctx) if err != nil { @@ -641,7 +641,7 @@ func (a *MachineController) getAuthSecrets(ctx context.Context, authConfigMap *v return authSecrets, nil } -func (a *MachineController) getProviderConfigMaps(ctx context.Context, provider *baremetalspecv1.BareMetalCluster) (map[string]*v1.ConfigMap, error) { +func (a *MachineController) getProviderConfigMaps(ctx context.Context, provider *existinginfrav1.ExistingInfraCluster) (map[string]*v1.ConfigMap, error) { fileSpecs := provider.Spec.OS.Files client := a.clientSet.CoreV1().ConfigMaps(a.controllerNamespace) configMaps := map[string]*v1.ConfigMap{} @@ -990,18 +990,18 @@ func (a *MachineController) recordEvent(object runtime.Object, eventType, reason } } -func (a *MachineController) getMachineAddress(m *baremetalspecv1.BareMetalMachine) string { +func (a *MachineController) getMachineAddress(m *existinginfrav1.ExistingInfraMachine) string { return m.Spec.Private.Address } func (a *MachineController) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { controller, err := ctrl.NewControllerManagedBy(mgr). WithOptions(options). - For(&baremetalspecv1.BareMetalMachine{}). + For(&existinginfrav1.ExistingInfraMachine{}). Watches( &source.Kind{Type: &clusterv1.Machine{}}, &handler.EnqueueRequestsFromMapFunc{ - ToRequests: util.MachineToInfrastructureMapFunc(baremetalspecv1.SchemeGroupVersion.WithKind("BareMetalMachine")), + ToRequests: util.MachineToInfrastructureMapFunc(existinginfrav1.SchemeGroupVersion.WithKind("ExistingInfraMachine")), }, ). // TODO: add watch to reconcile all machines that need it @@ -1024,7 +1024,7 @@ type MachineControllerParams struct { Verbose bool } -// NewMachineController creates a new baremetal machine reconciler. +// NewMachineController creates a new existinginfra machine reconciler. func NewMachineController(params MachineControllerParams) (*MachineController, error) { return &MachineController{ client: params.Client, diff --git a/pkg/apis/wksprovider/machine/os/os.go b/pkg/apis/wksprovider/machine/os/os.go index 54c2470e..c8c324f9 100644 --- a/pkg/apis/wksprovider/machine/os/os.go +++ b/pkg/apis/wksprovider/machine/os/os.go @@ -22,8 +22,8 @@ import ( "github.com/weaveworks/wksctl/pkg/apis/wksprovider/controller/manifests" "github.com/weaveworks/wksctl/pkg/apis/wksprovider/machine/config" "github.com/weaveworks/wksctl/pkg/apis/wksprovider/machine/crds" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" "github.com/weaveworks/wksctl/pkg/cluster/machine" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "github.com/weaveworks/wksctl/pkg/plan" "github.com/weaveworks/wksctl/pkg/plan/recipe" "github.com/weaveworks/wksctl/pkg/plan/resource" @@ -292,7 +292,7 @@ func (o OS) CreateSeedNodeSetupPlan(params SeedNodeParams) (*plan.Plan, error) { // TODO(damien): Add a CNI section in cluster.yaml once we support more than one CNI plugin. const cni = "weave-net" - cniAdddon := baremetalspecv1.Addon{Name: cni} + cniAdddon := existinginfrav1.Addon{Name: cni} // we use the namespace defined in addon-namespace map to make weave-net run in kube-system // as weave-net requires to run in the kube-system namespace *only*. @@ -537,7 +537,7 @@ func storeIfNotEmpty(vals map[string]string, key, value string) { } } -func getAPIServerArgs(providerSpec *baremetalspecv1.BareMetalClusterSpec, pemSecretResources map[string]*secretResourceSpec) map[string]string { +func getAPIServerArgs(providerSpec *existinginfrav1.ExistingInfraClusterSpec, pemSecretResources map[string]*secretResourceSpec) map[string]string { result := map[string]string{} authnResourceSpec := pemSecretResources["authentication"] if authnResourceSpec != nil { @@ -574,7 +574,7 @@ func addClusterAPICRDs(b *plan.Builder) ([]string, error) { return crdIDs, nil } -func (o OS) seedNodeSetupPlan(params SeedNodeParams, providerSpec *baremetalspecv1.BareMetalClusterSpec, providerConfigMaps map[string]*v1.ConfigMap, authConfigMap *v1.ConfigMap, secretResources map[string]*secretResourceSpec, kubernetesVersion, kubernetesNamespace string) (*plan.Plan, error) { +func (o OS) seedNodeSetupPlan(params SeedNodeParams, providerSpec *existinginfrav1.ExistingInfraClusterSpec, providerConfigMaps map[string]*v1.ConfigMap, authConfigMap *v1.ConfigMap, secretResources map[string]*secretResourceSpec, kubernetesVersion, kubernetesNamespace string) (*plan.Plan, error) { secrets := map[string]resource.SecretData{} for k, v := range secretResources { secrets[k] = v.decrypted @@ -612,7 +612,7 @@ func (o OS) applySeedNodePlan(p *plan.Plan) error { return err } -func createConfigFileResourcesFromFiles(providerSpec *baremetalspecv1.BareMetalClusterSpec, configDir, namespace string) (map[string][]byte, map[string]*v1.ConfigMap, []*resource.File, error) { +func createConfigFileResourcesFromFiles(providerSpec *existinginfrav1.ExistingInfraClusterSpec, configDir, namespace string) (map[string][]byte, map[string]*v1.ConfigMap, []*resource.File, error) { fileSpecs := providerSpec.OS.Files configMapManifests, err := getConfigMapManifests(fileSpecs, configDir, namespace) if err != nil { @@ -633,7 +633,7 @@ func createConfigFileResourcesFromFiles(providerSpec *baremetalspecv1.BareMetalC return configMapManifests, configMaps, resources, nil } -func createConfigFileResourcesFromConfigMaps(fileSpecs []baremetalspecv1.FileSpec, configMaps map[string]*v1.ConfigMap) ([]*resource.File, error) { +func createConfigFileResourcesFromConfigMaps(fileSpecs []existinginfrav1.FileSpec, configMaps map[string]*v1.ConfigMap) ([]*resource.File, error) { fileResources := make([]*resource.File, len(fileSpecs)) for idx, file := range fileSpecs { source := &file.Source @@ -655,7 +655,7 @@ func createConfigFileResourcesFromConfigMaps(fileSpecs []baremetalspecv1.FileSpe return fileResources, nil } -func getConfigMapManifests(fileSpecs []baremetalspecv1.FileSpec, configDir, namespace string) (map[string][]byte, error) { +func getConfigMapManifests(fileSpecs []existinginfrav1.FileSpec, configDir, namespace string) (map[string][]byte, error) { configMapManifests := map[string][]byte{} for _, fileSpec := range fileSpecs { mapName := fileSpec.Source.ConfigMap @@ -707,7 +707,7 @@ type secretResourceSpec struct { // directory, decrypts it using the GitHub deploy key, creates file // resources for .pem files stored in the secret, and creates a SealedSecret resource // for them that can be used by the machine actuator -func processPemFilesIfAny(builder *plan.Builder, providerSpec *baremetalspecv1.BareMetalClusterSpec, configDir string, ns, privateKeyPath, certPath string) (map[string]*secretResourceSpec, *v1.ConfigMap, []byte, error) { +func processPemFilesIfAny(builder *plan.Builder, providerSpec *existinginfrav1.ExistingInfraClusterSpec, configDir string, ns, privateKeyPath, certPath string) (map[string]*secretResourceSpec, *v1.ConfigMap, []byte, error) { if err := checkPemValues(providerSpec, privateKeyPath, certPath); err != nil { return nil, nil, nil, err } @@ -780,7 +780,7 @@ func getPrivateKey(privateKeyPath string) (*rsa.PrivateKey, error) { return privateKey, nil } -func checkPemValues(providerSpec *baremetalspecv1.BareMetalClusterSpec, privateKeyPath, certPath string) error { +func checkPemValues(providerSpec *existinginfrav1.ExistingInfraClusterSpec, privateKeyPath, certPath string) error { if privateKeyPath == "" || certPath == "" { if providerSpec.Authentication != nil || providerSpec.Authorization != nil { return errors.New("Encryption keys not specified; cannot process authentication and authorization specifications.") @@ -930,7 +930,7 @@ func (o OS) configureFlux(b *plan.Builder, params SeedNodeParams) error { if err != nil { return errors.Wrap(err, "failed to process the git deploy key") } - fluxAddon := baremetalspecv1.Addon{Name: "flux", Params: gitParams} + fluxAddon := existinginfrav1.Addon{Name: "flux", Params: gitParams} manifests, err := buildAddon(fluxAddon, params.ImageRepository, params.ClusterManifestPath, params.GetAddonNamespace("flux")) if err != nil { return errors.Wrap(err, "failed to generate manifests for flux") @@ -1107,8 +1107,8 @@ type NodeParams struct { CertificateKey string // kubeadm's --certificate-key KubeletConfig config.KubeletConfig KubernetesVersion string - CRI baremetalspecv1.ContainerRuntime - ConfigFileSpecs []baremetalspecv1.FileSpec + CRI existinginfrav1.ContainerRuntime + ConfigFileSpecs []existinginfrav1.FileSpec ProviderConfigMaps map[string]*v1.ConfigMap AuthConfigMap *v1.ConfigMap Secrets map[string]resource.SecretData // kind of auth -> names/values as-in v1.Secret @@ -1259,7 +1259,7 @@ func fetchOSID(sshClient *ssh.Client) (string, error) { } // parseCluster converts the manifest file into a Cluster -func parseCluster(clusterManifestPath string) (bmc *baremetalspecv1.BareMetalCluster, err error) { +func parseCluster(clusterManifestPath string) (bmc *existinginfrav1.ExistingInfraCluster, err error) { f, err := os.Open(clusterManifestPath) if err != nil { return nil, err @@ -1303,7 +1303,7 @@ func parseAddons(ClusterManifestPath, namespace string, addonNamespaces map[stri return ret, nil } -func buildAddon(addonDefn baremetalspecv1.Addon, imageRepository string, ClusterManifestPath, namespace string) ([][]byte, error) { +func buildAddon(addonDefn existinginfrav1.Addon, imageRepository string, ClusterManifestPath, namespace string) ([][]byte, error) { log.WithField("addon", addonDefn.Name).Debug("building addon") // Generate the addon manifest. addon, err := addons.Get(addonDefn.Name) diff --git a/pkg/cluster/machine/machine.go b/pkg/cluster/machine/machine.go index 143d67a7..d87f980f 100644 --- a/pkg/cluster/machine/machine.go +++ b/pkg/cluster/machine/machine.go @@ -9,7 +9,7 @@ import ( "github.com/blang/semver" "github.com/pkg/errors" log "github.com/sirupsen/logrus" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "github.com/weaveworks/wksctl/pkg/kubernetes" "github.com/weaveworks/wksctl/pkg/utilities/manifest" "k8s.io/apimachinery/pkg/util/validation/field" @@ -40,8 +40,8 @@ func IsNode(machine *clusterv1.Machine) bool { // FirstMaster scans the provided array of machines and return the first // one which is a "Master" or nil if none. -// Machines and BareMetalMachines must be in the same order -func FirstMaster(machines []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMachine) (*clusterv1.Machine, *baremetalspecv1.BareMetalMachine) { +// Machines and ExistingInfraMachines must be in the same order +func FirstMaster(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) (*clusterv1.Machine, *existinginfrav1.ExistingInfraMachine) { // TODO: validate size and ordering of lists for i, machine := range machines { if IsMaster(machine) { @@ -52,7 +52,7 @@ func FirstMaster(machines []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalM } // ParseManifest parses the provided machines manifest file. -func ParseManifest(file string) (ml []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMachine, err error) { +func ParseManifest(file string) (ml []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine, err error) { f, err := os.Open(file) if err != nil { return nil, nil, err @@ -65,7 +65,7 @@ func ParseManifest(file string) (ml []*clusterv1.Machine, bl []*baremetalspecv1. } // Parse parses the provided machines io.Reader. -func Parse(r io.ReadCloser) (ml []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMachine, err error) { +func Parse(r io.ReadCloser) (ml []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine, err error) { decoder := clusteryaml.NewYAMLDecoder(r) defer decoder.Close() @@ -80,7 +80,7 @@ func Parse(r io.ReadCloser) (ml []*clusterv1.Machine, bl []*baremetalspecv1.Bare switch v := obj.(type) { case *clusterv1.Machine: ml = append(ml, v) - case *baremetalspecv1.BareMetalMachine: + case *existinginfrav1.ExistingInfraMachine: bl = append(bl, v) default: return nil, nil, fmt.Errorf("unexpected type %T", v) @@ -91,7 +91,7 @@ func Parse(r io.ReadCloser) (ml []*clusterv1.Machine, bl []*baremetalspecv1.Bare } // Validate validates the provided machines. -func Validate(machines []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMachine) field.ErrorList { +func Validate(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) field.ErrorList { if len(machines) == 0 { // Some other validations crash on empty list return field.ErrorList{nonFieldError("no machines")} } @@ -109,7 +109,7 @@ func Validate(machines []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMach // Check 1-1 correspondence between lists if len(machines) != len(bl) { - errors = append(errors, nonFieldError("mismatch: %d Machines and %d BareMetalMachines", len(machines), len(bl))) + errors = append(errors, nonFieldError("mismatch: %d Machines and %d ExistingInfraMachines", len(machines), len(bl))) } else { // TODO: what if the user has a mixture of our machines and someone else's? for i, m := range machines { @@ -270,7 +270,7 @@ func Populate(machines []*clusterv1.Machine) { // InvalidMachinesHandler encapsulates logic to apply in case of an invalid // machines manifest being provided. -type InvalidMachinesHandler = func(machines []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMachine, errors field.ErrorList) ([]*clusterv1.Machine, []*baremetalspecv1.BareMetalMachine, error) +type InvalidMachinesHandler = func(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine, errors field.ErrorList) ([]*clusterv1.Machine, []*existinginfrav1.ExistingInfraMachine, error) // NoOpInvalidMachinesHandler does nothing when an invalid machines manifest // is being provided. @@ -280,7 +280,7 @@ var NoOpInvalidMachinesHandler = func(machines []*clusterv1.Machine, errors fiel // ParseAndDefaultAndValidate parses the provided manifest, validates it and // defaults values where possible. -func ParseAndDefaultAndValidate(machinesManifestPath string, errorsHandler InvalidMachinesHandler) ([]*clusterv1.Machine, []*baremetalspecv1.BareMetalMachine, error) { +func ParseAndDefaultAndValidate(machinesManifestPath string, errorsHandler InvalidMachinesHandler) ([]*clusterv1.Machine, []*existinginfrav1.ExistingInfraMachine, error) { machines, bl, err := ParseManifest(machinesManifestPath) if err != nil { return nil, nil, err @@ -305,7 +305,7 @@ func GetKubernetesVersionFromManifest(machinesManifestPath string) (string, stri // GetKubernetesVersionFromMasterIn reads the version of the Kubernetes control // plane from the provided machines. If no version is configured, the default // Kubernetes version will be returned. -func GetKubernetesVersionFromMasterIn(machines []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMachine) (string, string, error) { +func GetKubernetesVersionFromMasterIn(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) (string, string, error) { // Ensures all machines have the same version (either specified or empty): errs := Validate(machines, bl) if len(errs) > 0 { diff --git a/pkg/cluster/machine/machine_test.go b/pkg/cluster/machine/machine_test.go index 83ac4582..cbf8976a 100644 --- a/pkg/cluster/machine/machine_test.go +++ b/pkg/cluster/machine/machine_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" "github.com/weaveworks/wksctl/pkg/cluster/machine" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "github.com/weaveworks/wksctl/pkg/kubernetes" "github.com/weaveworks/wksctl/pkg/utilities/manifest" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -44,7 +44,7 @@ func TestIsNode(t *testing.T) { } func TestFirstMasterInPointersArray(t *testing.T) { - bl := []*baremetalspecv1.BareMetalMachine{nil, nil} + bl := []*existinginfrav1.ExistingInfraMachine{nil, nil} v1, _ := machine.FirstMaster([]*clusterv1.Machine{ &worker, &master, @@ -67,12 +67,12 @@ const machinesValid = ` set: master spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: master-0 version: "1.16.2" --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: master-0 spec: @@ -86,12 +86,12 @@ const machinesValid = ` set: node spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: node-0 version: "1.16.2" --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: node-0 spec: @@ -112,12 +112,12 @@ const machinesInconsistentKubeVersion = ` set: master spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: master-0 version: "1.16.4" --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: master-0 spec: @@ -131,12 +131,12 @@ const machinesInconsistentKubeVersion = ` set: node spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: node-0 version: "1.16.3" --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: node-0 spec: @@ -152,12 +152,12 @@ const machinesUnsupportedKubernetesVersion = ` apiVersion: "cluster.x-k8s.io/v1 set: master spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: master-0 version: "1.13.2" --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: master-0 spec: @@ -171,12 +171,12 @@ const machinesUnsupportedKubernetesVersion = ` apiVersion: "cluster.x-k8s.io/v1 set: node spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: node-0 version: "1.13.2" --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: node-0 spec: @@ -192,19 +192,19 @@ const machinesNoGodNoMaster = ` set: node spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: node-0 version: "1.16.2" --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: node-0 spec: address: "172.17.8.102" ` -func machinesFromString(t *testing.T, s string) ([]*clusterv1.Machine, []*baremetalspecv1.BareMetalMachine) { +func machinesFromString(t *testing.T, s string) ([]*clusterv1.Machine, []*existinginfrav1.ExistingInfraMachine) { r := ioutil.NopCloser(strings.NewReader(s)) machines, bml, err := machine.Parse(r) assert.NoError(t, err) @@ -222,7 +222,7 @@ func fieldsInError(errors field.ErrorList) []string { func TestValidateMachines(t *testing.T) { assert.NoError(t, clusterv1.AddToScheme(scheme.Scheme)) - assert.NoError(t, baremetalspecv1.AddToScheme(scheme.Scheme)) + assert.NoError(t, existinginfrav1.AddToScheme(scheme.Scheme)) tests := []struct { input string @@ -264,11 +264,11 @@ const machinesWithoutVersions = ` set: master spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: master-0 --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: master-0 spec: @@ -282,11 +282,11 @@ const machinesWithoutVersions = ` set: node spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: node-0 --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: node-0 spec: diff --git a/pkg/cluster/machine/machines_manifest.go b/pkg/cluster/machine/machines_manifest.go index 0da83a71..a75d8d47 100644 --- a/pkg/cluster/machine/machines_manifest.go +++ b/pkg/cluster/machine/machines_manifest.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" "github.com/thanhpk/randstr" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/yaml" ) @@ -39,7 +39,7 @@ func UpdateWithGeneratedNames(r io.ReadCloser) (string, error) { namesTaken := readNames(machines) for i := range machines { if machines[i].ObjectMeta.GenerateName != "" { - // TODO: update BareMetalMachine list here too + // TODO: update ExistingInfraMachine list here too if len(bml) > i && bml[i].ObjectMeta.GenerateName != "" { return "", errors.New("generateName not implemented for v1alpha3") } @@ -55,7 +55,7 @@ func UpdateWithGeneratedNames(r io.ReadCloser) (string, error) { return buf.String(), err } -func WriteMachines(w io.Writer, machines []*clusterv1.Machine, bml []*baremetalspecv1.BareMetalMachine) error { +func WriteMachines(w io.Writer, machines []*clusterv1.Machine, bml []*existinginfrav1.ExistingInfraMachine) error { // Need to do this in a loop because we want a stream not an array for _, machine := range machines { manifestBytes, err := yaml.Marshal(machine) diff --git a/pkg/baremetal/doc.go b/pkg/existinginfra/doc.go similarity index 73% rename from pkg/baremetal/doc.go rename to pkg/existinginfra/doc.go index 5088d88f..b672226e 100644 --- a/pkg/baremetal/doc.go +++ b/pkg/existinginfra/doc.go @@ -2,4 +2,4 @@ // +k8s:openapi-gen=true // +k8s:defaulter-gen=TypeMeta -package baremetalproviderspec +package existinginfraproviderspec diff --git a/pkg/baremetal/v1alpha3/doc.go b/pkg/existinginfra/v1alpha3/doc.go similarity index 100% rename from pkg/baremetal/v1alpha3/doc.go rename to pkg/existinginfra/v1alpha3/doc.go diff --git a/pkg/baremetal/v1alpha3/register.go b/pkg/existinginfra/v1alpha3/register.go similarity index 87% rename from pkg/baremetal/v1alpha3/register.go rename to pkg/existinginfra/v1alpha3/register.go index 00947eb2..0f56eb58 100644 --- a/pkg/baremetal/v1alpha3/register.go +++ b/pkg/existinginfra/v1alpha3/register.go @@ -22,10 +22,10 @@ func init() { func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &BareMetalMachine{}, - &BareMetalMachineList{}, - &BareMetalCluster{}, - &BareMetalClusterList{}, + &ExistingInfraMachine{}, + &ExistingInfraMachineList{}, + &ExistingInfraCluster{}, + &ExistingInfraClusterList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/pkg/baremetal/v1alpha3/types.go b/pkg/existinginfra/v1alpha3/types.go similarity index 82% rename from pkg/baremetal/v1alpha3/types.go rename to pkg/existinginfra/v1alpha3/types.go index 4f6520fa..7a89dbcf 100644 --- a/pkg/baremetal/v1alpha3/types.go +++ b/pkg/existinginfra/v1alpha3/types.go @@ -8,15 +8,15 @@ import ( // +groupName=cluster.weave.works // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type BareMetalCluster struct { +type ExistingInfraCluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec BareMetalClusterSpec `json:"spec,omitempty"` - Status BareMetalClusterStatus `json:"status,omitempty"` + Spec ExistingInfraClusterSpec `json:"spec,omitempty"` + Status ExistingInfraClusterStatus `json:"status,omitempty"` } -type BareMetalClusterSpec struct { +type ExistingInfraClusterSpec struct { User string `json:"user"` DeprecatedSSHKeyPath string `json:"sshKeyPath"` HTTPProxy string `json:"httpProxy,omitempty"` @@ -38,15 +38,15 @@ type BareMetalClusterSpec struct { CloudProvider string `json:"cloudProvider,omitempty"` } -type BareMetalClusterStatus struct { +type ExistingInfraClusterStatus struct { Ready bool `json:"ready"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type BareMetalClusterList struct { +type ExistingInfraClusterList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []BareMetalCluster `json:"items"` + Items []ExistingInfraCluster `json:"items"` } type OSConfig struct { @@ -102,30 +102,30 @@ type Addon struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type BareMetalMachine struct { +type ExistingInfraMachine struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec BareMetalMachineSpec `json:"spec,omitempty"` - Status BareMetalMachineStatus `json:"status,omitempty"` + Spec ExistingInfraMachineSpec `json:"spec,omitempty"` + Status ExistingInfraMachineStatus `json:"status,omitempty"` } -type BareMetalMachineSpec struct { +type ExistingInfraMachineSpec struct { Private EndPoint `json:"private,omitempty"` Public EndPoint `json:"public,omitempty"` ProviderID string `json:"providerID,omitempty"` } -type BareMetalMachineStatus struct { +type ExistingInfraMachineStatus struct { Ready bool `json:"ready"` } -// BareMetalMachineList contains a list of Machine +// ExistingInfraMachineList contains a list of Machine // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type BareMetalMachineList struct { +type ExistingInfraMachineList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []BareMetalMachine `json:"items"` + Items []ExistingInfraMachine `json:"items"` } // EndPoint groups the details required to establish a connection. diff --git a/pkg/baremetal/v1alpha3/zz_generated.deepcopy.go b/pkg/existinginfra/v1alpha3/zz_generated.deepcopy.go similarity index 80% rename from pkg/baremetal/v1alpha3/zz_generated.deepcopy.go rename to pkg/existinginfra/v1alpha3/zz_generated.deepcopy.go index 57f17087..642285ee 100644 --- a/pkg/baremetal/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/existinginfra/v1alpha3/zz_generated.deepcopy.go @@ -91,7 +91,7 @@ func (in *AuthorizationWebhook) DeepCopy() *AuthorizationWebhook { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BareMetalCluster) DeepCopyInto(out *BareMetalCluster) { +func (in *ExistingInfraCluster) DeepCopyInto(out *ExistingInfraCluster) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -99,18 +99,18 @@ func (in *BareMetalCluster) DeepCopyInto(out *BareMetalCluster) { out.Status = in.Status } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalCluster. -func (in *BareMetalCluster) DeepCopy() *BareMetalCluster { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExistingInfraCluster. +func (in *ExistingInfraCluster) DeepCopy() *ExistingInfraCluster { if in == nil { return nil } - out := new(BareMetalCluster) + out := new(ExistingInfraCluster) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BareMetalCluster) DeepCopyObject() runtime.Object { +func (in *ExistingInfraCluster) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -118,31 +118,31 @@ func (in *BareMetalCluster) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BareMetalClusterList) DeepCopyInto(out *BareMetalClusterList) { +func (in *ExistingInfraClusterList) DeepCopyInto(out *ExistingInfraClusterList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]BareMetalCluster, len(*in)) + *out = make([]ExistingInfraCluster, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalClusterList. -func (in *BareMetalClusterList) DeepCopy() *BareMetalClusterList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExistingInfraClusterList. +func (in *ExistingInfraClusterList) DeepCopy() *ExistingInfraClusterList { if in == nil { return nil } - out := new(BareMetalClusterList) + out := new(ExistingInfraClusterList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BareMetalClusterList) DeepCopyObject() runtime.Object { +func (in *ExistingInfraClusterList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -150,7 +150,7 @@ func (in *BareMetalClusterList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BareMetalClusterSpec) DeepCopyInto(out *BareMetalClusterSpec) { +func (in *ExistingInfraClusterSpec) DeepCopyInto(out *ExistingInfraClusterSpec) { *out = *in if in.Authentication != nil { in, out := &in.Authentication, &out.Authentication @@ -179,33 +179,33 @@ func (in *BareMetalClusterSpec) DeepCopyInto(out *BareMetalClusterSpec) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalClusterSpec. -func (in *BareMetalClusterSpec) DeepCopy() *BareMetalClusterSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExistingInfraClusterSpec. +func (in *ExistingInfraClusterSpec) DeepCopy() *ExistingInfraClusterSpec { if in == nil { return nil } - out := new(BareMetalClusterSpec) + out := new(ExistingInfraClusterSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BareMetalClusterStatus) DeepCopyInto(out *BareMetalClusterStatus) { +func (in *ExistingInfraClusterStatus) DeepCopyInto(out *ExistingInfraClusterStatus) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalClusterStatus. -func (in *BareMetalClusterStatus) DeepCopy() *BareMetalClusterStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExistingInfraClusterStatus. +func (in *ExistingInfraClusterStatus) DeepCopy() *ExistingInfraClusterStatus { if in == nil { return nil } - out := new(BareMetalClusterStatus) + out := new(ExistingInfraClusterStatus) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BareMetalMachine) DeepCopyInto(out *BareMetalMachine) { +func (in *ExistingInfraMachine) DeepCopyInto(out *ExistingInfraMachine) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -213,18 +213,18 @@ func (in *BareMetalMachine) DeepCopyInto(out *BareMetalMachine) { out.Status = in.Status } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalMachine. -func (in *BareMetalMachine) DeepCopy() *BareMetalMachine { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExistingInfraMachine. +func (in *ExistingInfraMachine) DeepCopy() *ExistingInfraMachine { if in == nil { return nil } - out := new(BareMetalMachine) + out := new(ExistingInfraMachine) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BareMetalMachine) DeepCopyObject() runtime.Object { +func (in *ExistingInfraMachine) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -232,31 +232,31 @@ func (in *BareMetalMachine) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BareMetalMachineList) DeepCopyInto(out *BareMetalMachineList) { +func (in *ExistingInfraMachineList) DeepCopyInto(out *ExistingInfraMachineList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]BareMetalMachine, len(*in)) + *out = make([]ExistingInfraMachine, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalMachineList. -func (in *BareMetalMachineList) DeepCopy() *BareMetalMachineList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExistingInfraMachineList. +func (in *ExistingInfraMachineList) DeepCopy() *ExistingInfraMachineList { if in == nil { return nil } - out := new(BareMetalMachineList) + out := new(ExistingInfraMachineList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BareMetalMachineList) DeepCopyObject() runtime.Object { +func (in *ExistingInfraMachineList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -264,33 +264,33 @@ func (in *BareMetalMachineList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BareMetalMachineSpec) DeepCopyInto(out *BareMetalMachineSpec) { +func (in *ExistingInfraMachineSpec) DeepCopyInto(out *ExistingInfraMachineSpec) { *out = *in out.Private = in.Private out.Public = in.Public } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalMachineSpec. -func (in *BareMetalMachineSpec) DeepCopy() *BareMetalMachineSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExistingInfraMachineSpec. +func (in *ExistingInfraMachineSpec) DeepCopy() *ExistingInfraMachineSpec { if in == nil { return nil } - out := new(BareMetalMachineSpec) + out := new(ExistingInfraMachineSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BareMetalMachineStatus) DeepCopyInto(out *BareMetalMachineStatus) { +func (in *ExistingInfraMachineStatus) DeepCopyInto(out *ExistingInfraMachineStatus) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalMachineStatus. -func (in *BareMetalMachineStatus) DeepCopy() *BareMetalMachineStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExistingInfraMachineStatus. +func (in *ExistingInfraMachineStatus) DeepCopy() *ExistingInfraMachineStatus { if in == nil { return nil } - out := new(BareMetalMachineStatus) + out := new(ExistingInfraMachineStatus) in.DeepCopyInto(out) return out } diff --git a/pkg/plan/recipe/install_plans.go b/pkg/plan/recipe/install_plans.go index e41092f3..6b19d4b7 100644 --- a/pkg/plan/recipe/install_plans.go +++ b/pkg/plan/recipe/install_plans.go @@ -7,7 +7,7 @@ import ( log "github.com/sirupsen/logrus" "github.com/weaveworks/wksctl/pkg/apis/wksprovider/controller/manifests" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "github.com/weaveworks/wksctl/pkg/plan" "github.com/weaveworks/wksctl/pkg/plan/resource" "github.com/weaveworks/wksctl/pkg/utilities/envcfg" @@ -79,7 +79,7 @@ func BuildConfigMapPlan(manifests map[string][]byte, namespace string) plan.Reso } // BuildCRIPlan creates a plan for installing a CRI. Currently, Docker is the only supported CRI -func BuildCRIPlan(criSpec *baremetalspecv1.ContainerRuntime, cfg *envcfg.EnvSpecificConfig, pkgType resource.PkgType) plan.Resource { +func BuildCRIPlan(criSpec *existinginfrav1.ContainerRuntime, cfg *envcfg.EnvSpecificConfig, pkgType resource.PkgType) plan.Resource { b := plan.NewBuilder() // Docker Repo diff --git a/pkg/plan/runners/ssh/ssh.go b/pkg/plan/runners/ssh/ssh.go index 439925f4..c93512eb 100644 --- a/pkg/plan/runners/ssh/ssh.go +++ b/pkg/plan/runners/ssh/ssh.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" - "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "github.com/weaveworks/wksctl/pkg/plan" sshutil "github.com/weaveworks/wksctl/pkg/utilities/ssh" "golang.org/x/crypto/ssh" @@ -36,7 +36,7 @@ var _ plan.Runner = &Client{} const tcp = "tcp" -func NewClientForMachine(m *v1alpha3.BareMetalMachineSpec, user, keyPath string, printOutputs bool) (*Client, error) { +func NewClientForMachine(m *v1alpha3.ExistingInfraMachineSpec, user, keyPath string, printOutputs bool) (*Client, error) { ip := m.Public.Address port := m.Public.Port return NewClient(ClientParams{ diff --git a/pkg/specs/parse_test.go b/pkg/specs/parse_test.go index ba08c628..970e4c6b 100644 --- a/pkg/specs/parse_test.go +++ b/pkg/specs/parse_test.go @@ -2,25 +2,26 @@ package specs import ( "fmt" - "github.com/stretchr/testify/assert" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" "io/ioutil" - "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" "strings" "testing" + + "github.com/stretchr/testify/assert" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" + "k8s.io/client-go/kubernetes/scheme" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" ) const clusterMissingClusterDefinition = ` apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: user: "vagrant" ` -const clusterMissingBareMetalClusterDefinition = ` +const clusterMissingExistingInfraClusterDefinition = ` apiVersion: "cluster.x-k8s.io/v1alpha3" kind: Cluster metadata: @@ -32,7 +33,7 @@ spec: pods: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: - kind: BareMetalCluster + kind: ExistingInfraCluster name: example ` @@ -48,10 +49,10 @@ func parseConfig(s string) (err error) { func TestParseCluster(t *testing.T) { assert.NoError(t, clusterv1.AddToScheme(scheme.Scheme)) - assert.NoError(t, baremetalspecv1.AddToScheme(scheme.Scheme)) - assert.NoError(t, parseConfig(mergeObjects(clusterMissingBareMetalClusterDefinition, clusterMissingClusterDefinition))) + assert.NoError(t, existinginfrav1.AddToScheme(scheme.Scheme)) + assert.NoError(t, parseConfig(mergeObjects(clusterMissingExistingInfraClusterDefinition, clusterMissingClusterDefinition))) // Verify that the objects individually don't result in a successful parse assert.Error(t, parseConfig(clusterMissingClusterDefinition)) - assert.Error(t, parseConfig(clusterMissingBareMetalClusterDefinition)) + assert.Error(t, parseConfig(clusterMissingExistingInfraClusterDefinition)) } diff --git a/pkg/specs/specs.go b/pkg/specs/specs.go index e0662767..33a69f00 100644 --- a/pkg/specs/specs.go +++ b/pkg/specs/specs.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" "github.com/weaveworks/wksctl/pkg/cluster/machine" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "github.com/weaveworks/wksctl/pkg/utilities" "k8s.io/apimachinery/pkg/util/validation/field" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" @@ -20,8 +20,8 @@ import ( type Specs struct { Cluster *clusterv1.Cluster - ClusterSpec *baremetalspecv1.BareMetalClusterSpec - MasterSpec *baremetalspecv1.BareMetalMachineSpec + ClusterSpec *existinginfrav1.ExistingInfraClusterSpec + MasterSpec *existinginfrav1.ExistingInfraMachineSpec machineCount int masterCount int } @@ -36,7 +36,7 @@ func NewFromPaths(clusterManifestPath, machinesManifestPath string) *Specs { } // Get a "Specs" object that can create an SSHClient (and retrieve useful nested fields) -func New(cluster *clusterv1.Cluster, bmc *baremetalspecv1.BareMetalCluster, machines []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMachine) *Specs { +func New(cluster *clusterv1.Cluster, bmc *existinginfrav1.ExistingInfraCluster, machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) *Specs { _, master := machine.FirstMaster(machines, bl) if master == nil { log.Fatal("No master provided in manifest.") @@ -57,7 +57,7 @@ func New(cluster *clusterv1.Cluster, bmc *baremetalspecv1.BareMetalCluster, mach } } -func parseManifests(clusterManifestPath, machinesManifestPath string) (*clusterv1.Cluster, *baremetalspecv1.BareMetalCluster, []*clusterv1.Machine, []*baremetalspecv1.BareMetalMachine, error) { +func parseManifests(clusterManifestPath, machinesManifestPath string) (*clusterv1.Cluster, *existinginfrav1.ExistingInfraCluster, []*clusterv1.Machine, []*existinginfrav1.ExistingInfraMachine, error) { cluster, bmc, err := ParseClusterManifest(clusterManifestPath) if err != nil { return nil, nil, nil, nil, err @@ -71,7 +71,7 @@ func parseManifests(clusterManifestPath, machinesManifestPath string) (*clusterv "%s failed validation, use --skip-validation to force the operation", clusterManifestPath) } - errorsHandler := func(machines []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMachine, errors field.ErrorList) ([]*clusterv1.Machine, []*baremetalspecv1.BareMetalMachine, error) { + errorsHandler := func(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine, errors field.ErrorList) ([]*clusterv1.Machine, []*existinginfrav1.ExistingInfraMachine, error) { if len(errors) > 0 { utilities.PrintErrors(errors) return nil, nil, apierrors.InvalidMachineConfiguration( @@ -89,7 +89,7 @@ func parseManifests(clusterManifestPath, machinesManifestPath string) (*clusterv } // ParseCluster converts the manifest file into a Cluster -func ParseCluster(r io.ReadCloser) (cluster *clusterv1.Cluster, bmc *baremetalspecv1.BareMetalCluster, err error) { +func ParseCluster(r io.ReadCloser) (cluster *clusterv1.Cluster, bmc *existinginfrav1.ExistingInfraCluster, err error) { decoder := clusteryaml.NewYAMLDecoder(r) defer decoder.Close() @@ -104,7 +104,7 @@ func ParseCluster(r io.ReadCloser) (cluster *clusterv1.Cluster, bmc *baremetalsp switch v := obj.(type) { case *clusterv1.Cluster: cluster = v - case *baremetalspecv1.BareMetalCluster: + case *existinginfrav1.ExistingInfraCluster: bmc = v default: return nil, nil, errors.Errorf("unexpected type %T", v) @@ -116,13 +116,13 @@ func ParseCluster(r io.ReadCloser) (cluster *clusterv1.Cluster, bmc *baremetalsp } if bmc == nil { - return nil, nil, errors.New("parsed cluster manifest lacks BareMetalCluster definition") + return nil, nil, errors.New("parsed cluster manifest lacks ExistingInfraCluster definition") } return } -func ParseClusterManifest(file string) (*clusterv1.Cluster, *baremetalspecv1.BareMetalCluster, error) { +func ParseClusterManifest(file string) (*clusterv1.Cluster, *existinginfrav1.ExistingInfraCluster, error) { f, err := os.Open(file) if err != nil { return nil, nil, err @@ -132,7 +132,7 @@ func ParseClusterManifest(file string) (*clusterv1.Cluster, *baremetalspecv1.Bar return ParseCluster(f) } -func TranslateServerArgumentsToStringMap(args []baremetalspecv1.ServerArgument) map[string]string { +func TranslateServerArgumentsToStringMap(args []existinginfrav1.ServerArgument) map[string]string { result := map[string]string{} for _, arg := range args { result[arg.Name] = arg.Value diff --git a/pkg/specs/validation.go b/pkg/specs/validation.go index 896f083a..7b1dbc87 100644 --- a/pkg/specs/validation.go +++ b/pkg/specs/validation.go @@ -7,7 +7,7 @@ import ( "github.com/weaveworks/launcher/pkg/kubectl" "github.com/weaveworks/wksctl/pkg/addons" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "k8s.io/apimachinery/pkg/util/validation/field" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" ) @@ -28,7 +28,7 @@ func populateNetwork(cluster *clusterv1.Cluster) { } } -type clusterValidationFunc func(*clusterv1.Cluster, *baremetalspecv1.BareMetalClusterSpec, string) field.ErrorList +type clusterValidationFunc func(*clusterv1.Cluster, *existinginfrav1.ExistingInfraClusterSpec, string) field.ErrorList func isValidCIDR(s string) (*net.IPNet, error) { ip, cidr, err := net.ParseCIDR(s) @@ -46,7 +46,7 @@ func networksIntersect(n1, n2 *net.IPNet) bool { return n2.Contains(n1.IP) || n1.Contains(n2.IP) } -func validateCIDRBlocks(cluster *clusterv1.Cluster, _ *baremetalspecv1.BareMetalClusterSpec, manifestPath string) field.ErrorList { +func validateCIDRBlocks(cluster *clusterv1.Cluster, _ *existinginfrav1.ExistingInfraClusterSpec, manifestPath string) field.ErrorList { var errors field.ErrorList const ( services = 0 @@ -104,7 +104,7 @@ func validateCIDRBlocks(cluster *clusterv1.Cluster, _ *baremetalspecv1.BareMetal return field.ErrorList{} } -func validateServiceDomain(cluster *clusterv1.Cluster, _ *baremetalspecv1.BareMetalClusterSpec, manifestPath string) field.ErrorList { +func validateServiceDomain(cluster *clusterv1.Cluster, _ *existinginfrav1.ExistingInfraClusterSpec, manifestPath string) field.ErrorList { f := cluster.Spec.ClusterNetwork.ServiceDomain if f != "cluster.local" { return field.ErrorList{ @@ -117,7 +117,7 @@ func validateServiceDomain(cluster *clusterv1.Cluster, _ *baremetalspecv1.BareMe return field.ErrorList{} } -func validateSSHKeyEmpty(_ *clusterv1.Cluster, spec *baremetalspecv1.BareMetalClusterSpec, manifestPath string) field.ErrorList { +func validateSSHKeyEmpty(_ *clusterv1.Cluster, spec *existinginfrav1.ExistingInfraClusterSpec, manifestPath string) field.ErrorList { if spec.DeprecatedSSHKeyPath != "" { return field.ErrorList{ field.Invalid( @@ -136,7 +136,7 @@ func addonPath(i int, args ...string) *field.Path { return clusterProviderPath(allArgs...) } -func validateAddons(_ *clusterv1.Cluster, spec *baremetalspecv1.BareMetalClusterSpec, manifestPath string) field.ErrorList { +func validateAddons(_ *clusterv1.Cluster, spec *existinginfrav1.ExistingInfraClusterSpec, manifestPath string) field.ErrorList { // Addons require kubectl for their manifests to be applied. kubectl := kubectl.LocalClient{} if len(spec.Addons) > 0 && !kubectl.IsPresent() { @@ -178,7 +178,7 @@ func populateCluster(cluster *clusterv1.Cluster) { populateNetwork(cluster) } -func validateCluster(cluster *clusterv1.Cluster, bmc *baremetalspecv1.BareMetalCluster, manifestPath string) field.ErrorList { +func validateCluster(cluster *clusterv1.Cluster, bmc *existinginfrav1.ExistingInfraCluster, manifestPath string) field.ErrorList { var errors field.ErrorList for _, f := range []clusterValidationFunc{ diff --git a/pkg/specs/validation_test.go b/pkg/specs/validation_test.go index 3b201024..82809222 100644 --- a/pkg/specs/validation_test.go +++ b/pkg/specs/validation_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/client-go/kubernetes/scheme" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" @@ -24,11 +24,11 @@ spec: pods: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: - kind: BareMetalCluster + kind: ExistingInfraCluster name: example --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -47,11 +47,11 @@ spec: pods: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: - kind: BareMetalCluster + kind: ExistingInfraCluster name: example --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -73,7 +73,7 @@ spec: serviceDomain: "foo.bar" --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -93,7 +93,7 @@ spec: cidrBlocks: ["192.168.0.0/72"] --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -113,7 +113,7 @@ spec: cidrBlocks: ["10.96.0.0/16"] --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -134,7 +134,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -159,7 +159,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -184,7 +184,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -212,7 +212,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -240,7 +240,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -263,7 +263,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -274,7 +274,7 @@ spec: keytab: /foo ` -func clusterFromString(t *testing.T, s string) (*clusterv1.Cluster, *baremetalspecv1.BareMetalCluster) { +func clusterFromString(t *testing.T, s string) (*clusterv1.Cluster, *existinginfrav1.ExistingInfraCluster) { r := ioutil.NopCloser(strings.NewReader(s)) cluster, bmc, err := ParseCluster(r) assert.NoError(t, err) @@ -292,7 +292,7 @@ func fieldsInError(errors field.ErrorList) []string { func TestValidateCluster(t *testing.T) { assert.NoError(t, clusterv1.AddToScheme(scheme.Scheme)) - assert.NoError(t, baremetalspecv1.AddToScheme(scheme.Scheme)) + assert.NoError(t, existinginfrav1.AddToScheme(scheme.Scheme)) tests := []struct { input string errors []string diff --git a/pkg/utilities/manifest/manifest.go b/pkg/utilities/manifest/manifest.go index 495de054..8bb15fb9 100644 --- a/pkg/utilities/manifest/manifest.go +++ b/pkg/utilities/manifest/manifest.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/pkg/errors" - bmv1alpha3 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + bmv1alpha3 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "gopkg.in/oleiade/reflections.v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,8 +41,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &clusterv1alpha3.MachineList{}, ) scheme.AddKnownTypes(bmv1alpha3.SchemeGroupVersion, - &bmv1alpha3.BareMetalCluster{}, - &bmv1alpha3.BareMetalMachine{}, + &bmv1alpha3.ExistingInfraCluster{}, + &bmv1alpha3.ExistingInfraMachine{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/pkg/utilities/manifest/manifest_test.go b/pkg/utilities/manifest/manifest_test.go index 8f44f32b..c7ce7c41 100644 --- a/pkg/utilities/manifest/manifest_test.go +++ b/pkg/utilities/manifest/manifest_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - baremetalv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" "k8s.io/client-go/kubernetes/scheme" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" ) @@ -144,11 +144,11 @@ spec: cidrBlocks: [192.168.0.0/16] serviceDomain: cluster.local infrastructureRef: - kind: BareMetalCluster + kind: ExistingInfraCluster name: example --- apiVersion: cluster.weave.works/v1alpha3 -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: example spec: @@ -182,11 +182,11 @@ spec: set: master spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: master-0 --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: master-0 spec: @@ -205,11 +205,11 @@ spec: set: node spec: infrastructureRef: - kind: BareMetalMachine + kind: ExistingInfraMachine name: node-0 --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: node-0 spec: @@ -251,7 +251,7 @@ var nstests = []struct { func TestManifestWithNamespace(t *testing.T) { assert.NoError(t, clusterv1.AddToScheme(scheme.Scheme)) - assert.NoError(t, baremetalv1.AddToScheme(scheme.Scheme)) + assert.NoError(t, existinginfrav1.AddToScheme(scheme.Scheme)) for _, tt := range nstests { t.Run(tt.name, func(t *testing.T) { fname := createFile(t, tt.content, tt.fileName).Name() diff --git a/test/integration/container/multimaster_test.go b/test/integration/container/multimaster_test.go index 60975cf1..0abf8061 100644 --- a/test/integration/container/multimaster_test.go +++ b/test/integration/container/multimaster_test.go @@ -32,11 +32,11 @@ spec: serviceDomain: cluster.local infrastructureRef: apiVersion: "cluster.weave.works/v1alpha3" - kind: BareMetalCluster + kind: ExistingInfraCluster name: test-multimaster --- apiVersion: cluster.weave.works/v1alpha3 -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: test-multimaster spec: @@ -82,12 +82,12 @@ const machinesYAML = ` clusterName: test-multimaster infrastructureRef: apiVersion: "cluster.weave.works/v1alpha3" - kind: BareMetalMachine + kind: ExistingInfraMachine name: master-1 bootstrap: {} --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: master-1 spec: @@ -108,12 +108,12 @@ const machinesYAML = ` clusterName: test-multimaster infrastructureRef: apiVersion: "cluster.weave.works/v1alpha3" - kind: BareMetalMachine + kind: ExistingInfraMachine name: master-2 bootstrap: {} --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: master-2 spec: @@ -134,12 +134,12 @@ const machinesYAML = ` clusterName: test-multimaster infrastructureRef: apiVersion: "cluster.weave.works/v1alpha3" - kind: BareMetalMachine + kind: ExistingInfraMachine name: master-3 bootstrap: {} --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: master-3 spec: @@ -160,12 +160,12 @@ const machinesYAML = ` clusterName: test-multimaster infrastructureRef: apiVersion: "cluster.weave.works/v1alpha3" - kind: BareMetalMachine + kind: ExistingInfraMachine name: worker-1 bootstrap: {} --- apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalMachine" + kind: "ExistingInfraMachine" metadata: name: worker-1 spec: diff --git a/test/integration/test/apply_test.go b/test/integration/test/apply_test.go index 41c7a9ae..9e82ded0 100644 --- a/test/integration/test/apply_test.go +++ b/test/integration/test/apply_test.go @@ -19,7 +19,7 @@ import ( "github.com/weaveworks/wksctl/pkg/plan/runners/ssh" "github.com/weaveworks/wksctl/pkg/specs" - baremetalspecv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3" + existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3" spawn "github.com/weaveworks/wksctl/test/integration/spawn" "github.com/stretchr/testify/assert" @@ -67,22 +67,22 @@ func setLabel(role role) string { } } -func appendMachine(t *testing.T, ordinal int, ml *[]*clusterv1.Machine, bl *[]*baremetalspecv1.BareMetalMachine, clusterName, role role, publicIP, privateIP string) { +func appendMachine(t *testing.T, ordinal int, ml *[]*clusterv1.Machine, bl *[]*existinginfrav1.ExistingInfraMachine, clusterName, role role, publicIP, privateIP string) { name := generateName(role, ordinal) - spec := baremetalspecv1.BareMetalMachine{ + spec := existinginfrav1.ExistingInfraMachine{ TypeMeta: metav1.TypeMeta{ APIVersion: "cluster.weave.works/v1alpha3", - Kind: "BareMetalMachine", + Kind: "ExistingInfraMachine", }, ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: baremetalspecv1.BareMetalMachineSpec{ - Public: baremetalspecv1.EndPoint{ + Spec: existinginfrav1.ExistingInfraMachineSpec{ + Public: existinginfrav1.EndPoint{ Address: publicIP, Port: 22, }, - Private: baremetalspecv1.EndPoint{ + Private: existinginfrav1.EndPoint{ Address: privateIP, Port: 22, }}, @@ -122,7 +122,7 @@ func appendMachine(t *testing.T, ordinal int, ml *[]*clusterv1.Machine, bl *[]*b // numMachines is the number of machines to use. It can be less than the number // of provisionned terraform machines. -1 means use all machines setup by // terraform. The minimum number of machines to use is 2. -func makeMachinesFromTerraform(t *testing.T, clusterName string, terraform *terraformOutput, numMachines int) (ml []*clusterv1.Machine, bl []*baremetalspecv1.BareMetalMachine) { +func makeMachinesFromTerraform(t *testing.T, clusterName string, terraform *terraformOutput, numMachines int) (ml []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) { publicIPs := terraform.stringArrayVar(keyPublicIPs) privateIPs := terraform.stringArrayVar(keyPrivateIPs) assert.True(t, len(publicIPs) >= 2) // One master and at least one node @@ -149,7 +149,7 @@ func makeMachinesFromTerraform(t *testing.T, clusterName string, terraform *terr return ml, bl } -func writeYamlManifests(t *testing.T, path string, machines []*clusterv1.Machine, bml []*baremetalspecv1.BareMetalMachine) { +func writeYamlManifests(t *testing.T, path string, machines []*clusterv1.Machine, bml []*existinginfrav1.ExistingInfraMachine) { var buf bytes.Buffer err := machine.WriteMachines(&buf, machines, bml) assert.NoError(t, err) @@ -183,7 +183,7 @@ func setKubernetesVersion(l []*clusterv1.Machine, version string) { } } -func parseClusterManifest(t *testing.T, file string) (*clusterv1.Cluster, *baremetalspecv1.BareMetalCluster) { +func parseClusterManifest(t *testing.T, file string) (*clusterv1.Cluster, *existinginfrav1.ExistingInfraCluster) { f, err := os.Open(file) assert.NoError(t, err) cluster, bmCluster, err := specs.ParseCluster(f) @@ -364,7 +364,7 @@ func writeTmpFile(runner *ssh.Client, inputFilename, outputFilename string) erro func TestApply(t *testing.T) { assert.NoError(t, clusterv1.AddToScheme(scheme.Scheme)) - assert.NoError(t, baremetalspecv1.AddToScheme(scheme.Scheme)) + assert.NoError(t, existinginfrav1.AddToScheme(scheme.Scheme)) clusterManifestPath := configPath("cluster.yaml") _, c := parseClusterManifest(t, clusterManifestPath) diff --git a/test/integration/test/assets/cluster.yaml b/test/integration/test/assets/cluster.yaml index cd9cc94c..b8498e97 100644 --- a/test/integration/test/assets/cluster.yaml +++ b/test/integration/test/assets/cluster.yaml @@ -11,11 +11,11 @@ spec: serviceDomain: "cluster.local" infrastructureRef: apiVersion: "cluster.weave.works/v1alpha3" - kind: BareMetalCluster + kind: ExistingInfraCluster name: integration-tests --- apiVersion: "cluster.weave.works/v1alpha3" -kind: "BareMetalCluster" +kind: "ExistingInfraCluster" metadata: name: integration-tests spec: From 8dfd8da5b4aaf6973db4fda312ee511f28ac268c Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 24 Jun 2020 14:52:33 +0000 Subject: [PATCH 2/5] Update vfsdata files Signed-off-by: Dennis Marttinen --- .../controller/manifests/manifests_vfsdata.go | 4 ++-- .../wksprovider/machine/crds/crds_vfsdata.go | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/apis/wksprovider/controller/manifests/manifests_vfsdata.go b/pkg/apis/wksprovider/controller/manifests/manifests_vfsdata.go index 46e99f69..f92c6ab7 100644 --- a/pkg/apis/wksprovider/controller/manifests/manifests_vfsdata.go +++ b/pkg/apis/wksprovider/controller/manifests/manifests_vfsdata.go @@ -31,9 +31,9 @@ var Manifests = func() http.FileSystem { "/02_rbac.yaml": &vfsgen۰CompressedFileInfo{ name: "02_rbac.yaml", modTime: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), - uncompressedSize: 3925, + uncompressedSize: 3941, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x56\xb1\x72\xdb\x30\x0c\xdd\xf5\x15\xbc\x64\xc8\x5d\xef\xa4\x5c\xb7\x9e\xb6\xb6\x43\x87\x6e\x49\xae\x9d\x21\x0a\xb6\x58\x53\x24\x4b\x80\x76\xd2\xaf\xef\x89\xb2\x14\x29\x92\x1d\x3b\x89\x53\x77\x32\x08\x83\xc4\x03\x08\x3e\xbd\x34\x4d\x13\x70\xea\x07\x7a\x52\xd6\xe4\xc2\x17\x20\x33\x08\x5c\x59\xaf\xfe\x00\x2b\x6b\xb2\xd5\x27\xca\x94\xbd\x5e\x7f\x4c\x56\xca\x94\xb9\xf8\xaa\x03\x31\xfa\x1b\xab\x31\xa9\x91\xa1\x04\x86\x3c\x11\xc2\x40\x8d\xb9\xd8\xac\x28\x95\xd6\xb0\xb7\x5a\xa3\x4f\x7d\x13\xe5\x83\x46\xca\x93\x54\x80\x53\xdf\xbc\x0d\x8e\x9a\xf8\x54\xc8\xf6\xa4\xec\x3e\x6d\x73\x24\x42\x78\x24\x1b\xbc\xc4\x71\x04\xc5\x45\x0d\xb2\x52\x06\xc7\x8b\x6b\x62\xe0\x30\xf2\x95\xe8\xb4\x7d\xa8\xd1\xf0\x38\x14\xe3\x7a\x8d\xbe\xd8\x9e\xbe\x44\x8e\xbf\x5a\x51\x6b\x6c\x80\x65\xb5\x1b\xe7\x06\x61\x8d\xd9\xc6\xfa\x15\x4d\xa1\x16\xe0\xb1\x69\x87\x1e\x61\x9e\x78\x87\x78\xfb\x3f\x47\x95\x4d\xbc\x8f\x5b\x9e\xc7\x1e\xe1\x7a\x04\xc6\x68\x06\x57\x76\xa6\xeb\xff\x2f\x51\x23\xe3\xb4\xcc\x8b\x8b\xa7\x55\x5d\x0a\x67\x4b\xba\xc6\xb5\x92\xcd\x28\x08\x45\xc2\xe3\xef\xa0\x3c\x96\x62\x61\xbd\xe0\x0a\xc5\xcf\xef\xb7\xe2\xf1\xc2\x05\x5b\x51\xa0\x80\x42\x63\x63\xc6\x9d\xf1\x90\x78\x5a\x70\xd6\x74\xd7\xd1\xc2\x50\xd6\x50\xd6\xe2\x1b\x66\xea\x3d\xd1\x30\xb6\xdc\xf6\x06\xd7\xfd\xad\x12\x4a\x7f\xe8\x8d\xbe\x6d\x57\xd2\xa6\xde\x85\x5a\xd6\xe0\xf6\xa5\xbf\x14\x77\x15\x8a\x02\xb5\xdd\x1c\xdf\xb8\x16\x8d\x28\x01\x6b\x6b\xe2\xe4\xee\xee\xde\x04\x32\x38\x37\x33\xa0\x83\xb3\x66\x41\x77\x0d\x78\x15\x23\x7c\x51\xa6\x54\x66\x79\x18\x31\x14\xdb\xe0\xc6\xbe\xc1\x45\x13\xdb\x55\xb2\x27\x6f\x22\xc4\x94\x88\xf6\xd1\x0f\x85\xe2\x17\x4a\x8e\x0c\xd4\xee\xbc\x45\xbf\x56\x12\x3f\x4b\x69\x83\xe1\x7e\x73\x89\x0b\x08\xba\x5b\x93\x03\x89\xb9\xa0\x07\x62\xac\x5f\xd9\x96\x51\x3f\xe2\x24\x2a\x6b\xee\x54\x8d\xc4\x50\xbb\x5c\x98\xa0\x75\x0f\xa3\x06\x03\xcb\xe7\xb8\x13\x9c\xc2\x7b\x46\x43\x71\x06\x76\xf2\x67\x20\xb6\x75\xe7\x2c\x71\xa1\x8c\x8a\x53\xf3\x32\x22\x2c\xac\x65\x62\x0f\x2e\x9b\xa1\xee\xb4\x9b\x66\xa7\xc1\xe0\x7c\x84\x32\x0b\x0f\xc4\x3e\x48\x0e\x7e\x36\xe6\x49\x01\x57\x1f\xae\xc6\x50\x07\xcf\x78\x3b\xb0\xb3\x05\x3c\xbe\xeb\xc1\x63\x7f\x59\x55\x78\xef\xb2\xe7\x71\xff\x9f\xb5\x9d\x25\xe6\x23\x65\xc1\xf4\xcb\xfa\xaf\xe1\xed\xd7\x21\x03\xf7\xd9\x41\xae\x10\x34\x57\xb2\x42\xb9\xa2\x5d\xfe\xc3\xe4\xc8\x49\xe0\xed\x92\x7e\x67\xd2\xbd\xed\xb7\x75\xb4\x7e\x2f\x90\x73\x32\xa5\x57\x4b\xf3\xa9\xf7\xe4\x3b\x22\x49\x27\xce\xde\xbf\xbc\x59\x05\xf8\xaa\xfa\x1a\xaa\x3f\x0f\x0e\x3c\x0c\xc9\x76\xce\x9c\xb5\x9a\x26\x8e\x53\x4d\xde\x9b\xeb\xc3\x63\xf4\xd0\x09\x24\xe3\x48\x6e\xbd\x89\x56\xfc\x1b\x00\x00\xff\xff\x56\x94\x63\x3a\x55\x0f\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x56\x3d\x73\xdb\x30\x0c\xdd\xfd\x2b\x78\xc9\x90\xbb\xde\x49\xb9\x6e\x3d\x6d\x6d\x87\x0e\xdd\x92\x5c\x3b\x43\x14\x6c\xb1\xa6\x08\x96\x00\x6d\xa7\xbf\xbe\x27\xca\x72\xac\x58\x76\xec\x7c\xd5\x9d\x4c\x42\x20\xf1\x1e\x04\x3d\xbf\x2c\xcb\x26\xe0\xcd\x0f\x0c\x6c\xc8\x15\x2a\x94\xa0\x73\x88\x52\x53\x30\x7f\x40\x0c\xb9\x7c\xfe\x89\x73\x43\xd7\x8b\x8f\x93\xb9\x71\x55\xa1\xbe\xda\xc8\x82\xe1\x86\x2c\x4e\x1a\x14\xa8\x40\xa0\x98\x28\xe5\xa0\xc1\x42\x2d\xe7\x9c\x69\x72\x12\xc8\x5a\x0c\x59\x68\xb3\x42\xb4\xc8\xc5\x24\x53\xe0\xcd\xb7\x40\xd1\x73\x9b\x9f\x29\xdd\xdd\x94\xaf\xb2\xae\xc6\x44\xa9\x80\x4c\x31\x68\x1c\x66\x70\xda\x34\xa0\x6b\xe3\x70\xb8\xb9\x66\x01\x89\x83\x58\x85\xde\xd2\x7d\x83\x4e\x86\xa9\x98\xf6\x0b\x0c\xe5\xfa\xf6\x19\x4a\xfa\xb5\x86\xbb\xc5\x12\x44\xd7\xfb\x71\x2e\x11\x16\x98\x2f\x29\xcc\x79\x17\x2a\xae\x0c\x8b\x71\x33\xe3\xa6\x01\x06\xb8\x47\x9f\x6c\xe3\x1e\x24\x0c\x58\x8e\x3e\x79\x38\xfa\x34\x97\x04\x3f\x20\x08\xa6\x65\xf4\x55\xbf\xf4\x9b\xe7\x15\x5a\x14\xdc\xa5\x7d\x71\xf1\x98\xe5\xa5\xf2\x54\xf1\x35\x2e\x8c\x6e\x47\x43\x19\x56\x01\x7f\x47\x13\xb0\x52\x53\x0a\x4a\x6a\x54\x3f\xbf\xdf\xaa\x87\x01\x50\x42\xaa\x44\x05\xa5\xc5\x76\x99\x4e\xa6\x4b\xd2\x6d\xd1\x93\xeb\x5f\x4f\x07\xc3\x90\xe3\xbc\xc3\xb7\x5d\x69\x13\x49\x0b\x47\x55\xdf\x9f\xc5\xe6\x2d\x33\xea\x70\xec\x1b\x7e\xdd\xae\x64\x2d\xdf\xa9\x99\x35\xe0\x0f\x95\xbf\x54\x77\x35\xaa\x12\x2d\x2d\x4f\x6f\x5c\x87\x46\x55\x80\x0d\xb9\x34\xc9\xfb\xbb\xb7\x03\x19\xbc\x1f\x19\xd8\xad\xbb\x46\x41\xf7\x0d\x78\x91\x42\x7c\x31\xae\x32\x6e\x76\x9c\x50\x94\xeb\xe4\x76\x7d\x83\xd3\x36\xb7\x67\x72\xa0\xee\x44\xa9\x5d\x61\x3a\x24\x47\x1c\xcb\x5f\xa8\x25\x29\x52\x77\xf2\x16\xc3\xc2\x68\xfc\xac\x35\x45\x27\x9b\xc3\x15\x4e\x21\xda\x7e\xcf\x1e\x34\x16\x8a\xef\x59\xb0\x79\x61\x5b\x06\xfd\x48\x93\x68\xc8\xdd\x99\x06\x59\xa0\xf1\x85\x72\xd1\xda\x0d\x8c\x06\x1c\xcc\x9e\xd2\x52\xf0\x06\x57\x82\x8e\xd3\x0c\xec\xd5\xd3\xc8\x42\x4d\x1f\xac\x70\x6a\x9c\x49\x53\xf3\x3c\x61\x2c\x89\x84\x25\x80\xcf\x47\xa4\x3c\xeb\xa7\xd9\x5b\x70\x38\x9e\x91\x74\x8d\x25\x44\x2d\x31\x8c\xe6\x3c\x22\x70\xf5\xe1\x6a\x08\x75\xeb\x33\x5e\x0f\xec\x28\x81\x87\xef\x7a\xeb\x63\x7f\x1e\x2b\x5c\xf9\xfc\x69\xdc\xff\x27\xb7\xb3\xc4\x7c\xa2\x4d\xd8\xfd\x87\xfd\xd7\xf0\x0e\xfb\x92\xad\xf0\xd9\x41\xae\x11\xac\xd4\xba\x46\x3d\xe7\x7d\xf1\xe3\xec\xc8\x9b\xc0\xdb\x67\x05\xcf\xa4\x7b\xeb\xff\xd6\xc1\xfe\xbd\x40\x8e\xd9\x94\x8d\x5b\x1a\x2f\x7d\xa0\xde\x09\x45\x7a\x73\xf6\xfe\xf4\x46\x1d\xe0\x8b\xf8\xb5\x52\x7f\x1e\x1a\x78\x1c\x92\xf5\x9c\x79\x22\xcb\x3b\x81\xb7\x9a\xbc\x57\xf7\x87\xa7\xf8\xa1\x37\xb0\x8c\x03\xbb\xf5\x2a\x5e\xf1\x6f\x00\x00\x00\xff\xff\xc4\x9b\x85\x6a\x65\x0f\x00\x00"), }, "/03_secrets.yaml": &vfsgen۰FileInfo{ name: "03_secrets.yaml", diff --git a/pkg/apis/wksprovider/machine/crds/crds_vfsdata.go b/pkg/apis/wksprovider/machine/crds/crds_vfsdata.go index 51ed950b..a72812b0 100644 --- a/pkg/apis/wksprovider/machine/crds/crds_vfsdata.go +++ b/pkg/apis/wksprovider/machine/crds/crds_vfsdata.go @@ -23,19 +23,19 @@ var CRDs = func() http.FileSystem { name: "/", modTime: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), }, - "/cluster.weave.works_baremetalclusters.yaml": &vfsgen۰CompressedFileInfo{ - name: "cluster.weave.works_baremetalclusters.yaml", + "/cluster.weave.works_existinginfraclusters.yaml": &vfsgen۰CompressedFileInfo{ + name: "cluster.weave.works_existinginfraclusters.yaml", modTime: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), - uncompressedSize: 5349, + uncompressedSize: 5369, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x58\xcd\x92\xdb\x36\x0c\xbe\xeb\x29\x30\xe9\x21\x97\x5a\x4e\x26\x97\x8e\x6f\xdb\x6d\x3a\x93\xc9\xcf\xec\x64\xb7\xdb\x43\xa7\x07\x98\x84\x2d\xd6\x14\xc9\x82\xa4\xb3\x9b\xa7\xef\x90\x92\x6c\xaf\xf5\x63\x7b\x77\xda\x43\x79\x12\x41\x12\xf8\xf8\x01\x02\x20\x15\xb3\xd9\xac\x40\xa7\xee\x89\xbd\xb2\x66\x01\xe8\x14\x3d\x04\x32\x69\xe6\xcb\xcd\x4f\xbe\x54\x76\xbe\x7d\xbb\xa4\x80\x6f\x8b\x8d\x32\x72\x01\xd7\xd1\x07\x5b\x7f\x25\x6f\x23\x0b\xfa\x85\x56\xca\xa8\xa0\xac\x29\x6a\x0a\x28\x31\xe0\xa2\x00\x40\x63\x6c\xc0\x24\xf6\x69\x0a\x20\xac\x09\x6c\xb5\x26\x9e\xad\xc9\x94\x9b\xb8\xa4\x65\x54\x5a\x12\x67\x0b\x9d\xfd\xed\x9b\xf2\x5d\xf9\xa6\x00\x10\x4c\xf9\xf8\x9d\xaa\xc9\x07\xac\xdd\x02\x4c\xd4\xba\x00\x30\x58\xd3\x02\x96\xc8\x94\x0c\x6a\xa1\xa3\x0f\xc4\xbe\x6c\x1f\xca\x6f\x84\x5b\x2a\xbf\x59\xde\xf8\x02\x40\xe3\x92\x74\x87\xa1\xdd\xf1\x30\xdb\x5d\x0c\xb5\xab\xf0\xdd\x02\xba\xa7\xc2\x3b\x12\x69\xf7\x9a\x6d\x74\x0b\x18\x56\x9a\x20\xb4\x3a\x1b\x4e\x7e\x46\xa6\xcf\x09\xcd\x75\xb3\x3f\x2f\x69\xe5\xc3\xc7\xc1\xe5\x4f\xca\x87\xbc\xc5\xe9\xc8\xa8\x07\x6e\x93\x57\xbd\x32\xeb\xa8\x91\xfb\xeb\x05\x80\x17\xd6\xd1\x02\xbe\x24\x28\x0e\x05\xc9\x02\x60\x8b\x5a\xc9\x4c\x5b\x03\xce\x3a\x32\x57\x37\x1f\xee\xdf\xdd\x8a\x8a\x6a\x6c\x84\x00\x8e\xad\x23\x0e\xaa\xbb\x43\x1a\x07\x41\xb0\x93\x01\x48\xf2\x82\x95\xcb\x1a\xe1\x75\x52\xd5\xec\x01\x99\xdc\x4e\x1e\x42\x45\xd0\x3a\x8f\x24\xf8\x6c\x06\xec\x0a\x42\xa5\x3c\x30\x39\x26\x4f\xa6\x09\x84\x03\xb5\x90\xb6\xa0\x01\xbb\xfc\x8b\x44\x28\xe1\x96\x38\x29\x01\x5f\xd9\xa8\x65\x8a\x95\x2d\x71\x00\x26\x61\xd7\x46\x7d\xdf\x69\xf6\x10\x6c\x36\xa9\x31\x50\x4b\x61\x37\x94\x09\xc4\x06\x75\x22\x21\xd2\x8f\x80\x46\x42\x8d\x8f\xc0\x94\x6c\x40\x34\x07\xda\xf2\x16\x5f\xc2\x67\xcb\x04\xca\xac\xec\x02\xaa\x10\x9c\x5f\xcc\xe7\x6b\x15\xba\xb0\x17\xb6\xae\xa3\x51\xe1\x71\x9e\x83\x57\x2d\x63\xb0\xec\xe7\x92\xb6\xa4\xe7\x5e\xad\x67\xc8\xa2\x52\x81\x44\x88\x4c\x73\x74\x6a\x96\x81\x9b\x1c\xf5\x65\x2d\x7f\xe0\xf6\x1d\xf1\xaf\x0f\x90\x86\xc7\xe4\x36\x1f\x58\x99\xf5\x4e\x9c\xa3\x68\x94\xf7\x14\x44\xa0\x3c\x60\x7b\xac\xc1\xbf\xa7\x37\x89\x12\x2b\x5f\xdf\xdf\xde\x41\x67\x34\xbb\xe0\x29\xe7\x99\xed\xfd\x31\xbf\x27\x3e\x11\xa5\xcc\x8a\xb8\x71\xdc\x8a\x6d\x9d\x35\x92\x91\xce\x2a\x13\xf2\x44\x68\x45\xe6\x29\xe9\x3e\x2e\x6b\x15\x92\xa7\xff\x8e\xe4\x43\xf2\x4f\x09\xd7\xf9\xe5\x87\x25\x41\x74\x12\x03\xc9\x12\x3e\x18\xb8\xc6\x9a\xf4\x35\x7a\xfa\xd7\x69\x4f\x0c\xfb\x59\xa2\xf4\x34\xf1\x87\x39\xeb\xe9\xc6\x86\xad\x9d\xb8\xcb\x0b\xdd\x18\x7a\x87\xf2\x7b\x24\xe5\x2e\xe7\x1d\x04\x67\xa0\xba\x27\x3c\x72\xf3\x55\x3a\xd9\x8a\x96\xe4\xd3\xfb\x91\x95\xa5\x98\x57\xc6\x07\xd4\x1a\xd2\x2c\x7b\xa2\xc9\x4a\x3d\x85\x63\xa8\x3a\x73\x6e\x50\x3e\x8a\x6f\x82\xb8\xfe\x06\x64\xc6\xc7\x81\xf5\x9c\xaf\x27\xce\x8d\x2a\x76\xc8\x38\x86\x0a\xa5\xcc\x45\x07\xf5\xcd\xe4\x95\x2f\xc0\x7f\xe4\xf0\x6e\xa4\xd0\x56\x4c\xb2\xaf\x7d\x96\xaf\xd6\x13\x4f\x68\x1b\x23\x0a\x9d\x6a\xde\xc4\x63\x23\x53\xfe\xdc\x53\x70\x7b\xf5\x65\xf0\xf2\x13\x5e\x3d\xc1\xc9\x94\x47\xe9\x21\x30\x5e\xf1\x3a\xd6\x29\x87\x5c\x68\x77\x3a\x40\x61\x32\x5c\xce\xc0\x9d\x46\x4e\x8e\x2f\xd0\x30\xee\x70\x18\x77\x7a\xb3\x94\x4d\x5f\x1e\x62\x53\x7c\x8f\x1e\xc4\x18\xaa\x94\xf4\x44\x2e\xae\xbf\xd3\xb2\xb2\x76\x73\x49\xfc\x08\x14\x15\xdd\xdd\x7d\x1a\xba\xe7\x24\x49\x9e\x04\x53\xf8\x55\xe9\x41\x96\x27\x8f\x46\xd6\x17\x9e\x19\xf3\xc6\xec\x00\x46\x6f\x29\xb2\xbe\x84\x46\xcb\xea\xfb\x8b\x58\xbc\x6a\x95\x90\x7c\x0e\x9f\x59\xc5\x6f\x06\x5f\xa4\xe4\x7f\xe5\x14\xa1\x6d\x94\x37\x6c\xb7\x4a\xf6\x73\xe2\x28\xae\xf6\x13\xe3\x46\xa3\xa1\xf7\x6d\xe3\x72\xfe\x61\x56\x97\xb8\xfd\xb8\x61\x3b\xa9\x3f\x2b\x44\xb1\xc1\xf5\xe5\x0e\xda\xf6\x1b\xf3\x33\xce\x8d\x3b\x29\x81\xef\x09\x5b\x70\x3d\x79\x6b\xfc\x5c\xd7\xa5\x86\xee\x86\xed\xc3\xe3\xd9\xcc\xab\x1a\xd7\xf4\x95\x9c\xf5\x2a\x58\x3e\xff\x5c\xfa\x84\xd4\x14\x46\x2b\xd1\x48\x15\x9a\xae\x40\xcf\x6e\x56\x26\xaa\xce\xe4\xc9\x8b\xdb\x8b\xb1\x2a\xf3\x8c\xb6\xc3\xf6\x28\x98\x22\x67\xa5\xf4\x30\x67\x2f\x2a\xf7\x92\x7c\x50\xe6\xe0\x9b\x75\x68\x9c\x51\xf5\x9b\x8f\x9e\x71\x15\xa7\x91\x40\x93\x42\x56\x6a\x5d\xa3\x9b\xda\x74\x16\x9e\x34\x36\xd4\x8b\xe6\x67\xe8\x99\xee\x47\x20\x87\xc4\x0e\xf7\xc4\x9e\x0d\x0d\x75\xe7\x87\x40\x46\xdb\x93\xd3\x4d\xd1\x81\x1b\x47\x76\x34\x0e\xfa\x8f\x9a\x23\xef\xab\x8f\xf4\x78\x83\xa1\x3a\x3b\x9d\x44\x7f\x76\xa9\x19\x22\x63\x96\x2a\xc8\x93\xf9\x1e\xc3\x13\x71\xb2\x53\x9c\xb8\x82\x0f\x18\xa2\x3f\xe7\x73\x93\x09\xe5\x48\xca\x5c\x5a\xab\x09\xcd\x49\xdc\x59\xc5\x34\xa2\x23\xd1\xfe\x6f\x5d\xf7\xd7\x6c\x27\xcb\xf0\x66\xed\x3f\xba\x83\xe5\xd4\xa0\xf0\x96\xe4\x02\x02\xb7\xc9\xcb\x07\xcb\xa9\x1a\x36\x92\xfd\x95\x51\x08\x72\x81\xe4\x97\xe3\x9f\x6c\xaf\x5e\xe5\x49\xf7\xcf\x2c\x4f\x85\x35\xcd\x57\x90\x5f\xc0\x1f\x7f\x16\x8d\x56\x92\xf7\x1d\x9a\x24\xfc\x27\x00\x00\xff\xff\x80\x82\x2d\xe7\xe5\x14\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x58\xcd\x8e\x1b\x37\x0c\xbe\xcf\x53\x10\xe9\x21\x97\x7a\x9c\x20\x97\xc2\xb7\xc5\x36\x05\x82\xa4\xc1\x22\xbb\x4d\x0f\x45\x0f\xb4\x44\xcf\xa8\xd6\x48\x2a\x25\x39\xbb\x79\xfa\x42\x9a\x19\xdb\xbb\xf3\x63\x7b\x17\xed\xa1\x3a\x59\x34\x49\x7d\xfa\x48\x51\xd4\x14\x8b\xc5\xa2\x40\xa7\xbe\x12\x7b\x65\xcd\x0a\xd0\x29\xba\x0f\x64\xd2\xcc\x97\xdb\x9f\x7c\xa9\xec\x72\xf7\x76\x4d\x01\xdf\x16\x5b\x65\xe4\x0a\xae\xa3\x0f\xb6\xf9\x42\xde\x46\x16\xf4\x33\x6d\x94\x51\x41\x59\x53\x34\x14\x50\x62\xc0\x55\x01\x80\xc6\xd8\x80\x49\xec\xd3\x14\x40\x58\x13\xd8\x6a\x4d\xbc\xa8\xc8\x94\xdb\xb8\xa6\x75\x54\x5a\x12\xe7\x15\xfa\xf5\x77\x6f\xca\x77\xe5\x9b\x02\x40\x30\x65\xf3\x3b\xd5\x90\x0f\xd8\xb8\x15\x98\xa8\x75\x01\x60\xb0\xa1\x15\xd0\xbd\xf2\x41\x99\x4a\x99\x0d\xa3\xd0\xd1\x07\x62\x5f\x76\x3f\xca\x6f\x84\x3b\x2a\xbf\x59\xde\xfa\x02\x40\xe3\x9a\x74\x8f\xa3\xd3\xb8\x5f\xec\x37\x87\xda\xd5\xf8\x6e\x05\xfd\xaf\xc2\x3b\x12\x49\xbb\x62\x1b\xdd\x0a\xc6\x9d\x26\x18\x9d\xcf\x96\x97\xf7\x1d\xa2\x0f\x09\xd1\x75\x6b\x93\xff\xd6\xca\x87\x8f\x93\x2a\x9f\x94\x0f\x59\xcd\xe9\xc8\xa8\x27\x76\x96\x35\xbc\x32\x55\xd4\xc8\xe3\x3a\x05\x80\x17\xd6\xd1\x0a\x3e\x27\x68\x0e\x05\xc9\x02\x60\x87\x5a\xc9\x4c\x65\x0b\xd6\x3a\x32\x57\x37\x1f\xbe\xbe\xbb\x15\x35\x35\xd8\x0a\x01\x1c\x5b\x47\x1c\x54\xbf\xa7\x34\x8e\x12\x63\x2f\x03\x90\xe4\x05\x2b\x97\x3d\xc2\xeb\xe4\xaa\xd5\x01\x99\x52\x81\x3c\x84\x9a\xa0\x0b\x28\x49\xf0\x79\x19\xb0\x1b\x08\xb5\xf2\xc0\xe4\x98\x3c\x99\x36\x39\x8e\xdc\x42\x52\x41\x03\x76\xfd\x17\x89\x50\xc2\x2d\x71\x72\x02\xbe\xb6\x51\xcb\x94\x3f\x3b\xe2\x00\x4c\xc2\x56\x46\x7d\xdf\x7b\xf6\x10\x6c\x5e\x52\x63\xa0\x8e\xca\x7e\x28\x13\x88\x0d\xea\x44\x42\xa4\x1f\x01\x8d\x84\x06\x1f\x80\x29\xad\x01\xd1\x1c\x79\xcb\x2a\xbe\x84\x5f\x2d\x13\x28\xb3\xb1\x2b\xa8\x43\x70\x7e\xb5\x5c\x56\x2a\xf4\x47\x41\xd8\xa6\x89\x46\x85\x87\x65\x4e\x68\xb5\x8e\xc1\xb2\x5f\x4a\xda\x91\x5e\x7a\x55\x2d\x90\x45\xad\x02\x89\x10\x99\x96\xe8\xd4\x22\x03\x37\xf9\x24\x94\x8d\xfc\x81\xbb\x73\xe3\x5f\x1f\x21\x0d\x0f\x29\x6c\x3e\xb0\x32\xd5\x5e\x9c\xb3\x6a\x92\xf7\x94\x50\xa0\x3c\x60\x67\xd6\xe2\x3f\xd0\x9b\x44\x89\x95\x2f\xef\x6f\xef\xa0\x5f\x34\x87\xe0\x31\xe7\x99\xed\x83\x99\x3f\x10\x9f\x88\x52\x66\x43\xdc\x06\x6e\xc3\xb6\xc9\x1e\xc9\x48\x67\x95\x09\x79\x22\xb4\x22\xf3\x98\x74\x1f\xd7\x8d\x0a\x29\xd2\x7f\x47\xf2\x21\xc5\xa7\x84\xeb\x5c\x10\x60\x4d\x10\x9d\xc4\x40\xb2\x84\x0f\x06\xae\xb1\x21\x7d\x8d\x9e\xfe\x75\xda\x13\xc3\x7e\x91\x28\x3d\x4d\xfc\x71\x1d\x7b\xac\xd8\xb2\xb5\x17\xf7\x75\xa2\x1f\x63\x67\x28\x9f\x23\x29\xf7\x75\xf0\x28\x39\x03\x35\x03\xe1\x93\x30\x5f\x25\xcb\x4e\xb4\x26\x9f\xce\x47\x76\x96\x72\x5e\x19\x1f\x50\x6b\x48\xb3\x1c\x89\xb6\x4a\x0d\x1c\x4e\xa1\xea\x97\x73\xa3\xf2\x49\x7c\x33\xc4\x0d\x15\x90\x19\x1f\x46\xfe\xcf\x35\x7c\xc6\x6e\xd2\xb1\x43\xc6\x29\x54\x28\x65\xbe\x88\x50\xdf\xcc\x6e\xf9\x02\xfc\x4f\x02\xde\x8f\x94\xda\x8a\x49\x0e\xbd\x2f\xf2\xd6\x06\xe2\x19\x6f\x53\x44\xa1\x53\xed\x49\x7c\xba\xc8\x5c\x3c\x0f\x14\xdc\x5e\x7d\x1e\xdd\xfc\x4c\x54\x4f\x70\x32\x17\x51\xba\x0f\x8c\x57\x5c\xc5\x26\xd5\x90\x0b\xd7\x9d\x4f\x50\x98\x4d\x97\x33\x70\xa7\x91\x8b\xe3\x0b\x3c\x4c\x07\x1c\xa6\x83\xde\xfe\x95\x97\xbe\x3c\xc5\xe6\xf8\x9e\x34\xc4\x18\xea\x54\xf4\x44\xbe\x5c\x7f\xa7\x75\x6d\xed\xf6\x92\xfc\x11\x28\x6a\xba\xbb\xfb\x34\xb6\xcf\x59\x92\x3c\x09\xa6\xf0\x8b\xd2\xa3\x2c\xcf\x9a\x46\xd6\x17\xda\x4c\x45\x63\x71\x04\x63\xf0\x57\x64\x7d\x09\x8d\x96\xd5\xf7\x17\xb1\x78\xd5\x39\x21\xf9\x1c\x3e\xb3\x8b\xdf\x0c\xbe\xc8\xc9\xff\x2a\x28\x42\xdb\x28\x6f\xd8\xee\x94\x1c\xd6\xc4\x49\x5c\xdd\xb3\xe3\x46\xa3\xa1\xf7\x5d\xe3\x72\xbe\x31\xab\x4b\xc2\xfe\xb4\x61\x3b\xe9\x3f\x3b\x44\xb1\xc5\xea\xf2\x00\xed\x86\x8d\xf9\x19\x76\xd3\x41\x4a\xe0\x07\xc2\x0e\xdc\x40\xde\x2d\x7e\x6e\xe8\x52\x43\x77\xc3\xf6\xfe\xe1\x6c\xe6\x55\x83\x15\x7d\x21\x67\xbd\x0a\x96\xcf\xb7\x4b\xcf\x4a\x4d\x61\xf2\x26\x9a\xb8\x85\xe6\x6f\xa0\x67\x37\x2b\x33\xb7\xce\xac\xe5\xc5\xed\xc5\xd4\x2d\xf3\x8c\xb6\xc3\x0e\x28\x98\x23\x67\xa3\xf4\x38\x67\x2f\xba\xee\x25\xa5\xc7\xed\xd1\x9b\x75\x6c\x9c\x71\xeb\xb7\x8f\x9e\x69\x17\xa7\x91\x40\x5b\x42\x36\xaa\x6a\xd0\xcd\x29\x9d\x85\x27\x8d\x2d\x0d\xb2\xf9\x19\x7e\xe6\xfb\x11\xc8\x29\xb1\xc7\x3d\xa3\xb3\xa5\xb1\xee\xfc\x18\xc8\x64\x7b\x72\xba\x29\x3a\x0a\xe3\x84\x46\x1b\xa0\xff\xa8\x39\xf2\xbe\xfe\x48\x0f\x37\x18\xea\xb3\xcb\x49\xf4\x67\x5f\x35\x63\x64\x2c\xd2\x0d\xf2\x68\x7e\xc0\xf0\x48\x9c\xd6\x29\x4e\x6c\xc1\x07\x0c\xd1\x9f\xf3\xdc\x64\x42\x39\x51\x32\xd7\xd6\x6a\x42\x73\x12\x77\x76\x31\x8f\xe8\x89\xe8\xf0\x05\xaf\xff\x8a\xb6\x97\x65\x78\x8b\xee\xbb\xdd\xd1\xdf\xa9\x41\xe1\x1d\xc9\x15\x04\xee\x8a\x97\x0f\x96\xd3\x6d\xd8\x4a\x0e\x5b\x46\x21\xc8\x05\x92\x9f\x9f\x7e\x74\x7b\xf5\x2a\x4f\xfa\x6f\x67\x79\x2a\xac\x69\x5f\x41\x7e\x05\x7f\xfc\x59\xb4\x5e\x49\x7e\xed\xd1\x24\xe1\x3f\x01\x00\x00\xff\xff\x27\x55\x96\xd0\xf9\x14\x00\x00"), }, - "/cluster.weave.works_baremetalmachines.yaml": &vfsgen۰CompressedFileInfo{ - name: "cluster.weave.works_baremetalmachines.yaml", + "/cluster.weave.works_existinginframachiness.yaml": &vfsgen۰CompressedFileInfo{ + name: "cluster.weave.works_existinginframachiness.yaml", modTime: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), - uncompressedSize: 2453, + uncompressedSize: 2473, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x56\x3f\x93\xdc\xb6\x0f\xed\xf5\x29\x30\xfe\x15\x6e\x7e\xd2\xda\x73\x4d\x46\x5d\x72\x76\x71\x93\x9c\xc7\xe3\xf3\x5c\x93\x49\x01\x91\xb8\x5d\xe4\x28\x52\x01\xc0\xb5\x2f\x9f\x3e\x43\x6a\xb5\xff\xbc\x9b\xa4\x48\xba\xb0\x92\x40\xf2\xe1\xe1\x01\x20\xd9\xb4\x6d\xdb\xe0\xc4\x8f\x24\xca\x29\xf6\x80\x13\xd3\x57\xa3\x58\xfe\xb4\x7b\xfe\x4e\x3b\x4e\xab\xed\xdb\x81\x0c\xdf\x36\xcf\x1c\x7d\x0f\xb7\x59\x2d\x8d\x9f\x48\x53\x16\x47\xef\xe8\x89\x23\x1b\xa7\xd8\x8c\x64\xe8\xd1\xb0\x6f\x00\x30\xc6\x64\x58\xcc\x5a\x7e\x01\x5c\x8a\x26\x29\x04\x92\x76\x4d\xb1\x7b\xce\x03\x0d\x99\x83\x27\xa9\x1e\x16\xff\xdb\x37\xdd\x4d\xf7\xa6\x01\x70\x42\x75\xfb\x67\x1e\x49\x0d\xc7\xa9\x87\x98\x43\x68\x00\x22\x8e\xd4\xc3\x80\x42\xc5\x61\x18\xd1\x6d\x38\x92\x76\x2e\x64\x35\x92\xee\x0b\xe1\x96\xba\x2f\x49\x9e\xb5\x01\x08\x38\x50\x58\x38\xec\x56\x7c\x6d\xf7\x81\x61\x98\x36\x78\xd3\xc3\xf2\xd5\xe8\x44\xae\xac\x5e\x4b\xca\x53\x0f\x97\x41\x0b\x85\x1d\xe6\xac\xc9\x0f\x28\x74\x5f\xd8\xdc\xcf\x6c\xea\x54\x60\xb5\x1f\x2f\x4e\xff\xc4\x6a\x75\xc9\x14\xb2\x60\xb8\x10\x4d\x9d\x55\x8e\xeb\x1c\x50\xbe\x9d\x6f\x00\xd4\xa5\x89\x7a\xf8\x50\xa8\x4c\xe8\xc8\x37\x00\x5b\x0c\xec\xab\x6c\x33\xb9\x34\x51\xfc\xfe\xe3\xdd\xe3\xcd\x83\xdb\xd0\x88\xb3\x11\x60\x92\x34\x91\x18\x2f\x31\x94\x71\x54\x04\x7b\x1b\x80\x27\x75\xc2\x53\x45\x84\xd7\x05\x6a\x5e\x03\xbe\xa4\x9d\x14\x6c\x43\xb0\x4b\x1e\x79\xd0\xea\x06\xd2\x13\xd8\x86\x15\x84\x26\x21\xa5\x38\x17\xc2\x11\x2c\x94\x25\x18\x21\x0d\xbf\x92\xb3\x0e\x1e\x48\x0a\x08\xe8\x26\xe5\xe0\x4b\xad\x6c\x49\x0c\x84\x5c\x5a\x47\xfe\x7d\x8f\xac\x60\xa9\xba\x0c\x68\xb4\x93\x70\x19\x1c\x8d\x24\x62\x28\x22\x64\xfa\x3f\x60\xf4\x30\xe2\x0b\x08\x15\x1f\x90\xe3\x11\x5a\x5d\xa2\x1d\xdc\x27\x21\xe0\xf8\x94\x7a\xd8\x98\x4d\xda\xaf\x56\x6b\xb6\xa5\xec\x5d\x1a\xc7\x1c\xd9\x5e\x56\xb5\x78\x79\xc8\x96\x44\x57\x9e\xb6\x14\x56\xca\xeb\x16\xc5\x6d\xd8\xc8\x59\x16\x5a\xe1\xc4\x6d\x25\x1e\x6b\xd5\x77\xa3\xff\x9f\xec\x7a\x44\x5f\x1f\x31\xb5\x97\x92\x36\x35\xe1\xb8\xde\x9b\x6b\x15\x5d\xd5\xbd\x14\x11\xb0\x02\xee\xb6\xcd\xfc\x0f\xf2\x16\x53\x51\xe5\xd3\xfb\x87\xcf\xb0\x38\xad\x29\x38\xd5\xbc\xaa\x7d\xd8\xa6\x07\xe1\x8b\x50\x1c\x9f\x48\xe6\xc4\x3d\x49\x1a\x2b\x22\x45\x3f\x25\x8e\x56\x7f\x5c\x60\x8a\xa7\xa2\x6b\x1e\x46\xb6\x92\xe9\xdf\x32\xa9\x95\xfc\x74\x70\x5b\x9b\x1f\x06\x82\x3c\x79\x34\xf2\x1d\xdc\x45\xb8\xc5\x91\xc2\x2d\x2a\xfd\xeb\xb2\x17\x85\xb5\x2d\x92\xfe\xb5\xf0\xc7\x67\xd6\xe9\xc2\x59\xad\xbd\x79\x39\x17\x96\x71\xa9\x87\x66\x3b\x6f\xd1\xe8\xd4\x78\x96\xd0\xf7\xd1\x7f\xac\xaa\xd6\x43\x66\x6e\x22\x4f\x86\x1c\x66\x25\x59\xc8\x97\x4a\x2f\x07\xdf\x10\x58\x37\x80\xa5\x27\x22\xb9\xb2\xbf\x3b\x83\xbe\xc6\xa4\x0c\xf4\x5e\x48\x2f\x4c\x5c\x91\x63\x8f\x99\xc4\xae\x6f\x2a\xad\xb6\x26\x39\x9b\x5f\x98\x9f\xef\x6b\x17\x16\xdf\xd8\x8b\x97\xe6\x92\x83\x33\xed\x77\x51\x6e\xd9\x93\xdc\xbd\x3b\xc7\xbf\x1a\xc8\x94\x87\xc0\xee\xbf\x4c\xec\xc7\x3f\x91\x89\xcb\xcd\x61\x68\x59\xff\x4e\x7b\x08\xa1\x7f\xb9\x9c\xc1\x21\xa5\x40\x78\x7c\x4d\x5c\x8a\xa3\x9d\x21\xfe\x9c\xd1\x99\xe9\xf0\xba\x58\x6e\xf9\xbd\xad\xd2\x6b\x77\x6f\x8a\xa3\x69\x00\x2d\x47\xa3\xef\xc1\x24\xcf\xd7\xb9\x5a\x12\x5c\xd3\xce\x72\x08\x19\x9d\xa3\xc9\xc8\x7f\x38\x7f\x14\xbc\x7a\x75\x72\xc7\xd7\x5f\x97\xa2\xe7\xf9\x59\x04\x3f\xff\xd2\xcc\xa8\xe4\x1f\x17\x36\xc5\xf8\x47\x00\x00\x00\xff\xff\x67\x71\x95\xa1\x95\x09\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x56\x31\x93\xdc\x36\x0f\xed\xf5\x2b\x30\xfe\x0a\x37\x9f\xb4\xf6\x5c\x93\x51\x97\x39\x5f\x71\x93\xd8\xe3\xf1\x79\xae\xc9\xa4\x80\x48\xac\x16\x39\x8a\x64\x08\x70\x7d\x97\x5f\x9f\x21\x25\xed\xed\x6e\x76\x93\x14\x49\x17\x56\x12\x08\x3e\x3c\x3e\x00\x24\x9b\xb6\x6d\x1b\x8c\xfc\x48\x49\x38\xf8\x1e\x30\x32\x3d\x2b\xf9\xf2\x27\xdd\xd3\x77\xd2\x71\xd8\xec\xdf\x0f\xa4\xf8\xbe\x79\x62\x6f\x7b\xb8\xcd\xa2\x61\xfa\x42\x12\x72\x32\xf4\x81\xb6\xec\x59\x39\xf8\x66\x22\x45\x8b\x8a\x7d\x03\x80\xde\x07\xc5\x62\x96\xf2\x0b\x60\x82\xd7\x14\x9c\xa3\xd4\x8e\xe4\xbb\xa7\x3c\xd0\x90\xd9\x59\x4a\x35\xc2\x1a\x7f\xff\xae\xbb\xe9\xde\x35\x00\x26\x51\x5d\xfe\x95\x27\x12\xc5\x29\xf6\xe0\xb3\x73\x0d\x80\xc7\x89\x7a\xa0\x67\x16\x65\x3f\xb2\xdf\x26\x9c\xd0\xec\xd8\x93\x74\xc6\x65\x51\x4a\xdd\x37\xc2\x3d\x75\xdf\x42\x7a\x92\x06\xc0\xe1\x40\x6e\xe5\xb1\x78\x3c\xb7\x87\xcd\xa1\x8b\x3b\xbc\xe9\x61\xfd\x6a\x24\x92\x29\xde\x63\x0a\x39\xf6\x70\x19\xb4\xd0\x58\x30\x67\x5d\xee\x16\x46\xf7\x85\xd1\xc7\x99\x51\x9d\x76\x2c\xfa\xc3\x55\x97\x1f\x59\xb4\xba\x45\x97\x13\xba\x2b\x3b\xab\x1e\xc2\x7e\xcc\x0e\xd3\x65\x9f\x06\x40\x4c\x88\xd4\xc3\xa7\x42\x2d\xa2\x21\xdb\x00\xec\xd1\xb1\xad\x52\xce\x64\x43\x24\xff\xfd\xe7\xfb\xc7\x9b\x07\xb3\xa3\x09\x67\x23\x40\x4c\x21\x52\x52\x5e\xf7\x54\xc6\x51\x61\x1c\x6c\x00\x96\xc4\x24\x8e\x15\x11\xde\x16\xa8\xd9\x07\x6c\x29\x05\x12\xd0\x1d\xc1\x92\x50\xb2\x20\x35\x0c\x84\x2d\xe8\x8e\x05\x12\xc5\x44\x42\x7e\x2e\x8e\x23\x58\x28\x2e\xe8\x21\x0c\xbf\x90\xd1\x0e\x1e\x28\x15\x10\x90\x5d\xc8\xce\x96\xfa\xd9\x53\x52\x48\x64\xc2\xe8\xf9\xb7\x03\xb2\x80\x86\x1a\xd2\xa1\xd2\x22\xe5\x3a\xd8\x2b\x25\x8f\xae\x88\x90\xe9\xff\x80\xde\xc2\x84\x2f\x90\xa8\xc4\x80\xec\x8f\xd0\xaa\x8b\x74\xf0\x31\x24\x02\xf6\xdb\xd0\xc3\x4e\x35\x4a\xbf\xd9\x8c\xac\x6b\x2b\x98\x30\x4d\xd9\xb3\xbe\x6c\x6a\x41\xf3\x90\x35\x24\xd9\x58\xda\x93\xdb\x08\x8f\x2d\x26\xb3\x63\x25\xa3\x39\xd1\x06\x23\xb7\x95\xb8\xaf\x9d\xd0\x4d\xf6\x7f\x69\xe9\x1b\x79\x7b\xc4\x54\x5f\x4a\xda\x44\x13\xfb\xf1\x60\xae\x55\x75\x55\xf7\x52\x50\xc0\x02\xb8\x2c\x9b\xf9\xbf\xca\x5b\x4c\x45\x95\x2f\x77\x0f\x5f\x61\x0d\x5a\x53\x70\xaa\x79\x55\xfb\x75\x99\xbc\x0a\x5f\x84\x62\xbf\xa5\x34\x27\x6e\x9b\xc2\x54\x11\xc9\xdb\x18\xd8\x6b\xfd\x31\x8e\xc9\x9f\x8a\x2e\x79\x98\x58\x4b\xa6\x7f\xcd\x24\x5a\xf2\xd3\xc1\x6d\x3d\x10\x60\x20\xc8\xd1\xa2\x92\xed\xe0\xde\xc3\x2d\x4e\xe4\x6e\x51\xe8\x5f\x97\xbd\x28\x2c\x6d\x91\xf4\xaf\x85\x3f\x3e\xc7\x4e\x1d\x67\xb5\x0e\xe6\xf5\x9c\x58\xc7\xa5\x1e\x9a\xed\xbc\x47\xa5\x53\xe3\x59\x42\xef\xbc\xfd\x5c\x55\xad\x87\xce\xdc\x44\x96\x14\xd9\xcd\x4a\x72\x22\x5b\x2a\xbd\x1c\x86\x83\x63\xd9\x01\x96\x9e\xf0\x64\xca\xfa\xee\x0c\xfa\x1a\x93\x32\xd0\xda\x44\x72\x61\xe2\x8a\x1c\x07\xcc\x90\xf4\xfa\xa2\xd2\x6a\x23\xa5\xb3\xf9\x95\xf9\xf9\xba\x76\x65\xf1\x07\x7b\x89\xd2\x5c\x0a\x70\xa6\xfd\xb2\xcb\x3d\x5b\x4a\xf7\x1f\xce\xf1\xaf\x6e\x24\xe6\xc1\xb1\xf9\x2f\x13\x87\xf1\x4f\x64\xe2\x72\x73\x28\x6a\x96\xbf\xd3\x1e\x89\xd0\xbe\x5c\xce\xe0\x10\x82\x23\x3c\xbe\x26\x2e\xed\xa3\x9d\x21\xfe\x9c\xd1\x99\xe9\xf5\xc5\xb1\xde\xfa\x07\x5b\xa5\xd7\x2e\xef\x8c\xa3\x69\x00\x29\x47\xa3\xed\x41\x53\x9e\xaf\x76\xd1\x90\x70\xa4\xc5\xf2\xba\x65\x34\x86\xa2\x92\xfd\x74\xfe\x48\x78\xf3\xe6\xe4\xae\xaf\xbf\x26\x78\xcb\xf3\x53\x09\x7e\xfa\xb9\x99\x51\xc9\x3e\xae\x6c\x8a\xf1\xf7\x00\x00\x00\xff\xff\x98\xe0\x19\xf4\xa9\x09\x00\x00"), }, "/cluster.x-k8s.io_clusters.yaml": &vfsgen۰CompressedFileInfo{ name: "cluster.x-k8s.io_clusters.yaml", @@ -74,8 +74,8 @@ var CRDs = func() http.FileSystem { }, } fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/cluster.weave.works_baremetalclusters.yaml"].(os.FileInfo), - fs["/cluster.weave.works_baremetalmachines.yaml"].(os.FileInfo), + fs["/cluster.weave.works_existinginfraclusters.yaml"].(os.FileInfo), + fs["/cluster.weave.works_existinginframachiness.yaml"].(os.FileInfo), fs["/cluster.x-k8s.io_clusters.yaml"].(os.FileInfo), fs["/cluster.x-k8s.io_machinedeployments.yaml"].(os.FileInfo), fs["/cluster.x-k8s.io_machinehealthchecks.yaml"].(os.FileInfo), From 48491db4237d7b4843883891ad212adc48739071 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Mon, 27 Jul 2020 16:49:56 +0300 Subject: [PATCH 3/5] Rename variable name references from BareMetal* to ExistingInfra* Signed-off-by: Dennis Marttinen --- .../controller/wksctl/cluster_controller.go | 16 +++---- .../controller/wksctl/machine_controller.go | 48 +++++++++---------- pkg/apis/wksprovider/machine/os/os.go | 2 +- pkg/specs/specs.go | 20 ++++---- pkg/specs/validation.go | 4 +- pkg/specs/validation_test.go | 8 ++-- test/integration/test/apply_test.go | 18 +++---- 7 files changed, 58 insertions(+), 58 deletions(-) diff --git a/pkg/apis/wksprovider/controller/wksctl/cluster_controller.go b/pkg/apis/wksprovider/controller/wksctl/cluster_controller.go index 4f2b3393..58f7d42b 100644 --- a/pkg/apis/wksprovider/controller/wksctl/cluster_controller.go +++ b/pkg/apis/wksprovider/controller/wksctl/cluster_controller.go @@ -30,8 +30,8 @@ func (a *ClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e contextLog := log.WithField("name", req.NamespacedName) // request only contains the name of the object, so fetch it from the api-server - bmc := &existinginfrav1.ExistingInfraCluster{} - err := a.client.Get(ctx, req.NamespacedName, bmc) + eic := &existinginfrav1.ExistingInfraCluster{} + err := a.client.Get(ctx, req.NamespacedName, eic) if err != nil { if apierrs.IsNotFound(err) { // isn't there; give in return ctrl.Result{}, nil @@ -40,7 +40,7 @@ func (a *ClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e } // Get Cluster via OwnerReferences - cluster, err := util.GetOwnerCluster(ctx, a.client, bmc.ObjectMeta) + cluster, err := util.GetOwnerCluster(ctx, a.client, eic.ObjectMeta) if err != nil { return ctrl.Result{}, err } @@ -50,20 +50,20 @@ func (a *ClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e } contextLog = contextLog.WithField("cluster", cluster.Name) - if util.IsPaused(cluster, bmc) { + if util.IsPaused(cluster, eic) { contextLog.Info("ExistingInfraCluster or linked Cluster is marked as paused. Won't reconcile") return ctrl.Result{}, nil } // Initialize the patch helper - patchHelper, err := patch.NewHelper(bmc, a.client) + patchHelper, err := patch.NewHelper(eic, a.client) if err != nil { return ctrl.Result{}, err } // Attempt to Patch the ExistingInfraMachine object and status after each reconciliation. defer func() { - if err := patchHelper.Patch(ctx, bmc); err != nil { + if err := patchHelper.Patch(ctx, eic); err != nil { contextLog.Errorf("failed to patch ExistingInfraCluster: %v", err) if reterr == nil { reterr = err @@ -72,12 +72,12 @@ func (a *ClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e }() // Object still there but with deletion timestamp => run our finalizer - if !bmc.ObjectMeta.DeletionTimestamp.IsZero() { + if !eic.ObjectMeta.DeletionTimestamp.IsZero() { a.recordEvent(cluster, corev1.EventTypeNormal, "Delete", "Deleted cluster %v", cluster.Name) return ctrl.Result{}, errors.New("ClusterReconciler#Delete not implemented") } - bmc.Status.Ready = true // TODO: know whether it is really ready + eic.Status.Ready = true // TODO: know whether it is really ready return ctrl.Result{}, nil } diff --git a/pkg/apis/wksprovider/controller/wksctl/machine_controller.go b/pkg/apis/wksprovider/controller/wksctl/machine_controller.go index 0121683e..a915b2d2 100644 --- a/pkg/apis/wksprovider/controller/wksctl/machine_controller.go +++ b/pkg/apis/wksprovider/controller/wksctl/machine_controller.go @@ -70,8 +70,8 @@ func (r *MachineController) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e contextLog := log.WithField("name", req.NamespacedName) // request only contains the name of the object, so fetch it from the api-server - bmm := &existinginfrav1.ExistingInfraMachine{} - err := r.client.Get(ctx, req.NamespacedName, bmm) + eim := &existinginfrav1.ExistingInfraMachine{} + err := r.client.Get(ctx, req.NamespacedName, eim) if err != nil { if apierrs.IsNotFound(err) { // isn't there; give in return ctrl.Result{}, nil @@ -80,7 +80,7 @@ func (r *MachineController) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e } // Get Machine via OwnerReferences - machine, err := util.GetOwnerMachine(ctx, r.client, bmm.ObjectMeta) + machine, err := util.GetOwnerMachine(ctx, r.client, eim.ObjectMeta) if err != nil { return ctrl.Result{}, err } @@ -97,7 +97,7 @@ func (r *MachineController) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e return ctrl.Result{}, nil } - if util.IsPaused(cluster, bmm) { + if util.IsPaused(cluster, eim) { contextLog.Info("ExistingInfraMachine or linked Cluster is marked as paused. Won't reconcile") return ctrl.Result{}, nil } @@ -108,23 +108,23 @@ func (r *MachineController) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e contextLog.Info("Cluster is missing infrastructureRef") return ctrl.Result{}, nil } - bmc := &existinginfrav1.ExistingInfraCluster{} + eic := &existinginfrav1.ExistingInfraCluster{} if err := r.client.Get(ctx, client.ObjectKey{ - Namespace: bmm.Namespace, + Namespace: eim.Namespace, Name: cluster.Spec.InfrastructureRef.Name, - }, bmc); err != nil { + }, eic); err != nil { contextLog.Info("ExistingInfraCluster is not available yet") return ctrl.Result{}, nil } // Initialize the patch helper - patchHelper, err := patch.NewHelper(bmm, r.client) + patchHelper, err := patch.NewHelper(eim, r.client) if err != nil { return ctrl.Result{}, err } // Attempt to Patch the ExistingInfraMachine object and status after each reconciliation. defer func() { - if err := patchHelper.Patch(ctx, bmm); err != nil { + if err := patchHelper.Patch(ctx, eim); err != nil { contextLog.Errorf("failed to patch ExistingInfraMachine: %v", err) if reterr == nil { reterr = err @@ -133,26 +133,26 @@ func (r *MachineController) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr e }() // Object still there but with deletion timestamp => run our finalizer - if !bmm.ObjectMeta.DeletionTimestamp.IsZero() { - err := r.delete(ctx, bmc, machine, bmm) + if !eim.ObjectMeta.DeletionTimestamp.IsZero() { + err := r.delete(ctx, eic, machine, eim) if err != nil { contextLog.Errorf("failed to delete machine: %v", err) } return ctrl.Result{}, err } - err = r.update(ctx, bmc, machine, bmm) + err = r.update(ctx, eic, machine, eim) if err != nil { contextLog.Errorf("failed to update machine: %v", err) } return ctrl.Result{}, err } -func (a *MachineController) create(ctx context.Context, installer *os.OS, c *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, bmm *existinginfrav1.ExistingInfraMachine) error { +func (a *MachineController) create(ctx context.Context, installer *os.OS, c *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, eim *existinginfrav1.ExistingInfraMachine) error { contextLog := log.WithFields(log.Fields{"machine": machine.Name, "cluster": c.Name}) contextLog.Info("creating machine...") - nodePlan, err := a.getNodePlan(ctx, c, machine, a.getMachineAddress(bmm), installer) + nodePlan, err := a.getNodePlan(ctx, c, machine, a.getMachineAddress(eim), installer) if err != nil { return err } @@ -174,8 +174,8 @@ func (a *MachineController) create(ctx context.Context, installer *os.OS, c *exi return err } // CAPI machine controller requires providerID - bmm.Spec.ProviderID = node.Spec.ProviderID - bmm.Status.Ready = true + eim.Spec.ProviderID = node.Spec.ProviderID + eim.Status.Ready = true a.recordEvent(machine, corev1.EventTypeNormal, "Create", "created machine %s", machine.Name) return nil } @@ -315,11 +315,11 @@ func (a *MachineController) installNewBootstrapToken(ctx context.Context, ns str } // Delete the machine. If no error is returned, it is assumed that all dependent resources have been cleaned up. -func (a *MachineController) delete(ctx context.Context, c *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, bmm *existinginfrav1.ExistingInfraMachine) error { +func (a *MachineController) delete(ctx context.Context, c *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, eim *existinginfrav1.ExistingInfraMachine) error { contextLog := log.WithFields(log.Fields{"machine": machine.Name, "cluster": c.Name}) contextLog.Info("deleting machine ...") - os, closer, err := a.connectTo(ctx, c, bmm) + os, closer, err := a.connectTo(ctx, c, eim) if err != nil { return gerrors.Wrapf(err, "failed to establish connection to machine %s", machine.Name) } @@ -356,10 +356,10 @@ func (a *MachineController) delete(ctx context.Context, c *existinginfrav1.Exist } // Update the machine to the provided definition. -func (a *MachineController) update(ctx context.Context, c *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, bmm *existinginfrav1.ExistingInfraMachine) error { +func (a *MachineController) update(ctx context.Context, c *existinginfrav1.ExistingInfraCluster, machine *clusterv1.Machine, eim *existinginfrav1.ExistingInfraMachine) error { contextLog := log.WithFields(log.Fields{"machine": machine.Name, "cluster": c.Name}) contextLog.Info("updating machine...") - installer, closer, err := a.connectTo(ctx, c, bmm) + installer, closer, err := a.connectTo(ctx, c, eim) if err != nil { return gerrors.Wrapf(err, "failed to establish connection to machine %s", machine.Name) } @@ -372,7 +372,7 @@ func (a *MachineController) update(ctx context.Context, c *existinginfrav1.Exist node, err := a.findNodeByID(ctx, ids.MachineID, ids.SystemUUID) if err != nil { if apierrs.IsNotFound(err) { // isn't there; try to create it - return a.create(ctx, installer, c, machine, bmm) + return a.create(ctx, installer, c, machine, eim) } return gerrors.Wrapf(err, "failed to find node by id: %s/%s", ids.MachineID, ids.SystemUUID) } @@ -381,7 +381,7 @@ func (a *MachineController) update(ctx context.Context, c *existinginfrav1.Exist if err = a.setNodeProviderIDIfNecessary(ctx, node); err != nil { return err } - nodePlan, err := a.getNodePlan(ctx, c, machine, a.getMachineAddress(bmm), installer) + nodePlan, err := a.getNodePlan(ctx, c, machine, a.getMachineAddress(eim), installer) if err != nil { return gerrors.Wrapf(err, "Failed to get node plan for machine %s", machine.Name) } @@ -475,8 +475,8 @@ func (a *MachineController) update(ctx context.Context, c *existinginfrav1.Exist return err } // CAPI machine controller requires providerID - bmm.Spec.ProviderID = node.Spec.ProviderID - bmm.Status.Ready = true + eim.Spec.ProviderID = node.Spec.ProviderID + eim.Status.Ready = true a.recordEvent(machine, corev1.EventTypeNormal, "Update", "updated machine %s", machine.Name) return nil diff --git a/pkg/apis/wksprovider/machine/os/os.go b/pkg/apis/wksprovider/machine/os/os.go index c8c324f9..f77d4722 100644 --- a/pkg/apis/wksprovider/machine/os/os.go +++ b/pkg/apis/wksprovider/machine/os/os.go @@ -1259,7 +1259,7 @@ func fetchOSID(sshClient *ssh.Client) (string, error) { } // parseCluster converts the manifest file into a Cluster -func parseCluster(clusterManifestPath string) (bmc *existinginfrav1.ExistingInfraCluster, err error) { +func parseCluster(clusterManifestPath string) (eic *existinginfrav1.ExistingInfraCluster, err error) { f, err := os.Open(clusterManifestPath) if err != nil { return nil, err diff --git a/pkg/specs/specs.go b/pkg/specs/specs.go index 33a69f00..908f040a 100644 --- a/pkg/specs/specs.go +++ b/pkg/specs/specs.go @@ -28,15 +28,15 @@ type Specs struct { // Get a "Specs" object that can create an SSHClient (and retrieve useful nested fields) func NewFromPaths(clusterManifestPath, machinesManifestPath string) *Specs { - cluster, bmc, machines, bml, err := parseManifests(clusterManifestPath, machinesManifestPath) + cluster, eic, machines, bml, err := parseManifests(clusterManifestPath, machinesManifestPath) if err != nil { log.Fatal("Error parsing manifest: ", err) } - return New(cluster, bmc, machines, bml) + return New(cluster, eic, machines, bml) } // Get a "Specs" object that can create an SSHClient (and retrieve useful nested fields) -func New(cluster *clusterv1.Cluster, bmc *existinginfrav1.ExistingInfraCluster, machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) *Specs { +func New(cluster *clusterv1.Cluster, eic *existinginfrav1.ExistingInfraCluster, machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) *Specs { _, master := machine.FirstMaster(machines, bl) if master == nil { log.Fatal("No master provided in manifest.") @@ -49,7 +49,7 @@ func New(cluster *clusterv1.Cluster, bmc *existinginfrav1.ExistingInfraCluster, } return &Specs{ Cluster: cluster, - ClusterSpec: &bmc.Spec, + ClusterSpec: &eic.Spec, MasterSpec: &master.Spec, machineCount: len(machines), @@ -58,13 +58,13 @@ func New(cluster *clusterv1.Cluster, bmc *existinginfrav1.ExistingInfraCluster, } func parseManifests(clusterManifestPath, machinesManifestPath string) (*clusterv1.Cluster, *existinginfrav1.ExistingInfraCluster, []*clusterv1.Machine, []*existinginfrav1.ExistingInfraMachine, error) { - cluster, bmc, err := ParseClusterManifest(clusterManifestPath) + cluster, eic, err := ParseClusterManifest(clusterManifestPath) if err != nil { return nil, nil, nil, nil, err } populateCluster(cluster) - validationErrors := validateCluster(cluster, bmc, clusterManifestPath) + validationErrors := validateCluster(cluster, eic, clusterManifestPath) if len(validationErrors) > 0 { utilities.PrintErrors(validationErrors) return nil, nil, nil, nil, apierrors.InvalidMachineConfiguration( @@ -85,11 +85,11 @@ func parseManifests(clusterManifestPath, machinesManifestPath string) (*clusterv return nil, nil, nil, nil, err } - return cluster, bmc, machines, bl, nil + return cluster, eic, machines, bl, nil } // ParseCluster converts the manifest file into a Cluster -func ParseCluster(r io.ReadCloser) (cluster *clusterv1.Cluster, bmc *existinginfrav1.ExistingInfraCluster, err error) { +func ParseCluster(r io.ReadCloser) (cluster *clusterv1.Cluster, eic *existinginfrav1.ExistingInfraCluster, err error) { decoder := clusteryaml.NewYAMLDecoder(r) defer decoder.Close() @@ -105,7 +105,7 @@ func ParseCluster(r io.ReadCloser) (cluster *clusterv1.Cluster, bmc *existinginf case *clusterv1.Cluster: cluster = v case *existinginfrav1.ExistingInfraCluster: - bmc = v + eic = v default: return nil, nil, errors.Errorf("unexpected type %T", v) } @@ -115,7 +115,7 @@ func ParseCluster(r io.ReadCloser) (cluster *clusterv1.Cluster, bmc *existinginf return nil, nil, errors.New("parsed cluster manifest lacks Cluster definition") } - if bmc == nil { + if eic == nil { return nil, nil, errors.New("parsed cluster manifest lacks ExistingInfraCluster definition") } diff --git a/pkg/specs/validation.go b/pkg/specs/validation.go index 7b1dbc87..2b7a1fac 100644 --- a/pkg/specs/validation.go +++ b/pkg/specs/validation.go @@ -178,7 +178,7 @@ func populateCluster(cluster *clusterv1.Cluster) { populateNetwork(cluster) } -func validateCluster(cluster *clusterv1.Cluster, bmc *existinginfrav1.ExistingInfraCluster, manifestPath string) field.ErrorList { +func validateCluster(cluster *clusterv1.Cluster, eic *existinginfrav1.ExistingInfraCluster, manifestPath string) field.ErrorList { var errors field.ErrorList for _, f := range []clusterValidationFunc{ @@ -187,7 +187,7 @@ func validateCluster(cluster *clusterv1.Cluster, bmc *existinginfrav1.ExistingIn validateSSHKeyEmpty, validateAddons, } { - errors = append(errors, f(cluster, &bmc.Spec, manifestPath)...) + errors = append(errors, f(cluster, &eic.Spec, manifestPath)...) } return errors diff --git a/pkg/specs/validation_test.go b/pkg/specs/validation_test.go index 82809222..95ebc839 100644 --- a/pkg/specs/validation_test.go +++ b/pkg/specs/validation_test.go @@ -276,9 +276,9 @@ spec: func clusterFromString(t *testing.T, s string) (*clusterv1.Cluster, *existinginfrav1.ExistingInfraCluster) { r := ioutil.NopCloser(strings.NewReader(s)) - cluster, bmc, err := ParseCluster(r) + cluster, eic, err := ParseCluster(r) assert.NoError(t, err) - return cluster, bmc + return cluster, eic } // Gather the list of fields paths that didn't pass validation. @@ -317,9 +317,9 @@ func TestValidateCluster(t *testing.T) { } for _, test := range tests { - cluster, bmc := clusterFromString(t, test.input) + cluster, eic := clusterFromString(t, test.input) populateCluster(cluster) - errors := validateCluster(cluster, bmc, "/tmp/test.yaml") + errors := validateCluster(cluster, eic, "/tmp/test.yaml") assert.Equal(t, len(test.errors), len(errors)) assert.Equal(t, test.errors, fieldsInError(errors)) diff --git a/test/integration/test/apply_test.go b/test/integration/test/apply_test.go index 9e82ded0..60345025 100644 --- a/test/integration/test/apply_test.go +++ b/test/integration/test/apply_test.go @@ -186,9 +186,9 @@ func setKubernetesVersion(l []*clusterv1.Machine, version string) { func parseClusterManifest(t *testing.T, file string) (*clusterv1.Cluster, *existinginfrav1.ExistingInfraCluster) { f, err := os.Open(file) assert.NoError(t, err) - cluster, bmCluster, err := specs.ParseCluster(f) + cluster, eiCluster, err := specs.ParseCluster(f) assert.NoError(t, err) - return cluster, bmCluster + return cluster, eiCluster } // The installer names the kubeconfig file from the cluster namespace and name @@ -375,18 +375,18 @@ func TestApply(t *testing.T) { terraform, err := newTerraformOutputFromFile(options.terraform.outputPath) require.NoError(t, err) - machines, bmMachines := makeMachinesFromTerraform(t, c.Name, terraform, terraform.numMachines()-1) + machines, eiMachines := makeMachinesFromTerraform(t, c.Name, terraform, terraform.numMachines()-1) setKubernetesVersion(machines, kubernetes.DefaultVersion) - writeYamlManifests(t, configPath("machines.yaml"), machines, bmMachines) + writeYamlManifests(t, configPath("machines.yaml"), machines, eiMachines) // Generate bad version to check failure return codes - savedAddress := bmMachines[0].Spec.Private.Address - bmMachines[0].Spec.Private.Address = "192.168.111.111" - writeYamlManifests(t, configPath("badmachines.yaml"), machines, bmMachines) - bmMachines[0].Spec.Private.Address = savedAddress + savedAddress := eiMachines[0].Spec.Private.Address + eiMachines[0].Spec.Private.Address = "192.168.111.111" + writeYamlManifests(t, configPath("badmachines.yaml"), machines, eiMachines) + eiMachines[0].Spec.Private.Address = savedAddress machinesManifestPath := configPath("machines.yaml") - _, m := machine.FirstMaster(machines, bmMachines) + _, m := machine.FirstMaster(machines, eiMachines) assert.NotNil(t, m) ip := m.Spec.Public.Address port := m.Spec.Public.Port From f426bd325f78ce3f6aeb7c3d0a446fb5588da37c Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Tue, 28 Jul 2020 16:46:06 +0300 Subject: [PATCH 4/5] Update examples to ExistingInfra* using crdconv Signed-off-by: Dennis Marttinen --- environments/local-rpm-repo/README.md | 4 +- examples/footloose/cluster.yaml | 64 +++---- examples/footloose/machines-multimaster.yaml | 166 +++++++++++-------- examples/footloose/machines.yaml | 84 +++++----- examples/gce/cluster.yaml | 63 +++---- examples/vagrant/cluster.yaml | 63 +++---- examples/vagrant/machines.yaml | 84 +++++----- 7 files changed, 296 insertions(+), 232 deletions(-) diff --git a/environments/local-rpm-repo/README.md b/environments/local-rpm-repo/README.md index c4cd35f0..e7af4826 100644 --- a/environments/local-rpm-repo/README.md +++ b/environments/local-rpm-repo/README.md @@ -45,8 +45,8 @@ 5. Configure it in your `cluster.yaml`: ```yaml - apiVersion: "cluster.weave.works/v1alpha3" - kind: "BareMetalCluster" + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraCluster spec: os: files: diff --git a/examples/footloose/cluster.yaml b/examples/footloose/cluster.yaml index 8972752e..4bb60385 100644 --- a/examples/footloose/cluster.yaml +++ b/examples/footloose/cluster.yaml @@ -1,35 +1,41 @@ -apiVersion: cluster.k8s.io/v1alpha1 +apiVersion: cluster.x-k8s.io/v1alpha3 kind: Cluster metadata: name: example spec: clusterNetwork: - services: - cidrBlocks: [10.96.0.0/12] pods: - cidrBlocks: [192.168.0.0/16] - serviceDomain: cluster.local - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalClusterProviderSpec - user: root - os: - files: - - source: - configmap: repo - key: kubernetes.repo - destination: /etc/yum.repos.d/kubernetes.repo - - source: - configmap: repo - key: docker-ce.repo - destination: /etc/yum.repos.d/docker-ce.repo - - source: - configmap: repo - key: cloud-google-com.gpg.b64 - destination: /tmp/cloud-google-com.gpg.b64 - cri: - kind: docker - package: docker-ce - version: 19.03.8 - + cidrBlocks: + - 192.168.0.0/16 + services: + cidrBlocks: + - 10.96.0.0/12 + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraCluster + name: example-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraCluster +metadata: + name: example-provider +spec: + cri: + kind: docker + package: docker-ce + version: 19.03.8 + os: + files: + - destination: /etc/yum.repos.d/kubernetes.repo + source: + configmap: repo + key: kubernetes.repo + - destination: /etc/yum.repos.d/docker-ce.repo + source: + configmap: repo + key: docker-ce.repo + - destination: /tmp/cloud-google-com.gpg.b64 + source: + configmap: repo + key: cloud-google-com.gpg.b64 + user: root \ No newline at end of file diff --git a/examples/footloose/machines-multimaster.yaml b/examples/footloose/machines-multimaster.yaml index d9049e29..4d94356a 100644 --- a/examples/footloose/machines-multimaster.yaml +++ b/examples/footloose/machines-multimaster.yaml @@ -1,71 +1,95 @@ -apiVersion: v1 -kind: List -items: -- apiVersion: cluster.k8s.io/v1alpha1 - kind: Machine - metadata: - name: master-1 - labels: - set: master - spec: - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalMachineProviderSpec - public: - address: 127.0.0.1 - port: 2222 - private: - address: 172.17.0.2 - port: 22 -- apiVersion: cluster.k8s.io/v1alpha1 - kind: Machine - metadata: - name: master-2 - labels: - set: master - spec: - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalMachineProviderSpec - public: - address: 127.0.0.1 - port: 2223 - private: - address: 172.17.0.3 - port: 22 -- apiVersion: cluster.k8s.io/v1alpha1 - kind: Machine - metadata: - name: master-3 - labels: - set: master - spec: - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalMachineProviderSpec - public: - address: 127.0.0.1 - port: 2224 - private: - address: 172.17.0.4 - port: 22 -- apiVersion: cluster.k8s.io/v1alpha1 - kind: Machine - metadata: - name: worker-1 - labels: - set: worker - spec: - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalMachineProviderSpec - public: - address: 127.0.0.1 - port: 2225 - private: - address: 172.17.0.5 - port: 22 +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Machine +metadata: + labels: + set: master + name: master-1 +spec: + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraMachine + name: master-1-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraMachine +metadata: + name: master-1-provider +spec: + private: + address: 172.17.0.2 + port: 22 + public: + address: 127.0.0.1 + port: 2222 +--- +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Machine +metadata: + labels: + set: master + name: master-2 +spec: + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraMachine + name: master-2-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraMachine +metadata: + name: master-2-provider +spec: + private: + address: 172.17.0.3 + port: 22 + public: + address: 127.0.0.1 + port: 2223 +--- +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Machine +metadata: + labels: + set: master + name: master-3 +spec: + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraMachine + name: master-3-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraMachine +metadata: + name: master-3-provider +spec: + private: + address: 172.17.0.4 + port: 22 + public: + address: 127.0.0.1 + port: 2224 +--- +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Machine +metadata: + labels: + set: worker + name: worker-1 +spec: + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraMachine + name: worker-1-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraMachine +metadata: + name: worker-1-provider +spec: + private: + address: 172.17.0.5 + port: 22 + public: + address: 127.0.0.1 + port: 2225 \ No newline at end of file diff --git a/examples/footloose/machines.yaml b/examples/footloose/machines.yaml index 361e9c38..e2b28e01 100644 --- a/examples/footloose/machines.yaml +++ b/examples/footloose/machines.yaml @@ -1,37 +1,47 @@ -apiVersion: v1 -kind: List -items: -- apiVersion: cluster.k8s.io/v1alpha1 - kind: Machine - metadata: - name: master-1 - labels: - set: master - spec: - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalMachineProviderSpec - public: - address: 127.0.0.1 - port: 2222 - private: - address: 172.17.0.2 - port: 22 -- apiVersion: cluster.k8s.io/v1alpha1 - kind: Machine - metadata: - name: worker-1 - labels: - set: worker - spec: - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalMachineProviderSpec - public: - address: 127.0.0.1 - port: 2223 - private: - address: 172.17.0.3 - port: 22 +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Machine +metadata: + labels: + set: master + name: master-1 +spec: + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraMachine + name: master-1-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraMachine +metadata: + name: master-1-provider +spec: + private: + address: 172.17.0.2 + port: 22 + public: + address: 127.0.0.1 + port: 2222 +--- +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Machine +metadata: + labels: + set: worker + name: worker-1 +spec: + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraMachine + name: worker-1-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraMachine +metadata: + name: worker-1-provider +spec: + private: + address: 172.17.0.3 + port: 22 + public: + address: 127.0.0.1 + port: 2223 \ No newline at end of file diff --git a/examples/gce/cluster.yaml b/examples/gce/cluster.yaml index 3b20a7aa..220f9a21 100644 --- a/examples/gce/cluster.yaml +++ b/examples/gce/cluster.yaml @@ -1,34 +1,41 @@ -apiVersion: cluster.k8s.io/v1alpha1 +apiVersion: cluster.x-k8s.io/v1alpha3 kind: Cluster metadata: name: example-gce spec: clusterNetwork: - services: - cidrBlocks: [10.96.0.0/12] pods: - cidrBlocks: [192.168.0.0/16] - serviceDomain: cluster.local - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalClusterProviderSpec - user: wks - os: - files: - - source: - configmap: repo - key: kubernetes.repo - destination: /etc/yum.repos.d/kubernetes.repo - - source: - configmap: repo - key: docker-ce.repo - destination: /etc/yum.repos.d/docker-ce.repo - - source: - configmap: repo - key: cloud-google-com.gpg.b64 - destination: /tmp/cloud-google-com.gpg.b64 - cri: - kind: docker - package: docker-ce - version: 19.03.8 + cidrBlocks: + - 192.168.0.0/16 + services: + cidrBlocks: + - 10.96.0.0/12 + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraCluster + name: example-gce-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraCluster +metadata: + name: example-gce-provider +spec: + cri: + kind: docker + package: docker-ce + version: 19.03.8 + os: + files: + - destination: /etc/yum.repos.d/kubernetes.repo + source: + configmap: repo + key: kubernetes.repo + - destination: /etc/yum.repos.d/docker-ce.repo + source: + configmap: repo + key: docker-ce.repo + - destination: /tmp/cloud-google-com.gpg.b64 + source: + configmap: repo + key: cloud-google-com.gpg.b64 + user: wks \ No newline at end of file diff --git a/examples/vagrant/cluster.yaml b/examples/vagrant/cluster.yaml index 02fa41a5..b61d392e 100644 --- a/examples/vagrant/cluster.yaml +++ b/examples/vagrant/cluster.yaml @@ -1,34 +1,41 @@ -apiVersion: cluster.k8s.io/v1alpha1 +apiVersion: cluster.x-k8s.io/v1alpha3 kind: Cluster metadata: name: example spec: clusterNetwork: - services: - cidrBlocks: [10.96.0.0/12] pods: - cidrBlocks: [192.168.0.0/16] - serviceDomain: cluster.local - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalClusterProviderSpec - user: vagrant - os: - files: - - source: - configmap: repo - key: kubernetes.repo - destination: /etc/yum.repos.d/kubernetes.repo - - source: - configmap: repo - key: docker-ce.repo - destination: /etc/yum.repos.d/docker-ce.repo - - source: - configmap: docker - key: daemon.json - destination: /etc/docker/daemon.json - cri: - kind: docker - package: docker-ce - version: 19.03.8 + cidrBlocks: + - 192.168.0.0/16 + services: + cidrBlocks: + - 10.96.0.0/12 + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraCluster + name: example-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraCluster +metadata: + name: example-provider +spec: + cri: + kind: docker + package: docker-ce + version: 19.03.8 + os: + files: + - destination: /etc/yum.repos.d/kubernetes.repo + source: + configmap: repo + key: kubernetes.repo + - destination: /etc/yum.repos.d/docker-ce.repo + source: + configmap: repo + key: docker-ce.repo + - destination: /etc/docker/daemon.json + source: + configmap: docker + key: daemon.json + user: vagrant diff --git a/examples/vagrant/machines.yaml b/examples/vagrant/machines.yaml index 07b54574..d9a2bf2e 100644 --- a/examples/vagrant/machines.yaml +++ b/examples/vagrant/machines.yaml @@ -1,37 +1,47 @@ -apiVersion: v1 -kind: List -items: -- apiVersion: cluster.k8s.io/v1alpha1 - kind: Machine - metadata: - generateName: master- - labels: - set: master - spec: - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalMachineProviderSpec - public: - address: 127.0.0.1 - port: 2222 - private: - address: 172.17.8.101 - port: 22 -- apiVersion: cluster.k8s.io/v1alpha1 - kind: Machine - metadata: - generateName: worker- - labels: - set: worker - spec: - providerSpec: - value: - apiVersion: baremetalproviderspec/v1alpha1 - kind: BareMetalMachineProviderSpec - public: - address: 127.0.0.1 - port: 2200 - private: - address: 172.17.8.102 - port: 22 +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Machine +metadata: + name: master + labels: + set: master +spec: + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraMachine + name: master-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraMachine +metadata: + name: master-provider +spec: + private: + address: 172.17.8.101 + port: 22 + public: + address: 127.0.0.1 + port: 2222 +--- +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Machine +metadata: + generateName: worker + labels: + set: worker +spec: + infrastructureRef: + apiVersion: cluster.weave.works/v1alpha3 + kind: ExistingInfraMachine + name: worker-provider +--- +apiVersion: cluster.weave.works/v1alpha3 +kind: ExistingInfraMachine +metadata: + name: worker-provider +spec: + private: + address: 172.17.8.102 + port: 22 + public: + address: 127.0.0.1 + port: 2200 From 43fa0837c69223607a8902d65ad7fc6f7ece0cc5 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Tue, 28 Jul 2020 18:49:38 +0300 Subject: [PATCH 5/5] Statically define machine names the Vagrant example (crdconv update) Signed-off-by: Dennis Marttinen --- examples/vagrant/machines.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/vagrant/machines.yaml b/examples/vagrant/machines.yaml index d9a2bf2e..17fc42fc 100644 --- a/examples/vagrant/machines.yaml +++ b/examples/vagrant/machines.yaml @@ -1,19 +1,19 @@ apiVersion: cluster.x-k8s.io/v1alpha3 kind: Machine metadata: - name: master labels: set: master + name: master-v5n5l spec: infrastructureRef: apiVersion: cluster.weave.works/v1alpha3 kind: ExistingInfraMachine - name: master-provider + name: master-v5n5l-provider --- apiVersion: cluster.weave.works/v1alpha3 kind: ExistingInfraMachine metadata: - name: master-provider + name: master-v5n5l-provider spec: private: address: 172.17.8.101 @@ -25,19 +25,19 @@ spec: apiVersion: cluster.x-k8s.io/v1alpha3 kind: Machine metadata: - generateName: worker labels: set: worker + name: worker-tsb5q spec: infrastructureRef: apiVersion: cluster.weave.works/v1alpha3 kind: ExistingInfraMachine - name: worker-provider + name: worker-tsb5q-provider --- apiVersion: cluster.weave.works/v1alpha3 kind: ExistingInfraMachine metadata: - name: worker-provider + name: worker-tsb5q-provider spec: private: address: 172.17.8.102