Skip to content

Commit 010fb9b

Browse files
authored
refactor: adapt cluster config reference struct to reality (#73)
1 parent dc3a38d commit 010fb9b

File tree

3 files changed

+5
-44
lines changed

3 files changed

+5
-44
lines changed

api/clusters/v1alpha1/cluster_types.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type ClusterSpec struct {
1717

1818
// ClusterConfigRef is a reference to a cluster configuration.
1919
// +optional
20-
ClusterConfigRef *ClusterConfigRef `json:"clusterConfigRef,omitempty"`
20+
ClusterConfigRef *ObjectReference `json:"clusterConfigRef,omitempty"`
2121

2222
// Kubernetes configuration for the cluster.
2323
Kubernetes K8sConfiguration `json:"kubernetes,omitempty"`
@@ -31,20 +31,6 @@ type ClusterSpec struct {
3131
Tenancy Tenancy `json:"tenancy"`
3232
}
3333

34-
// ClusterConfigRef is a reference to a cluster configuration.
35-
type ClusterConfigRef struct {
36-
// APIGroup is the group for the resource being referenced.
37-
// +kubebuilder:validation:MinLength=1
38-
APIGroup string `json:"apiGroup"`
39-
// Kind is the kind of the resource being referenced.
40-
// +kubebuilder:validation:MinLength=1
41-
Kind string `json:"kind"`
42-
// Name is the name of the resource being referenced.
43-
// Defaults to the name of the referencing resource, if not specified.
44-
// +optional
45-
Name string `json:"name,omitempty"`
46-
}
47-
4834
type K8sConfiguration struct {
4935
// Version is the k8s version of the cluster.
5036
Version string `json:"version,omitempty"`

api/clusters/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 16 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: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,12 @@ spec:
7272
clusterConfigRef:
7373
description: ClusterConfigRef is a reference to a cluster configuration.
7474
properties:
75-
apiGroup:
76-
description: APIGroup is the group for the resource being referenced.
77-
minLength: 1
78-
type: string
79-
kind:
80-
description: Kind is the kind of the resource being referenced.
81-
minLength: 1
82-
type: string
8375
name:
84-
description: |-
85-
Name is the name of the resource being referenced.
86-
Defaults to the name of the referencing resource, if not specified.
76+
description: Name is the name of the referenced resource.
77+
minLength: 1
8778
type: string
8879
required:
89-
- apiGroup
90-
- kind
80+
- name
9181
type: object
9282
kubernetes:
9383
description: Kubernetes configuration for the cluster.

0 commit comments

Comments
 (0)