From 7cfffde323af99e2872d3fad9edf1f68a4cbf482 Mon Sep 17 00:00:00 2001 From: Pallav Gupta Date: Thu, 6 May 2021 15:02:32 -0700 Subject: [PATCH] Added missing properties to catalogues * added bond_xmit_hash_policy property to network catalogues * added sourceRef chart property to versions catalogues * corrected code typos Change-Id: Idda5e7628df3631688b84e4d62749ab173c9933f --- .../airshipit.org_networkcatalogues.yaml | 2 ++ .../airshipit.org_versionscatalogues.yaml | 17 +++++++++++---- pkg/api/v1alpha1/networkcatalogue_types.go | 21 ++++++++++--------- pkg/api/v1alpha1/versionscatalogue_types.go | 17 ++++++++++----- pkg/api/v1alpha1/zz_generated.deepcopy.go | 16 ++++++++++++++ 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/manifests/function/airshipctl-schemas/airshipit.org_networkcatalogues.yaml b/manifests/function/airshipctl-schemas/airshipit.org_networkcatalogues.yaml index 41dc58fd9..fe0bb3454 100644 --- a/manifests/function/airshipctl-schemas/airshipit.org_networkcatalogues.yaml +++ b/manifests/function/airshipctl-schemas/airshipit.org_networkcatalogues.yaml @@ -53,6 +53,8 @@ spec: type: integer bond_mode: type: string + bond_xmit_hash_policy: + type: string id: type: string mtu: diff --git a/manifests/function/airshipctl-schemas/airshipit.org_versionscatalogues.yaml b/manifests/function/airshipctl-schemas/airshipit.org_versionscatalogues.yaml index f59394ee7..7a8b6b4c2 100644 --- a/manifests/function/airshipctl-schemas/airshipit.org_versionscatalogues.yaml +++ b/manifests/function/airshipctl-schemas/airshipit.org_versionscatalogues.yaml @@ -92,10 +92,22 @@ spec: charts: additionalProperties: description: ChartProperties defines the properties of the chart - like Chart and vesrion + like Chart and version properties: chart: type: string + sourceRef: + description: ChartSourceRef defines the properties of the Chart + SourceRef like Kind and Name + properties: + kind: + type: string + name: + type: string + required: + - kind + - name + type: object version: type: string required: @@ -215,9 +227,6 @@ spec: description: Allows for the specification of the kubernetes version being used. type: string - required: - - capi_images - - images type: object type: object served: true diff --git a/pkg/api/v1alpha1/networkcatalogue_types.go b/pkg/api/v1alpha1/networkcatalogue_types.go index 0f23fae68..bb901ad3b 100644 --- a/pkg/api/v1alpha1/networkcatalogue_types.go +++ b/pkg/api/v1alpha1/networkcatalogue_types.go @@ -35,16 +35,17 @@ type HostNetworkingSpec struct { // Link defines the properties of the network link type Link struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - MTU string `json:"mtu,omitempty"` - BondLinks []string `json:"bond_links,omitempty"` - BondMode string `json:"bond_mode,omitempty"` - BondMiimon int `json:"bond_miimon,omitempty"` - VlanLink string `json:"vlan_link,omitempty"` - VlanID int `json:"vlan_id,omitempty"` - VlanMacAddress string `json:"vlan_mac_address,omitempty"` + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + MTU string `json:"mtu,omitempty"` + BondLinks []string `json:"bond_links,omitempty"` + BondMode string `json:"bond_mode,omitempty"` + BondMiimon int `json:"bond_miimon,omitempty"` + BondXmitHashPolicy string `json:"bond_xmit_hash_policy,omitempty"` + VlanLink string `json:"vlan_link,omitempty"` + VlanID int `json:"vlan_id,omitempty"` + VlanMacAddress string `json:"vlan_mac_address,omitempty"` } // IPFormat Regex to support both IPV4 and IPV6 format diff --git a/pkg/api/v1alpha1/versionscatalogue_types.go b/pkg/api/v1alpha1/versionscatalogue_types.go index 21b9db69c..f1b5600ae 100644 --- a/pkg/api/v1alpha1/versionscatalogue_types.go +++ b/pkg/api/v1alpha1/versionscatalogue_types.go @@ -31,10 +31,17 @@ type RepoProperties struct { // RepositorySpec defines the additional properties for repository type RepositorySpec map[string]RepoProperties -// ChartProperties defines the properties of the chart like Chart and vesrion +// ChartSourceRef defines the properties of the Chart SourceRef like Kind and Name +type ChartSourceRef struct { + Kind string `json:"kind"` + Name string `json:"name"` +} + +// ChartProperties defines the properties of the chart like Chart and version type ChartProperties struct { - Chart string `json:"chart"` - Version string `json:"version"` + Chart string `json:"chart"` + Version string `json:"version"` + SourceRef ChartSourceRef `json:"sourceRef,omitempty"` } // ChartSpec defines the spec for charts @@ -140,13 +147,13 @@ type VersionsCatalogueSpec struct { // "repository" and "tag" properties defined. capi_images may also include an // optional "ipam-manager" object, which must also have "repository" and "tag" // properties defined. - CAPIImages CAPIImageSpec `json:"capi_images,omtiempty"` + CAPIImages CAPIImageSpec `json:"capi_images,omitempty"` // images defines collections of images that are declared as complete // URLs rather than as a collection of discrete parts, such as "repository" and // "tag" or "sha". This section of the catalog is organized by // airshipctl function -> Deployments in function -> images in Deployment. - Images ImageSpec `json:"images,omtiempty"` + Images ImageSpec `json:"images,omitempty"` // image_components defines images that are declared using the Helm-style // format that breaks image URLs into discrete parts, such as "repository" and "tag". diff --git a/pkg/api/v1alpha1/zz_generated.deepcopy.go b/pkg/api/v1alpha1/zz_generated.deepcopy.go index 368749edd..8f3b82718 100644 --- a/pkg/api/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/api/v1alpha1/zz_generated.deepcopy.go @@ -322,6 +322,7 @@ func (in CAPIImageSpec) DeepCopy() CAPIImageSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ChartProperties) DeepCopyInto(out *ChartProperties) { *out = *in + out.SourceRef = in.SourceRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartProperties. @@ -334,6 +335,21 @@ func (in *ChartProperties) DeepCopy() *ChartProperties { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChartSourceRef) DeepCopyInto(out *ChartSourceRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartSourceRef. +func (in *ChartSourceRef) DeepCopy() *ChartSourceRef { + if in == nil { + return nil + } + out := new(ChartSourceRef) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in ChartSpec) DeepCopyInto(out *ChartSpec) { {