Skip to content

Commit

Permalink
Address review comments part-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik-K-N committed Nov 14, 2023
1 parent 2e9e3fb commit 91fb6bf
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 65 deletions.
39 changes: 31 additions & 8 deletions api/v1beta2/ibmpowervscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type IBMPowerVSClusterSpec struct {
ServiceInstanceID string `json:"serviceInstanceID"`

// Network is the reference to the Network to use for this cluster.
// When the field is omitted, A DHCP service will be created in the service instance and its private network will be used.
// when the field is omitted, A DHCP service will be created in the service instance and its private network will be used.
Network IBMPowerVSResourceReference `json:"network"`

// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
Expand All @@ -53,21 +53,26 @@ type IBMPowerVSClusterSpec struct {
// https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server
// when omitted system will dynamically create the service instance
// +optional
ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance"`
ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance,omitempty"`

// zone is the name of Power VS zone where the cluster will be created
Zone string `json:"zone"`
// possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server.
// when value for serviceInstance is omitted its required to set the value for zone.
// +optional
Zone string `json:"zone,omitempty"`

// resourceGroup name under which the resources will be created.
ResourceGroup string `json:"resourceGroup"`
// when omitted Default resource group will be used.
// +optional
ResourceGroup string `json:"resourceGroup,omitempty"`

// vpc contains information about IBM Cloud VPC resources
// +optional
VPC IBMVPCResourceReference `json:"vpc,omitempty"`
VPC VPCResourceReference `json:"vpc,omitempty"`

// transitGateway contains information about IBM Cloud TransitGateway.
// +optional
TransitGateway IBMTransitGatewayResource `json:"transitGateway,omitempty"`
TransitGateway TransitGateway `json:"transitGateway,omitempty"`

// controlPlaneLoadBalancer is optional configuration for customizing control plane behavior.
// Its name reference to IBM Cloud VPC LoadBalancer service.
Expand Down Expand Up @@ -132,12 +137,30 @@ type IBMPowerVSClusterList struct {
Items []IBMPowerVSCluster `json:"items"`
}

// IBMTransitGatewayResource holds the TransitGateway information.
type IBMTransitGatewayResource struct {
// TransitGateway holds the TransitGateway information.
type TransitGateway struct {
Name *string `json:"name,omitempty"`
ID *string `json:"id,omitempty"`
}

// VPCResourceReference is a reference to a specific VPC resource by ID or Name
// Only one of ID or Name may be specified. Specifying more than one will result in
// a validation error.
type VPCResourceReference struct {
// ID of resource
// +kubebuilder:validation:MinLength=1
// +optional
ID *string `json:"id,omitempty"`

// Name of resource
// +kubebuilder:validation:MinLength=1
// +optional
Name *string `json:"name,omitempty"`

// IBM Cloud VPC zone
Zone *string `json:"zone,omitempty"`
}

func init() {
SchemeBuilder.Register(&IBMPowerVSCluster{}, &IBMPowerVSClusterList{})
}
3 changes: 0 additions & 3 deletions api/v1beta2/ibmvpcmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ type IBMVPCResourceReference struct {
// +kubebuilder:validation:MinLength=1
// +optional
Name *string `json:"name,omitempty"`

// IBM Cloud VPC zone
Zone *string `json:"vpcZone,omitempty"`
}

// VPCVolume defines the volume information for the instance.
Expand Down
85 changes: 55 additions & 30 deletions api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ spec:
type: object
network:
description: Network is the reference to the Network to use for this
cluster. When the field is omitted, A DHCP service will be created
cluster. when the field is omitted, A DHCP service will be created
in the service instance and its private network will be used.
properties:
id:
Expand All @@ -207,7 +207,7 @@ spec:
type: object
resourceGroup:
description: resourceGroup name under which the resources will be
created.
created. when omitted Default resource group will be used.
type: string
serviceInstance:
description: serviceInstance is the reference to the Power VS service
Expand Down Expand Up @@ -259,19 +259,19 @@ spec:
description: Name of resource
minLength: 1
type: string
vpcZone:
zone:
description: IBM Cloud VPC zone
type: string
type: object
zone:
description: zone is the name of Power VS zone where the cluster will
be created
be created possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server.
when value for serviceInstance is omitted its required to set the
value for zone.
type: string
required:
- network
- resourceGroup
- serviceInstanceID
- zone
type: object
status:
description: IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ spec:
type: object
network:
description: Network is the reference to the Network to use
for this cluster. When the field is omitted, A DHCP service
for this cluster. when the field is omitted, A DHCP service
will be created in the service instance and its private
network will be used.
properties:
Expand All @@ -232,7 +232,8 @@ spec:
type: object
resourceGroup:
description: resourceGroup name under which the resources
will be created.
will be created. when omitted Default resource group will
be used.
type: string
serviceInstance:
description: serviceInstance is the reference to the Power
Expand Down Expand Up @@ -288,19 +289,19 @@ spec:
description: Name of resource
minLength: 1
type: string
vpcZone:
zone:
description: IBM Cloud VPC zone
type: string
type: object
zone:
description: zone is the name of Power VS zone where the cluster
will be created
will be created possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server.
when value for serviceInstance is omitted its required to
set the value for zone.
type: string
required:
- network
- resourceGroup
- serviceInstanceID
- zone
type: object
required:
- spec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,6 @@ spec:
description: Name of resource
minLength: 1
type: string
vpcZone:
description: IBM Cloud VPC zone
type: string
type: object
name:
description: Name of the instance.
Expand Down Expand Up @@ -289,9 +286,6 @@ spec:
description: Name of resource
minLength: 1
type: string
vpcZone:
description: IBM Cloud VPC zone
type: string
type: object
type: array
zone:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ spec:
description: Name of resource
minLength: 1
type: string
vpcZone:
description: IBM Cloud VPC zone
type: string
type: object
name:
description: Name of the instance.
Expand Down Expand Up @@ -281,9 +278,6 @@ spec:
description: Name of resource
minLength: 1
type: string
vpcZone:
description: IBM Cloud VPC zone
type: string
type: object
type: array
zone:
Expand Down

0 comments on commit 91fb6bf

Please sign in to comment.