diff --git a/apis/cluster/types.go b/apis/cluster/types.go index f89969a5..077186a7 100644 --- a/apis/cluster/types.go +++ b/apis/cluster/types.go @@ -57,12 +57,22 @@ type ComponentOptions struct { } // ArgoCDOptions picks the cluster's Argo CD GitOps strategy: standalone, -// central (PrincipalClusterName), existing (ExistingClusterName/Kubeconfig), or self-as-principal (DeployPrincipal). +// central (PrincipalClusterName), existing (ManagedArgo), or self-as-principal (InClusterArgo.DeployPrincipal). type ArgoCDOptions struct { - Enabled bool `json:"enabled,omitempty"` - PrincipalClusterName string `json:"principalClusterName,omitempty"` - ExistingClusterName string `json:"existingClusterName,omitempty"` - ExistingKubeconfig string `json:"existingKubeconfig,omitempty"` + Enabled bool `json:"enabled,omitempty"` + PrincipalClusterName string `json:"principalClusterName,omitempty"` + ManagedArgo *ManagedArgo `json:"managedArgo,omitempty"` + InClusterArgo *InClusterArgo `json:"inClusterArgo,omitempty"` +} + +type ManagedArgo struct { + ExistingKubeconfig string `json:"existingKubeconfig,omitempty"` + // Name this cluster is registered as inside the existing Argo CD + ArgoCDClusterName string `json:"argoCDClusterName,omitempty"` + Namespace string `json:"namespace,omitempty"` +} + +type InClusterArgo struct { DeployPrincipal bool `json:"deployPrincipal,omitempty"` PrincipalServiceType string `json:"principalServiceType,omitempty"` } diff --git a/apis/config/v1alpha1/setupconfig_types.go b/apis/config/v1alpha1/setupconfig_types.go index 3d85035b..f6bd146f 100644 --- a/apis/config/v1alpha1/setupconfig_types.go +++ b/apis/config/v1alpha1/setupconfig_types.go @@ -187,10 +187,26 @@ func (opt SelfManagementOptions) ToConfig() SelfManagement { type ArgoCDOptions struct { // +optional Enabled bool `json:"enabled,omitempty"` + // +optional + ManagedArgo *ManagedArgo `json:"managedArgo,omitempty"` + // +optional + InClusterArgo *InClusterArgo `json:"inClusterArgo,omitempty"` +} + +type ManagedArgo struct { // +optional ExistingKubeconfig string `json:"existingKubeconfig,omitempty"` + // Name this cluster is registered as inside the existing Argo CD + // +optional + ArgoCDClusterName string `json:"argoCDClusterName,omitempty"` + // +optional + Namespace string `json:"namespace,omitempty"` +} + +type InClusterArgo struct { // +optional DeployPrincipal bool `json:"deployPrincipal,omitempty"` + // +kubebuilder:validation:Enum=LoadBalancer;NodePort // +optional PrincipalServiceType string `json:"principalServiceType,omitempty"` } diff --git a/apis/config/v1alpha1/zz_generated.deepcopy.go b/apis/config/v1alpha1/zz_generated.deepcopy.go index e6d4e7ac..4accf258 100644 --- a/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -155,6 +155,16 @@ func (in *AceSetupInlineOptions) DeepCopy() *AceSetupInlineOptions { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArgoCDOptions) DeepCopyInto(out *ArgoCDOptions) { *out = *in + if in.ManagedArgo != nil { + in, out := &in.ManagedArgo, &out.ManagedArgo + *out = new(ManagedArgo) + **out = **in + } + if in.InClusterArgo != nil { + in, out := &in.InClusterArgo, &out.InClusterArgo + *out = new(InClusterArgo) + **out = **in + } return } @@ -269,6 +279,22 @@ func (in *GCPSubscriptionInfo) DeepCopy() *GCPSubscriptionInfo { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InClusterArgo) DeepCopyInto(out *InClusterArgo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InClusterArgo. +func (in *InClusterArgo) DeepCopy() *InClusterArgo { + if in == nil { + return nil + } + out := new(InClusterArgo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachinePool) DeepCopyInto(out *MachinePool) { *out = *in @@ -285,6 +311,22 @@ func (in *MachinePool) DeepCopy() *MachinePool { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedArgo) DeepCopyInto(out *ManagedArgo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedArgo. +func (in *ManagedArgo) DeepCopy() *ManagedArgo { + if in == nil { + return nil + } + out := new(ManagedArgo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MarketplaceSubscriptionInfo) DeepCopyInto(out *MarketplaceSubscriptionInfo) { *out = *in @@ -350,7 +392,7 @@ func (in *SelfManagement) DeepCopyInto(out *SelfManagement) { *out = make([]string, len(*in)) copy(*out, *in) } - out.ArgoCD = in.ArgoCD + in.ArgoCD.DeepCopyInto(&out.ArgoCD) return } @@ -379,7 +421,7 @@ func (in *SelfManagementOptions) DeepCopyInto(out *SelfManagementOptions) { *out = make([]string, len(*in)) copy(*out, *in) } - out.ArgoCD = in.ArgoCD + in.ArgoCD.DeepCopyInto(&out.ArgoCD) return }