Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions api/v1alpha1/provisioning_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import (
operatorv1 "github.com/openshift/api/operator/v1"
)

// ProvisioningNetwork is the boot mode of the system
// +kubebuilder:validation:Enum=Managed;Unmanaged;Disabled
type ProvisioningNetwork string

// ProvisioningSpec defines the desired state of Provisioning
type ProvisioningSpec struct {
// ProvisioningInterface is the name of the network interface
Expand Down Expand Up @@ -84,14 +88,17 @@ type ProvisioningSpec struct {
// installation. If using metal3 for power management, BMCs must be
// accessible from the machine networks. User should provide two IPs on
// the external network that would be used for provisioning services.
ProvisioningNetwork string `json:"provisioningNetwork,omitempty"`
ProvisioningNetwork ProvisioningNetwork `json:"provisioningNetwork,omitempty"`
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the type of ProvisioningNetwork has changed but in the resulting yaml file it is still a string.


// ProvisioningStatus defines the observed state of Provisioning
type ProvisioningStatus struct {
operatorv1.OperatorStatus `json:",inline"`
}

// +kubebuilder:resource:path=provisionings,scope=Cluster
// +kubebuilder:subresource:status

// Provisioning contains configuration used by the Provisioning
// service (Ironic) to provision baremetal hosts.
// Provisioning is created by the OpenShift installer using admin or
Expand All @@ -100,12 +107,7 @@ type ProvisioningStatus struct {
// This CR is a singleton, created by the installer and currently only
// consumed by the cluster-baremetal-operator to bring up and update
// containers in a metal3 cluster.

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=provisionings,scope=Cluster
// +kubebuilder:subresource:status

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason for moving these back up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Provisioning is the Schema for the provisionings API
type Provisioning struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
6 changes: 5 additions & 1 deletion config/crd/bases/metal3.io_provisionings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
status: {}
validation:
openAPIV3Schema:
description: Provisioning is the Schema for the provisionings API
description: Provisioning contains configuration used by the Provisioning service (Ironic) to provision baremetal hosts. Provisioning is created by the OpenShift installer using admin or user provided information about the provisioning network and the NIC on the server that can be used to PXE boot it. This CR is a singleton, created by the installer and currently only consumed by the cluster-baremetal-operator to bring up and update containers in a metal3 cluster.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
Expand All @@ -45,6 +45,10 @@ spec:
type: string
provisioningNetwork:
description: ProvisioningNetwork provides a way to indicate the state of the underlying network configuration for the provisioning network. This field can have one of the following values - `Managed`- when the provisioning network is completely managed by the Baremetal IPI solution. `Unmanaged`- when the provsioning network is present and used but the user is responsible for managing DHCP. Virtual media provisioning is recommended but PXE is still available if required. `Disabled`- when the provisioning network is fully disabled. User can bring up the baremetal cluster using virtual media or assisted installation. If using metal3 for power management, BMCs must be accessible from the machine networks. User should provide two IPs on the external network that would be used for provisioning services.
enum:
- Managed
- Unmanaged
- Disabled
type: string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making the change in #19 (comment) made these changes in 46 - 49 disappear.

provisioningNetworkCIDR:
description: ProvisioningNetworkCIDR is the network on which the baremetal nodes are provisioned. The provisioningIP and the IPs in the dhcpRange all come from within this network.
Expand Down