Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
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
22 changes: 19 additions & 3 deletions api/v1alpha1/clusterorder_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import (
// ClusterOrderSpec defines the desired state of ClusterOrder
type ClusterOrderSpec struct {
// TemplateID is the unique identigier of the cluster template to use when creating this cluster
// +kubebuilder:validation:Required
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Pattern=`^[a-z][-a-z0-9]*[a-z0-9]$`
TemplateID string `json:"templateID,omitempty"`
}

Expand Down Expand Up @@ -63,20 +66,33 @@ const (
// ClusterOrderConditionControlPlaneAvailable means the cluster control plane is ready
ClusterOrderConditionControlPlaneAvailable ClusterOrderConditionType = "ControlPlaneAvailable"

// ClusterOrderConditionNodePoolAvailable means the node pool has the correct number of nodes
ClusterOrderConditionNodePoolAvailable ClusterOrderConditionType = "NodePoolAvailable"

// ClusterOrderConditionAvailable means the cluster is available
ClusterOrderConditionAvailable ClusterOrderConditionType = "Available"
)

// ClusterOrderClusterReferenceType contains a reference to the namespace created by this ClusterOrder
type ClusterOrderClusterReferenceType struct {
// Namespace that contains the HostedCluster resource
Namespace string `json:"namespace"`
HostedClusterName string `json:"hostedClusterName"`
ServiceAccountName string `json:"serviceAccountName"`
}

// ClusterOrderStatus defines the observed state of ClusterOrder
type ClusterOrderStatus struct {
// Phase provides a single-value overview of the state of the ClusterOrder
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Enum=Unknown;Accepted;Progressing;Failed;Ready
Phase ClusterOrderPhaseType `json:"phase,omitempty"`

// Conditions holds an array of metav1.Condition that describe the state of the ClusterOrder
// +kubebuilder:validation:Optional
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`

// Reference to the namespace that contains the HostedCluster resource
// +kubebuilder:validation:Optional
ClusterReference *ClusterOrderClusterReferenceType `json:"clusterReference,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

25 changes: 25 additions & 0 deletions config/crd/bases/cloudkit.openshift.io_clusterorders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,30 @@ spec:
templateID:
description: TemplateID is the unique identigier of the cluster template
to use when creating this cluster
pattern: ^[a-z][-a-z0-9]*[a-z0-9]$
type: string
required:
- templateID
type: object
status:
description: ClusterOrderStatus defines the observed state of ClusterOrder
properties:
clusterReference:
description: Reference to the namespace that contains the HostedCluster
resource
properties:
hostedClusterName:
type: string
namespace:
description: Namespace that contains the HostedCluster resource
type: string
serviceAccountName:
type: string
required:
- hostedClusterName
- namespace
- serviceAccountName
type: object
conditions:
description: Conditions holds an array of metav1.Condition that describe
the state of the ClusterOrder
Expand Down Expand Up @@ -108,6 +127,12 @@ spec:
phase:
description: Phase provides a single-value overview of the state of
the ClusterOrder
enum:
- Unknown
- Accepted
- Progressing
- Failed
- Ready
type: string
type: object
type: object
Expand Down