diff --git a/apis/cluster/types.go b/apis/cluster/types.go index c06b5620..f89969a5 100644 --- a/apis/cluster/types.go +++ b/apis/cluster/types.go @@ -47,12 +47,24 @@ type ProviderOptions struct { } type ComponentOptions struct { - FluxCD bool `json:"fluxCD,omitempty"` - FeatureSets []FeatureSet `json:"featureSets,omitempty"` - AllFeatures bool `json:"allFeatures,omitempty"` - ClusterProfile string `json:"clusterProfile,omitempty"` - MonitoringClusterName string `json:"monitoringClusterName,omitempty"` - SpokeComponents bool `json:"spokeComponent,omitempty"` + FluxCD bool `json:"fluxCD,omitempty"` + ArgoCD ArgoCDOptions `json:"argoCD,omitempty"` + FeatureSets []FeatureSet `json:"featureSets,omitempty"` + AllFeatures bool `json:"allFeatures,omitempty"` + ClusterProfile string `json:"clusterProfile,omitempty"` + MonitoringClusterName string `json:"monitoringClusterName,omitempty"` + SpokeComponents bool `json:"spokeComponent,omitempty"` +} + +// ArgoCDOptions picks the cluster's Argo CD GitOps strategy: standalone, +// central (PrincipalClusterName), existing (ExistingClusterName/Kubeconfig), or self-as-principal (DeployPrincipal). +type ArgoCDOptions struct { + Enabled bool `json:"enabled,omitempty"` + PrincipalClusterName string `json:"principalClusterName,omitempty"` + ExistingClusterName string `json:"existingClusterName,omitempty"` + ExistingKubeconfig string `json:"existingKubeconfig,omitempty"` + DeployPrincipal bool `json:"deployPrincipal,omitempty"` + PrincipalServiceType string `json:"principalServiceType,omitempty"` } type FeatureSet struct { diff --git a/apis/config/v1alpha1/setupconfig_types.go b/apis/config/v1alpha1/setupconfig_types.go index 095f5913..3d85035b 100644 --- a/apis/config/v1alpha1/setupconfig_types.go +++ b/apis/config/v1alpha1/setupconfig_types.go @@ -117,6 +117,8 @@ type SelfManagement struct { UseGateway bool `json:"useGateway"` // +optional EnableCredLess bool `json:"enableCredLess"` + // +optional + ArgoCD ArgoCDOptions `json:"argoCD,omitempty"` } type SelfManagementOptions struct { @@ -134,6 +136,8 @@ type SelfManagementOptions struct { UseGateway bool `json:"useGateway"` // +optional EnableCredLess bool `json:"enableCredLess"` + // +optional + ArgoCD ArgoCDOptions `json:"argoCD,omitempty"` } type EnableFeaturesOptions map[string]FeatureSetOptions @@ -176,9 +180,21 @@ func (opt SelfManagementOptions) ToConfig() SelfManagement { KubeAPIServer: opt.KubeAPIServer, UseGateway: opt.UseGateway, EnableCredLess: opt.EnableCredLess, + ArgoCD: opt.ArgoCD, } } +type ArgoCDOptions struct { + // +optional + Enabled bool `json:"enabled,omitempty"` + // +optional + ExistingKubeconfig string `json:"existingKubeconfig,omitempty"` + // +optional + DeployPrincipal bool `json:"deployPrincipal,omitempty"` + // +optional + PrincipalServiceType string `json:"principalServiceType,omitempty"` +} + type CAPIClusterConfig struct { ClusterName string `json:"clusterName,omitempty"` Region string `json:"region,omitempty"` diff --git a/apis/config/v1alpha1/zz_generated.deepcopy.go b/apis/config/v1alpha1/zz_generated.deepcopy.go index 70a9d3c0..e6d4e7ac 100644 --- a/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -152,6 +152,22 @@ func (in *AceSetupInlineOptions) DeepCopy() *AceSetupInlineOptions { return out } +// 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 + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoCDOptions. +func (in *ArgoCDOptions) DeepCopy() *ArgoCDOptions { + if in == nil { + return nil + } + out := new(ArgoCDOptions) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureSubscriptionInfo) DeepCopyInto(out *AzureSubscriptionInfo) { *out = *in @@ -334,6 +350,7 @@ func (in *SelfManagement) DeepCopyInto(out *SelfManagement) { *out = make([]string, len(*in)) copy(*out, *in) } + out.ArgoCD = in.ArgoCD return } @@ -362,6 +379,7 @@ func (in *SelfManagementOptions) DeepCopyInto(out *SelfManagementOptions) { *out = make([]string, len(*in)) copy(*out, *in) } + out.ArgoCD = in.ArgoCD return }