Skip to content

Commit 2b26043

Browse files
authored
feat: allow a Cluster to reference multiple cluster configurations (#82)
1 parent d72589e commit 2b26043

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

api/clusters/v1alpha1/cluster_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ type ClusterSpec struct {
1515
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="profile is immutable"
1616
Profile string `json:"profile"`
1717

18-
// ClusterConfigRef is a reference to a cluster configuration.
18+
// ClusterConfigs allows to reference any amount of provider-specific cluster configuration objects.
19+
// The k8s resource kind that is referenced by this depends on the provider (which is defined by the profile).
1920
// +optional
20-
ClusterConfigRef *ObjectReference `json:"clusterConfigRef,omitempty"`
21+
ClusterConfigs []ObjectReference `json:"clusterConfigs,omitempty"`
2122

2223
// Kubernetes configuration for the cluster.
2324
Kubernetes K8sConfiguration `json:"kubernetes,omitempty"`

api/clusters/v1alpha1/zz_generated.deepcopy.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/crds/manifests/clusters.openmcp.cloud_clusters.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,20 @@ spec:
6969
spec:
7070
description: ClusterSpec defines the desired state of Cluster
7171
properties:
72-
clusterConfigRef:
73-
description: ClusterConfigRef is a reference to a cluster configuration.
74-
properties:
75-
name:
76-
description: Name is the name of the referenced resource.
77-
minLength: 1
78-
type: string
79-
required:
80-
- name
81-
type: object
72+
clusterConfigs:
73+
description: |-
74+
ClusterConfigs allows to reference any amount of provider-specific cluster configuration objects.
75+
The k8s resource kind that is referenced by this depends on the provider (which is defined by the profile).
76+
items:
77+
properties:
78+
name:
79+
description: Name is the name of the referenced resource.
80+
minLength: 1
81+
type: string
82+
required:
83+
- name
84+
type: object
85+
type: array
8286
kubernetes:
8387
description: Kubernetes configuration for the cluster.
8488
properties:

0 commit comments

Comments
 (0)