You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Validate CRD Spec fields
This configures the CRD to require that we have either a CAPI Cluster
ref, or a Secret ref.
GitopsClusters will be rejected if they have neither, or have both.
Co-authored-by: Yiannis Triantafyllopoulos <8741709+yiannistri@users.noreply.github.com>
// GitopsClusterSpec defines the desired state of GitopsCluster
31
+
// +kubebuilder:validation:XValidation:rule="(has(self.secretRef) || has(self.capiClusterRef))",message="must provide a secretRef or capiClusterRef"
32
+
// +kubebuilder:validation:XValidation:rule="!(has(self.secretRef) && has(self.capiClusterRef))",message="cannot provide both capiClusterRef and secretRef"
31
33
typeGitopsClusterSpecstruct {
32
34
// SecretRef specifies the Secret containing the kubeconfig for a cluster.
33
35
// +optional
@@ -62,6 +64,7 @@ func (in *GitopsCluster) SetConditions(conditions []metav1.Condition) {
0 commit comments