diff --git a/config/crd/bases/airship.airshipit.org_sipclusters.yaml b/config/crd/bases/airship.airshipit.org_sipclusters.yaml index 8eba93d..86962f0 100644 --- a/config/crd/bases/airship.airshipit.org_sipclusters.yaml +++ b/config/crd/bases/airship.airshipit.org_sipclusters.yaml @@ -35,67 +35,65 @@ spec: description: SIPClusterSpec defines the desired state of SIPCluster properties: infra: - description: Infra is the collection of expeected configuration details - for the multiple infrastructure services or pods that SIP manages - properties: - jumphost: - properties: - image: + additionalProperties: + properties: + image: + type: string + nodeInterfaceId: + type: string + nodePort: + type: integer + nodelabels: + additionalProperties: type: string - nodeInterfaceId: - type: string - nodePort: - type: integer - nodelabels: - additionalProperties: + type: object + optional: + properties: + clusterIp: type: string - type: object - sshkey: - type: string - type: object - loadbalancer: - properties: - clusterIp: - type: string - image: - type: string - nodeInterfaceId: - type: string - nodePort: - type: integer - nodelabels: - additionalProperties: + sshkey: type: string - type: object - type: object + type: object + type: object + description: List of Infrastructure Services type: object nodes: - description: Nodes are the list of Nodes objects workers, or master - that definee eexpectations of the Tenant cluster - properties: - count: - description: VmCount - properties: - active: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed - state of cluster Important: Run "make" to regenerate code - after modifying this file' - type: integer - standby: - type: integer - type: object - scheduling-constraints: - description: PlaceHolder until we define the real expected Implementation - items: + additionalProperties: + description: 'NodeSet are the the list of Nodes objects workers, or + master that definee eexpectations for the Tenant Clusters Includes + artifacts to associate with each defined namespace Such as : - Roles + for the Nodes - Flavor for theh Nodes image - Scheduling expectations + - Scale of the group of Nodes' + properties: + count: + description: Count defines the scale expectations for the Nodes + properties: + active: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "make" to regenerate code + after modifying this file' + type: integer + standby: + type: integer + type: object + scheduling-constraints: + description: PlaceHolder until we define the real expected Implementation + Scheduling define constraints the allows the SIP Scheduler to + identify the required BMH's to allow CAPI to build a cluster + items: + type: string + type: array + vm-flavor: + description: VmFlavor is essentially a Flavor label identifying + the type of Node that meets the construction reqirements type: string - type: array - vm-flavor: - type: string - vm-role: - description: VmRoles defines the states the provisioner will report - the tenant has having. - type: string + type: object + description: Nodes are the list of Nodes objects workers, or master + that definee eexpectations of the Tenant cluster VmRole is either + Control or Workers VmRole VmRoles `json:"vm-role,omitempty"` type: object + required: + - infra type: object status: description: SIPClusterStatus defines the observed state of SIPCluster diff --git a/cover.out b/cover.out index 59684cc..779811c 100644 --- a/cover.out +++ b/cover.out @@ -1,5 +1,23 @@ mode: set -sipcluster/controllers/sipcluster_controller.go:41.81,47.61 4 0 -sipcluster/controllers/sipcluster_controller.go:55.2,55.27 1 0 -sipcluster/controllers/sipcluster_controller.go:47.61,53.3 2 0 -sipcluster/controllers/sipcluster_controller.go:58.73,62.2 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:43.81,49.61 4 0 +sipcluster/pkg/controllers/sipcluster_controller.go:57.2,58.16 2 0 +sipcluster/pkg/controllers/sipcluster_controller.go:64.2,65.16 2 0 +sipcluster/pkg/controllers/sipcluster_controller.go:69.2,70.16 2 0 +sipcluster/pkg/controllers/sipcluster_controller.go:73.2,73.27 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:49.61,55.3 2 0 +sipcluster/pkg/controllers/sipcluster_controller.go:58.16,60.3 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:65.16,67.3 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:70.16,72.3 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:76.73,80.2 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:107.100,114.16 3 0 +sipcluster/pkg/controllers/sipcluster_controller.go:117.2,117.22 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:114.16,116.3 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:122.112,124.2 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:126.110,127.53 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:146.2,146.12 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:127.53,130.17 2 0 +sipcluster/pkg/controllers/sipcluster_controller.go:135.3,136.17 2 0 +sipcluster/pkg/controllers/sipcluster_controller.go:141.3,142.17 2 0 +sipcluster/pkg/controllers/sipcluster_controller.go:130.17,132.4 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:136.17,138.4 1 0 +sipcluster/pkg/controllers/sipcluster_controller.go:142.17,144.4 1 0 diff --git a/pkg/controllers/sipcluster_controller.go b/pkg/controllers/sipcluster_controller.go index c547769..cd64c3e 100644 --- a/pkg/controllers/sipcluster_controller.go +++ b/pkg/controllers/sipcluster_controller.go @@ -61,12 +61,12 @@ func (r *SIPClusterReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) // Do we extra the information in a generic way // So that LB and Jump Host can both leverage - err, machineData := r.extractFromVM(sip, machines) + err = r.extractFromVM(sip, machines) if err != nil { return ctrl.Result{}, err } - err = r.deployInfra(sip, machines, machineData) + err = r.deployInfra(sip, machines) if err != nil { return ctrl.Result{}, err } @@ -119,11 +119,11 @@ func (r *SIPClusterReconciler) gatherVM(sip airshipv1.SIPCluster) (error, *airsh /* */ -func (r *SIPClusterReconciler) extractFromVM(sip airshipv1.SIPCluster, machines *airshipvms.MachineList) (error, airshipvms.MachineData) { - return nil, airshipvms.MachineData{} +func (r *SIPClusterReconciler) extractFromVM(sip airshipv1.SIPCluster, machines *airshipvms.MachineList) error { + return nil } -func (r *SIPClusterReconciler) deployInfra(sip airshipv1.SIPCluster, machines *airshipvms.MachineList, machineData airshipvms.MachineData) error { +func (r *SIPClusterReconciler) deployInfra(sip airshipv1.SIPCluster, machines *airshipvms.MachineList) error { for sName, sConfig := range sip.Spec.InfraServices { // Instantiate service, err := airshipsvc.NewService(sName, sConfig) @@ -132,7 +132,7 @@ func (r *SIPClusterReconciler) deployInfra(sip airshipv1.SIPCluster, machines *a } // Lets deploy the Service - err = service.Deploy(machines, machineData, r.Client) + err = service.Deploy(machines, r.Client) if err != nil { return err } diff --git a/pkg/services/infrastructureservice.go b/pkg/services/infrastructureservice.go index 1b44933..1fd9149 100644 --- a/pkg/services/infrastructureservice.go +++ b/pkg/services/infrastructureservice.go @@ -30,7 +30,7 @@ import ( // Validate : will make sure that the deployment is successfull type InfrastructureService interface { // - Deploy(*airshipvms.MachineList, airshipvms.MachineData, client.Client) error + Deploy(*airshipvms.MachineList, client.Client) error Validate() error } @@ -40,7 +40,7 @@ type Service struct { config airshipv1.InfraConfig } -func (s *Service) Deploy(machines *airshipvms.MachineList, machineData airshipvms.MachineData, c client.Client) error { +func (s *Service) Deploy(machines *airshipvms.MachineList, c client.Client) error { // do something, might decouple this a bit // If the serviucces are defined as Helm Chart , then deploy might be simply diff --git a/pkg/vbmh/machinedata.go b/pkg/vbmh/machinedata.go deleted file mode 100644 index dbf5ee3..0000000 --- a/pkg/vbmh/machinedata.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vbmh - -import ( -// metal3 "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1" -) - -type MachineData struct { - MachData *Machine -} diff --git a/pkg/vbmh/machines.go b/pkg/vbmh/machines.go index b98eed8..326f8e1 100644 --- a/pkg/vbmh/machines.go +++ b/pkg/vbmh/machines.go @@ -59,8 +59,12 @@ type Machine struct { ScheduleState ScheduledState // scheduleLabels ScheduleLabels map[string]string + Data *MachineData } +type MachineData struct { + // Some Data +} type MachineList struct { bmhs []Machine