WIP MachcineData is just internal to Machines.

This commit is contained in:
Rodolfo Pacheco 2020-10-28 09:32:00 -04:00
parent 1dd74c0fa6
commit 5a857795e9
6 changed files with 86 additions and 91 deletions

View File

@ -35,10 +35,7 @@ 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:
additionalProperties:
properties:
image:
type: string
@ -50,31 +47,26 @@ spec:
additionalProperties:
type: string
type: object
sshkey:
type: string
type: object
loadbalancer:
optional:
properties:
clusterIp:
type: string
image:
type: string
nodeInterfaceId:
type: string
nodePort:
type: integer
nodelabels:
additionalProperties:
sshkey:
type: string
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
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: VmCount
description: Count defines the scale expectations for the Nodes
properties:
active:
description: 'INSERT ADDITIONAL STATUS FIELD - define observed
@ -86,16 +78,22 @@ spec:
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:
type: string
vm-role:
description: VmRoles defines the states the provisioner will report
the tenant has having.
description: VmFlavor is essentially a Flavor label identifying
the type of Node that meets the construction reqirements
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

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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
}

View File

@ -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