Skip to content

Commit f8580ea

Browse files
authored
chore: codify host comment (#200)
1 parent a6fcb8b commit f8580ea

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

apis/v1alpha1/clusteraccess_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type ClusterAccess struct {
1919
}
2020

2121
// ClusterAccessSpec defines the desired state of ClusterAccess
22+
// +kubebuilder:validation:XValidation:rule="has(self.host) || (has(self.auth) && has(self.auth.kubeconfigSecretRef))",message="host is required unless kubeconfigSecretRef auth is used"
2223
type ClusterAccessSpec struct {
2324
// Path is an optional field. If not set, the name of the resource is used
2425
// +optional

config/crd/gateway.platform-mesh.io_clusteraccesses.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ spec:
149149
resource is used
150150
type: string
151151
type: object
152+
x-kubernetes-validations:
153+
- message: host is required unless kubeconfigSecretRef auth is used
154+
rule: has(self.host) || (has(self.auth) && has(self.auth.kubeconfigSecretRef))
152155
status:
153156
description: ClusterAccessStatus defines the observed state of ClusterAccess.
154157
properties:

config/kcp/apiexport-gateway.platform-mesh.io.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
resources:
1111
- group: gateway.platform-mesh.io
1212
name: clusteraccesses
13-
schema: v260409-a121c30.clusteraccesses.gateway.platform-mesh.io
13+
schema: v260410-a6fcb8b.clusteraccesses.gateway.platform-mesh.io
1414
storage:
1515
crd: {}
1616
status: {}

config/kcp/apiresourceschema-clusteraccesses.gateway.platform-mesh.io.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: apis.kcp.io/v1alpha1
22
kind: APIResourceSchema
33
metadata:
4-
name: v260409-a121c30.clusteraccesses.gateway.platform-mesh.io
4+
name: v260410-a6fcb8b.clusteraccesses.gateway.platform-mesh.io
55
spec:
66
group: gateway.platform-mesh.io
77
names:
@@ -144,6 +144,9 @@ spec:
144144
resource is used
145145
type: string
146146
type: object
147+
x-kubernetes-validations:
148+
- message: host is required unless kubeconfigSecretRef auth is used
149+
rule: has(self.host) || (has(self.auth) && has(self.auth.kubeconfigSecretRef))
147150
status:
148151
description: ClusterAccessStatus defines the observed state of ClusterAccess.
149152
properties:

0 commit comments

Comments
 (0)