From 68fe3686facff391d59735b6c9c9b91e28e556fd Mon Sep 17 00:00:00 2001 From: Drew Walters Date: Tue, 23 Feb 2021 21:16:02 +0000 Subject: [PATCH] Fix JumpHost inline JSON tag and CR sample This change updates the sample CR to align to the most recent SIPCluster CRD changes and fixes a JSON tag that required a field named "inline" in the JumpHost service. Signed-off-by: Drew Walters Change-Id: I6ebbeb805d018c04707b42e89a0484dd8941f411 --- .../airship.airshipit.org_sipclusters.yaml | 27 +++--- .../samples/airship_v1beta1_sipcluster.yaml | 86 ++++++++++++------- docs/api/sipcluster.md | 5 +- pkg/api/v1/sipcluster_types.go | 2 +- 4 files changed, 70 insertions(+), 50 deletions(-) diff --git a/config/crd/bases/airship.airshipit.org_sipclusters.yaml b/config/crd/bases/airship.airshipit.org_sipclusters.yaml index 226d05a..8587e4a 100644 --- a/config/crd/bases/airship.airshipit.org_sipclusters.yaml +++ b/config/crd/bases/airship.airshipit.org_sipclusters.yaml @@ -109,25 +109,20 @@ spec: proxy: type: boolean type: object - inline: - properties: - clusterIP: - type: string - image: - type: string - nodeInterfaceId: - type: string - nodeLabels: - additionalProperties: - type: string - type: object - nodePort: - type: integer + clusterIP: + type: string + image: + type: string + nodeInterfaceId: + type: string + nodeLabels: + additionalProperties: + type: string type: object + nodePort: + type: integer sshkey: type: string - required: - - inline type: object type: array loadBalancer: diff --git a/config/samples/airship_v1beta1_sipcluster.yaml b/config/samples/airship_v1beta1_sipcluster.yaml index 6f75fca..11c4a99 100644 --- a/config/samples/airship_v1beta1_sipcluster.yaml +++ b/config/samples/airship_v1beta1_sipcluster.yaml @@ -1,43 +1,65 @@ apiVersion: airship.airshipit.org/v1 kind: SIPCluster metadata: - name: sipcluster-test1 + name: sipcluster-test namespace: sipcluster-system finalizers: - sip.airship.airshipit.org/finalizer spec: - clusterName: subcluster-test1 - nodes: - Worker: - vmFlavor: 'vino.airshipit.org/flavor=worker' - spreadTopology: 'PerHost' # Support dont'care option. - count: - active: 1 #driven by capi node number - standby: 1 #slew for upgrades etc - ControlPlane: - vmFlavor: 'vino.airshipit.org/flavor=control-plane' - spreadTopology: 'PerRack' - count: - active: 1 - standby: 1 - infra: - - serviceType: auth - image: sshpod:foo - nodeLabels: - - airship-control-plane - nodePort: 7023 + # TODO: This field will be removed in the future. + clusterName: subcluster-test + nodes: + ControlPlane: + vmFlavor: vino.airshipit.org/flavor=control-plane + spreadTopology: PerRack + count: + active: 1 + standby: 1 + Worker: + vmFlavor: vino.airshipit.org/flavor=worker + spreadTopology: PerHost + count: + active: 1 + standby: 1 # Slew for upgrades + services: + # NOTE: The auth service has not yet been implemented. + # auth: + # - image: sshpod:foo + # # NOTE: nodeLabels not yet implemented. + # nodeLabels: + # kubernetes.io/os: linux + # nodePort: 7023 + # nodeInterfaceId: oam-ipv4 + # clusterIP: 1.2.3.4 # IP of the base cluster VIP + jumpHost: + - image: quay.io/airshipit/jump-host:latest + # NOTE: nodeLabels not yet implemented. + # nodeLabels: + # kubernetes.io/os: linux + nodePort: 30001 nodeInterfaceId: oam-ipv4 - - serviceType: jumphost - redfish: + # NOTE: clusterIP has not yet been implemented. + # clusterIP: 1.2.3.4 # IP of the base cluster VIP + bmc: proxy: false - image: quay.io/airshipit/jump-host:dev - nodeLabels: - - airship-control-plane - nodePort: 7022 - nodeInterfaceId: oam-ipv4 - - serviceType: loadbalancer - image: haproxy:2.3.2 - nodeLabels: - - airship-control-plane + # NOTE: SSHKey not implemented but required by schema. + SSHKey: > + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDM/UeCgfawmdt5ehghEk/GCGkrKgdt/ + DY6NuFOdMZsPUmO3Ryitzw/pqwUXvpnFjCZo2AtxrZhwjbkJRluoVVEBDh1R5YSGHY9el + 1AkTJj F6bCayjAHTW32pX93NDn4/6ZtTtiVhmZlCr2wK6uZvh4ZB1vBBLEMywME6NaJO + OPXId+fc62wwEQqv3PH9A1wMOwPMXvX/r/wm8nUoEguEwC50rPFmTEHkvAi4BWAjfLDOo + nU4Mo/cYCrZyrU74GbMR41IxtCcdeFmHSNTVFvQNG9nBSWeoM1nIquoricw+bYYp5QDJ0 + 3m7yD54vJNiPIMr6TaUwGObaAF95I/Q/CgHbEEAYIn33+jj1g2N4BjhXE4B948CW/DfC1 + KTn2zR3ZroshghURY9Z0J1BjPsCktiTsOs3eBuUH31WCjNNtgaCJNp4SIQHd1je6m4igk + 7pnr532a/fxdu9Y5udLJ7+ecqeQmDBFIf8UvpZFNktntOQQPq8G/XI3tvjTGl6M2RGIfM + = sample-key + loadBalancer: + - image: haproxy:2.3.2 + # NOTE: nodeLabels not yet implemented. + # nodeLabels: + # kubernetes.io/os: linux nodePort: 30000 nodeInterfaceId: oam-ipv4 + # NOTE: clusterIP has not yet been implemented. + # clusterIP: 1.2.3.4 # IP of the base cluster VIP + diff --git a/docs/api/sipcluster.md b/docs/api/sipcluster.md index c5decb4..03bdc79 100644 --- a/docs/api/sipcluster.md +++ b/docs/api/sipcluster.md @@ -59,7 +59,7 @@ bool -inline
+SIPClusterService
SIPClusterService @@ -67,6 +67,9 @@ SIPClusterService +

+(Members of SIPClusterService are embedded into this type.) +

diff --git a/pkg/api/v1/sipcluster_types.go b/pkg/api/v1/sipcluster_types.go index 45c6829..59eb675 100644 --- a/pkg/api/v1/sipcluster_types.go +++ b/pkg/api/v1/sipcluster_types.go @@ -85,7 +85,7 @@ func (s SIPClusterServices) GetAll() []SIPClusterService { // JumpHostService is an infrastructure service type that represents the sub-cluster jump-host service. type JumpHostService struct { - SIPClusterService `json:"inline"` + SIPClusterService `json:",inline"` BMC *BMCOpts `json:"bmc,omitempty"` SSHKey string `json:"sshkey,omitempty"` }