From ca00599fbf8343aff552d5a5e8c98aed752c84f3 Mon Sep 17 00:00:00 2001 From: Akuity Bot Date: Tue, 2 Jul 2024 19:44:17 +0000 Subject: [PATCH 01/26] Automatic Update Crossplane Types to v0.14.0 --- apis/core/v1alpha1/zz_generated.deepcopy.go | 2 +- .../akuity/v1alpha1/argocdinstance_types.go | 17 + .../akuity/v1alpha1/cluster_types.go | 33 +- .../akuity/v1alpha1/zz_generated.deepcopy.go | 168 +++++- .../argocd/v1alpha1/zz_generated.deepcopy.go | 1 - .../v1alpha1/argocdinstance_types.go | 33 +- .../crossplane/v1alpha1/cluster_types.go | 40 +- .../v1alpha1/configmanagementplugin_types.go | 5 + .../v1alpha1/zz_generated.deepcopy.go | 490 +++++++++++++----- .../core.akuity.crossplane.io_clusters.yaml | 28 + .../core.akuity.crossplane.io_instances.yaml | 58 +++ 11 files changed, 736 insertions(+), 139 deletions(-) diff --git a/apis/core/v1alpha1/zz_generated.deepcopy.go b/apis/core/v1alpha1/zz_generated.deepcopy.go index 82e6b79..9bd0ba0 100644 --- a/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -172,7 +172,7 @@ func (in *ClusterObservationStatus) DeepCopy() *ClusterObservationStatus { func (in *ClusterParameters) DeepCopyInto(out *ClusterParameters) { *out = *in out.InstanceRef = in.InstanceRef - out.ClusterSpec = in.ClusterSpec + in.ClusterSpec.DeepCopyInto(&out.ClusterSpec) if in.Annotations != nil { in, out := &in.Annotations, &out.Annotations *out = make(map[string]string, len(*in)) diff --git a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go index 9d5ffaf..fb7e4d1 100644 --- a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go @@ -58,6 +58,20 @@ type AppsetPolicy struct { OverridePolicy bool `json:"overridePolicy,omitempty"` } +type AgentPermissionsRule struct { + ApiGroups []string `json:"apiGroups,omitempty"` + Resources []string `json:"resources,omitempty"` + Verbs []string `json:"verbs,omitempty"` +} + +type CrossplaneExtensionResource struct { + Group string `json:"group,omitempty"` +} + +type CrossplaneExtension struct { + Resources []*CrossplaneExtensionResource `json:"resources,omitempty"` +} + type InstanceSpec struct { IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` Subdomain string `json:"subdomain,omitempty"` @@ -69,11 +83,14 @@ type InstanceSpec struct { RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` + CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` HostAliases []*HostAliases `json:"hostAliases,omitempty"` + AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` + Fqdn string `json:"fqdn,omitempty"` } type ManagedCluster struct { diff --git a/internal/types/generated/akuity/v1alpha1/cluster_types.go b/internal/types/generated/akuity/v1alpha1/cluster_types.go index 84a1b42..6f7be0c 100644 --- a/internal/types/generated/akuity/v1alpha1/cluster_types.go +++ b/internal/types/generated/akuity/v1alpha1/cluster_types.go @@ -23,6 +23,8 @@ type Cluster struct { type ClusterSize string +type DirectClusterType string + //+kubebuilder:object:root=true // ClusterList contains a list of Cluster @@ -42,11 +44,30 @@ type ClusterSpec struct { Data ClusterData `json:"data,omitempty"` } +type DirectClusterSpec struct { + ClusterType DirectClusterType `json:"clusterType,omitempty"` + KargoInstanceId *string `json:"kargoInstanceId,omitempty"` + Server *string `json:"server,omitempty"` + Organization *string `json:"organization,omitempty"` + Token *string `json:"token,omitempty"` + CaData *string `json:"caData,omitempty"` +} + +type ManagedClusterConfig struct { + SecretName string `json:"secretName,omitempty"` + SecretKey string `json:"secretKey,omitempty"` +} + type ClusterData struct { - Size ClusterSize `json:"size,omitempty"` - AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization runtime.RawExtension `json:"kustomization,omitempty"` - AppReplication *bool `json:"appReplication,omitempty"` - TargetVersion string `json:"targetVersion,omitempty"` - RedisTunneling *bool `json:"redisTunneling,omitempty"` + Size ClusterSize `json:"size,omitempty"` + AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization runtime.RawExtension `json:"kustomization,omitempty"` + AppReplication *bool `json:"appReplication,omitempty"` + TargetVersion string `json:"targetVersion,omitempty"` + RedisTunneling *bool `json:"redisTunneling,omitempty"` + DirectClusterSpec *DirectClusterSpec `json:"directClusterSpec,omitempty"` + DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` + EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` + ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` + MaintenanceMode *bool `json:"maintenanceMode,omitempty"` } diff --git a/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go index 1caf47d..bbfa1d3 100644 --- a/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. @@ -9,6 +8,36 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentPermissionsRule) DeepCopyInto(out *AgentPermissionsRule) { + *out = *in + if in.ApiGroups != nil { + in, out := &in.ApiGroups, &out.ApiGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Verbs != nil { + in, out := &in.Verbs, &out.Verbs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentPermissionsRule. +func (in *AgentPermissionsRule) DeepCopy() *AgentPermissionsRule { + if in == nil { + return nil + } + out := new(AgentPermissionsRule) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AppSetDelegate) DeepCopyInto(out *AppSetDelegate) { *out = *in @@ -194,6 +223,31 @@ func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = new(bool) **out = **in } + if in.DirectClusterSpec != nil { + in, out := &in.DirectClusterSpec, &out.DirectClusterSpec + *out = new(DirectClusterSpec) + (*in).DeepCopyInto(*out) + } + if in.DatadogAnnotationsEnabled != nil { + in, out := &in.DatadogAnnotationsEnabled, &out.DatadogAnnotationsEnabled + *out = new(bool) + **out = **in + } + if in.EksAddonEnabled != nil { + in, out := &in.EksAddonEnabled, &out.EksAddonEnabled + *out = new(bool) + **out = **in + } + if in.ManagedClusterConfig != nil { + in, out := &in.ManagedClusterConfig, &out.ManagedClusterConfig + *out = new(ManagedClusterConfig) + **out = **in + } + if in.MaintenanceMode != nil { + in, out := &in.MaintenanceMode, &out.MaintenanceMode + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterData. @@ -254,6 +308,87 @@ func (in *ClusterSpec) DeepCopy() *ClusterSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CrossplaneExtension) DeepCopyInto(out *CrossplaneExtension) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]*CrossplaneExtensionResource, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(CrossplaneExtensionResource) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossplaneExtension. +func (in *CrossplaneExtension) DeepCopy() *CrossplaneExtension { + if in == nil { + return nil + } + out := new(CrossplaneExtension) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CrossplaneExtensionResource) DeepCopyInto(out *CrossplaneExtensionResource) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossplaneExtensionResource. +func (in *CrossplaneExtensionResource) DeepCopy() *CrossplaneExtensionResource { + if in == nil { + return nil + } + out := new(CrossplaneExtensionResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DirectClusterSpec) DeepCopyInto(out *DirectClusterSpec) { + *out = *in + if in.KargoInstanceId != nil { + in, out := &in.KargoInstanceId, &out.KargoInstanceId + *out = new(string) + **out = **in + } + if in.Server != nil { + in, out := &in.Server, &out.Server + *out = new(string) + **out = **in + } + if in.Organization != nil { + in, out := &in.Organization, &out.Organization + *out = new(string) + **out = **in + } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(string) + **out = **in + } + if in.CaData != nil { + in, out := &in.CaData, &out.CaData + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DirectClusterSpec. +func (in *DirectClusterSpec) DeepCopy() *DirectClusterSpec { + if in == nil { + return nil + } + out := new(DirectClusterSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HostAliases) DeepCopyInto(out *HostAliases) { *out = *in @@ -344,6 +479,11 @@ func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { *out = new(RepoServerDelegate) (*in).DeepCopyInto(*out) } + if in.CrossplaneExtension != nil { + in, out := &in.CrossplaneExtension, &out.CrossplaneExtension + *out = new(CrossplaneExtension) + (*in).DeepCopyInto(*out) + } if in.ImageUpdaterDelegate != nil { in, out := &in.ImageUpdaterDelegate, &out.ImageUpdaterDelegate *out = new(ImageUpdaterDelegate) @@ -370,6 +510,17 @@ func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { } } } + if in.AgentPermissionsRules != nil { + in, out := &in.AgentPermissionsRules, &out.AgentPermissionsRules + *out = make([]*AgentPermissionsRule, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(AgentPermissionsRule) + (*in).DeepCopyInto(*out) + } + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec. @@ -397,6 +548,21 @@ func (in *ManagedCluster) DeepCopy() *ManagedCluster { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterConfig) DeepCopyInto(out *ManagedClusterConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterConfig. +func (in *ManagedClusterConfig) DeepCopy() *ManagedClusterConfig { + if in == nil { + return nil + } + out := new(ManagedClusterConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RepoServerDelegate) DeepCopyInto(out *RepoServerDelegate) { *out = *in diff --git a/internal/types/generated/argocd/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/argocd/v1alpha1/zz_generated.deepcopy.go index 632857a..d53dc96 100644 --- a/internal/types/generated/argocd/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/argocd/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. diff --git a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go index 64c5f08..1a61ebb 100644 --- a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go @@ -10,6 +10,11 @@ type ArgoCD struct { Spec ArgoCDSpec `json:"spec,omitempty"` } +// +kubebuilder:object:generate=true +type ArgoCDList struct { + Items []ArgoCD `json:"items"` +} + // +kubebuilder:object:generate=true type ArgoCDSpec struct { Description string `json:"description,omitempty"` @@ -25,10 +30,10 @@ type ArgoCDExtensionInstallEntry struct { // +kubebuilder:object:generate=true type ClusterCustomization struct { - AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization string `json:"kustomization,omitempty"` - AppReplication bool `json:"appReplication,omitempty"` - RedisTunneling bool `json:"redisTunneling,omitempty"` + AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization string `json:"kustomization,omitempty"` + AppReplication bool `json:"appReplication,omitempty"` + RedisTunneling bool `json:"redisTunneling,omitempty"` } // +kubebuilder:object:generate=true @@ -37,6 +42,23 @@ type AppsetPolicy struct { OverridePolicy bool `json:"overridePolicy,omitempty"` } +// +kubebuilder:object:generate=true +type AgentPermissionsRule struct { + ApiGroups []string `json:"apiGroups,omitempty"` + Resources []string `json:"resources,omitempty"` + Verbs []string `json:"verbs,omitempty"` +} + +// +kubebuilder:object:generate=true +type CrossplaneExtensionResource struct { + Group string `json:"group,omitempty"` +} + +// +kubebuilder:object:generate=true +type CrossplaneExtension struct { + Resources []*CrossplaneExtensionResource `json:"resources,omitempty"` +} + // +kubebuilder:object:generate=true type InstanceSpec struct { IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` @@ -49,11 +71,14 @@ type InstanceSpec struct { RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` + CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` HostAliases []*HostAliases `json:"hostAliases,omitempty"` + AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` + Fqdn string `json:"fqdn,omitempty"` } // +kubebuilder:object:generate=true diff --git a/internal/types/generated/crossplane/v1alpha1/cluster_types.go b/internal/types/generated/crossplane/v1alpha1/cluster_types.go index 3b83782..82d7087 100644 --- a/internal/types/generated/crossplane/v1alpha1/cluster_types.go +++ b/internal/types/generated/crossplane/v1alpha1/cluster_types.go @@ -7,11 +7,18 @@ package v1alpha1 type ClusterSize string +type DirectClusterType string + // +kubebuilder:object:generate=true type Cluster struct { Spec ClusterSpec `json:"spec,omitempty"` } +// +kubebuilder:object:generate=true +type ClusterList struct { + Items []Cluster `json:"items"` +} + // +kubebuilder:object:generate=true type ClusterSpec struct { Description string `json:"description,omitempty"` @@ -19,12 +26,33 @@ type ClusterSpec struct { Data ClusterData `json:"data,omitempty"` } +// +kubebuilder:object:generate=true +type DirectClusterSpec struct { + ClusterType DirectClusterType `json:"clusterType,omitempty"` + KargoInstanceId *string `json:"kargoInstanceId,omitempty"` + Server *string `json:"server,omitempty"` + Organization *string `json:"organization,omitempty"` + Token *string `json:"token,omitempty"` + CaData *string `json:"caData,omitempty"` +} + +// +kubebuilder:object:generate=true +type ManagedClusterConfig struct { + SecretName string `json:"secretName,omitempty"` + SecretKey string `json:"secretKey,omitempty"` +} + // +kubebuilder:object:generate=true type ClusterData struct { - Size ClusterSize `json:"size,omitempty"` - AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization string `json:"kustomization,omitempty"` - AppReplication bool `json:"appReplication,omitempty"` - TargetVersion string `json:"targetVersion,omitempty"` - RedisTunneling bool `json:"redisTunneling,omitempty"` + Size ClusterSize `json:"size,omitempty"` + AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization string `json:"kustomization,omitempty"` + AppReplication bool `json:"appReplication,omitempty"` + TargetVersion string `json:"targetVersion,omitempty"` + RedisTunneling bool `json:"redisTunneling,omitempty"` + DirectClusterSpec *DirectClusterSpec `json:"directClusterSpec,omitempty"` + DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` + EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` + ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` + MaintenanceMode *bool `json:"maintenanceMode,omitempty"` } diff --git a/internal/types/generated/crossplane/v1alpha1/configmanagementplugin_types.go b/internal/types/generated/crossplane/v1alpha1/configmanagementplugin_types.go index 7cd67b9..62ab046 100644 --- a/internal/types/generated/crossplane/v1alpha1/configmanagementplugin_types.go +++ b/internal/types/generated/crossplane/v1alpha1/configmanagementplugin_types.go @@ -12,6 +12,11 @@ type ConfigManagementPlugin struct { Spec PluginSpec `json:"spec,omitempty"` } +// +kubebuilder:object:generate=true +type ConfigManagementPluginList struct { + Items []ConfigManagementPlugin `json:"items"` +} + // +kubebuilder:object:generate=true type PluginSpec struct { Version string `json:"version,omitempty"` diff --git a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go index 55e0da1..2dbe872 100644 --- a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go @@ -1,10 +1,41 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. package v1alpha1 +import () + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentPermissionsRule) DeepCopyInto(out *AgentPermissionsRule) { + *out = *in + if in.ApiGroups != nil { + in, out := &in.ApiGroups, &out.ApiGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Verbs != nil { + in, out := &in.Verbs, &out.Verbs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentPermissionsRule. +func (in *AgentPermissionsRule) DeepCopy() *AgentPermissionsRule { + if in == nil { + return nil + } + out := new(AgentPermissionsRule) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AppSetDelegate) DeepCopyInto(out *AppSetDelegate) { *out = *in @@ -71,6 +102,28 @@ func (in *ArgoCDExtensionInstallEntry) DeepCopy() *ArgoCDExtensionInstallEntry { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArgoCDList) DeepCopyInto(out *ArgoCDList) { + *out = *in + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ArgoCD, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoCDList. +func (in *ArgoCDList) DeepCopy() *ArgoCDList { + if in == nil { + return nil + } + out := new(ArgoCDList) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArgoCDSpec) DeepCopyInto(out *ArgoCDSpec) { *out = *in @@ -87,6 +140,22 @@ func (in *ArgoCDSpec) DeepCopy() *ArgoCDSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cluster) DeepCopyInto(out *Cluster) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. +func (in *Cluster) DeepCopy() *Cluster { + if in == nil { + return nil + } + out := new(Cluster) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterCustomization) DeepCopyInto(out *ClusterCustomization) { *out = *in @@ -105,6 +174,31 @@ func (in *ClusterCustomization) DeepCopy() *ClusterCustomization { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = *in + if in.DirectClusterSpec != nil { + in, out := &in.DirectClusterSpec, &out.DirectClusterSpec + *out = new(DirectClusterSpec) + (*in).DeepCopyInto(*out) + } + if in.DatadogAnnotationsEnabled != nil { + in, out := &in.DatadogAnnotationsEnabled, &out.DatadogAnnotationsEnabled + *out = new(bool) + **out = **in + } + if in.EksAddonEnabled != nil { + in, out := &in.EksAddonEnabled, &out.EksAddonEnabled + *out = new(bool) + **out = **in + } + if in.ManagedClusterConfig != nil { + in, out := &in.ManagedClusterConfig, &out.ManagedClusterConfig + *out = new(ManagedClusterConfig) + **out = **in + } + if in.MaintenanceMode != nil { + in, out := &in.MaintenanceMode, &out.MaintenanceMode + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterData. @@ -117,6 +211,28 @@ func (in *ClusterData) DeepCopy() *ClusterData { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterList) DeepCopyInto(out *ClusterList) { + *out = *in + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Cluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. +func (in *ClusterList) DeepCopy() *ClusterList { + if in == nil { + return nil + } + out := new(ClusterList) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { *out = *in @@ -134,170 +250,196 @@ func (in *ClusterSpec) DeepCopy() *ClusterSpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HostAliases) DeepCopyInto(out *HostAliases) { +func (in *Command) DeepCopyInto(out *Command) { *out = *in - if in.Hostnames != nil { - in, out := &in.Hostnames, &out.Hostnames + if in.Command != nil { + in, out := &in.Command, &out.Command + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Args != nil { + in, out := &in.Args, &out.Args *out = make([]string, len(*in)) copy(*out, *in) } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostAliases. -func (in *HostAliases) DeepCopy() *HostAliases { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Command. +func (in *Command) DeepCopy() *Command { if in == nil { return nil } - out := new(HostAliases) + out := new(Command) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAllowListEntry) DeepCopyInto(out *IPAllowListEntry) { +func (in *ConfigManagementPlugin) DeepCopyInto(out *ConfigManagementPlugin) { *out = *in + in.Spec.DeepCopyInto(&out.Spec) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAllowListEntry. -func (in *IPAllowListEntry) DeepCopy() *IPAllowListEntry { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigManagementPlugin. +func (in *ConfigManagementPlugin) DeepCopy() *ConfigManagementPlugin { if in == nil { return nil } - out := new(IPAllowListEntry) + out := new(ConfigManagementPlugin) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageUpdaterDelegate) DeepCopyInto(out *ImageUpdaterDelegate) { +func (in *ConfigManagementPluginList) DeepCopyInto(out *ConfigManagementPluginList) { *out = *in - if in.ManagedCluster != nil { - in, out := &in.ManagedCluster, &out.ManagedCluster - *out = new(ManagedCluster) - **out = **in + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ConfigManagementPlugin, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdaterDelegate. -func (in *ImageUpdaterDelegate) DeepCopy() *ImageUpdaterDelegate { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigManagementPluginList. +func (in *ConfigManagementPluginList) DeepCopy() *ConfigManagementPluginList { if in == nil { return nil } - out := new(ImageUpdaterDelegate) + out := new(ConfigManagementPluginList) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { +func (in *CrossplaneExtension) DeepCopyInto(out *CrossplaneExtension) { *out = *in - if in.IpAllowList != nil { - in, out := &in.IpAllowList, &out.IpAllowList - *out = make([]*IPAllowListEntry, len(*in)) + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]*CrossplaneExtensionResource, len(*in)) for i := range *in { if (*in)[i] != nil { in, out := &(*in)[i], &(*out)[i] - *out = new(IPAllowListEntry) + *out = new(CrossplaneExtensionResource) **out = **in } } } - if in.Extensions != nil { - in, out := &in.Extensions, &out.Extensions - *out = make([]*ArgoCDExtensionInstallEntry, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(ArgoCDExtensionInstallEntry) - **out = **in - } - } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossplaneExtension. +func (in *CrossplaneExtension) DeepCopy() *CrossplaneExtension { + if in == nil { + return nil } - if in.ClusterCustomizationDefaults != nil { - in, out := &in.ClusterCustomizationDefaults, &out.ClusterCustomizationDefaults - *out = new(ClusterCustomization) - (*in).DeepCopyInto(*out) + out := new(CrossplaneExtension) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CrossplaneExtensionResource) DeepCopyInto(out *CrossplaneExtensionResource) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossplaneExtensionResource. +func (in *CrossplaneExtensionResource) DeepCopy() *CrossplaneExtensionResource { + if in == nil { + return nil } - if in.RepoServerDelegate != nil { - in, out := &in.RepoServerDelegate, &out.RepoServerDelegate - *out = new(RepoServerDelegate) - (*in).DeepCopyInto(*out) + out := new(CrossplaneExtensionResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DirectClusterSpec) DeepCopyInto(out *DirectClusterSpec) { + *out = *in + if in.KargoInstanceId != nil { + in, out := &in.KargoInstanceId, &out.KargoInstanceId + *out = new(string) + **out = **in } - if in.ImageUpdaterDelegate != nil { - in, out := &in.ImageUpdaterDelegate, &out.ImageUpdaterDelegate - *out = new(ImageUpdaterDelegate) - (*in).DeepCopyInto(*out) + if in.Server != nil { + in, out := &in.Server, &out.Server + *out = new(string) + **out = **in } - if in.AppSetDelegate != nil { - in, out := &in.AppSetDelegate, &out.AppSetDelegate - *out = new(AppSetDelegate) - (*in).DeepCopyInto(*out) + if in.Organization != nil { + in, out := &in.Organization, &out.Organization + *out = new(string) + **out = **in } - if in.AppsetPolicy != nil { - in, out := &in.AppsetPolicy, &out.AppsetPolicy - *out = new(AppsetPolicy) + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(string) **out = **in } - if in.HostAliases != nil { - in, out := &in.HostAliases, &out.HostAliases - *out = make([]*HostAliases, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(HostAliases) - (*in).DeepCopyInto(*out) - } - } + if in.CaData != nil { + in, out := &in.CaData, &out.CaData + *out = new(string) + **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec. -func (in *InstanceSpec) DeepCopy() *InstanceSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DirectClusterSpec. +func (in *DirectClusterSpec) DeepCopy() *DirectClusterSpec { if in == nil { return nil } - out := new(InstanceSpec) + out := new(DirectClusterSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedCluster) DeepCopyInto(out *ManagedCluster) { +func (in *Discover) DeepCopyInto(out *Discover) { *out = *in + if in.Find != nil { + in, out := &in.Find, &out.Find + *out = new(Find) + (*in).DeepCopyInto(*out) + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedCluster. -func (in *ManagedCluster) DeepCopy() *ManagedCluster { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Discover. +func (in *Discover) DeepCopy() *Discover { if in == nil { return nil } - out := new(ManagedCluster) + out := new(Discover) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RepoServerDelegate) DeepCopyInto(out *RepoServerDelegate) { +func (in *Dynamic) DeepCopyInto(out *Dynamic) { *out = *in - if in.ManagedCluster != nil { - in, out := &in.ManagedCluster, &out.ManagedCluster - *out = new(ManagedCluster) - **out = **in + if in.Command != nil { + in, out := &in.Command, &out.Command + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepoServerDelegate. -func (in *RepoServerDelegate) DeepCopy() *RepoServerDelegate { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dynamic. +func (in *Dynamic) DeepCopy() *Dynamic { if in == nil { return nil } - out := new(RepoServerDelegate) + out := new(Dynamic) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Command) DeepCopyInto(out *Command) { +func (in *Find) DeepCopyInto(out *Find) { *out = *in if in.Command != nil { in, out := &in.Command, &out.Command @@ -311,98 +453,186 @@ func (in *Command) DeepCopyInto(out *Command) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Command. -func (in *Command) DeepCopy() *Command { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Find. +func (in *Find) DeepCopy() *Find { if in == nil { return nil } - out := new(Command) + out := new(Find) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigManagementPlugin) DeepCopyInto(out *ConfigManagementPlugin) { +func (in *HostAliases) DeepCopyInto(out *HostAliases) { *out = *in - in.Spec.DeepCopyInto(&out.Spec) + if in.Hostnames != nil { + in, out := &in.Hostnames, &out.Hostnames + *out = make([]string, len(*in)) + copy(*out, *in) + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigManagementPlugin. -func (in *ConfigManagementPlugin) DeepCopy() *ConfigManagementPlugin { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostAliases. +func (in *HostAliases) DeepCopy() *HostAliases { if in == nil { return nil } - out := new(ConfigManagementPlugin) + out := new(HostAliases) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Discover) DeepCopyInto(out *Discover) { +func (in *IPAllowListEntry) DeepCopyInto(out *IPAllowListEntry) { *out = *in - if in.Find != nil { - in, out := &in.Find, &out.Find - *out = new(Find) - (*in).DeepCopyInto(*out) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAllowListEntry. +func (in *IPAllowListEntry) DeepCopy() *IPAllowListEntry { + if in == nil { + return nil } + out := new(IPAllowListEntry) + in.DeepCopyInto(out) + return out } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Discover. -func (in *Discover) DeepCopy() *Discover { +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageUpdaterDelegate) DeepCopyInto(out *ImageUpdaterDelegate) { + *out = *in + if in.ManagedCluster != nil { + in, out := &in.ManagedCluster, &out.ManagedCluster + *out = new(ManagedCluster) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdaterDelegate. +func (in *ImageUpdaterDelegate) DeepCopy() *ImageUpdaterDelegate { if in == nil { return nil } - out := new(Discover) + out := new(ImageUpdaterDelegate) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Dynamic) DeepCopyInto(out *Dynamic) { +func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { *out = *in - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) + if in.IpAllowList != nil { + in, out := &in.IpAllowList, &out.IpAllowList + *out = make([]*IPAllowListEntry, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(IPAllowListEntry) + **out = **in + } + } } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) + if in.Extensions != nil { + in, out := &in.Extensions, &out.Extensions + *out = make([]*ArgoCDExtensionInstallEntry, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(ArgoCDExtensionInstallEntry) + **out = **in + } + } + } + if in.ClusterCustomizationDefaults != nil { + in, out := &in.ClusterCustomizationDefaults, &out.ClusterCustomizationDefaults + *out = new(ClusterCustomization) + **out = **in + } + if in.RepoServerDelegate != nil { + in, out := &in.RepoServerDelegate, &out.RepoServerDelegate + *out = new(RepoServerDelegate) + (*in).DeepCopyInto(*out) + } + if in.CrossplaneExtension != nil { + in, out := &in.CrossplaneExtension, &out.CrossplaneExtension + *out = new(CrossplaneExtension) + (*in).DeepCopyInto(*out) + } + if in.ImageUpdaterDelegate != nil { + in, out := &in.ImageUpdaterDelegate, &out.ImageUpdaterDelegate + *out = new(ImageUpdaterDelegate) + (*in).DeepCopyInto(*out) + } + if in.AppSetDelegate != nil { + in, out := &in.AppSetDelegate, &out.AppSetDelegate + *out = new(AppSetDelegate) + (*in).DeepCopyInto(*out) + } + if in.AppsetPolicy != nil { + in, out := &in.AppsetPolicy, &out.AppsetPolicy + *out = new(AppsetPolicy) + **out = **in + } + if in.HostAliases != nil { + in, out := &in.HostAliases, &out.HostAliases + *out = make([]*HostAliases, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(HostAliases) + (*in).DeepCopyInto(*out) + } + } + } + if in.AgentPermissionsRules != nil { + in, out := &in.AgentPermissionsRules, &out.AgentPermissionsRules + *out = make([]*AgentPermissionsRule, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(AgentPermissionsRule) + (*in).DeepCopyInto(*out) + } + } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dynamic. -func (in *Dynamic) DeepCopy() *Dynamic { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec. +func (in *InstanceSpec) DeepCopy() *InstanceSpec { if in == nil { return nil } - out := new(Dynamic) + out := new(InstanceSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Find) DeepCopyInto(out *Find) { +func (in *ManagedCluster) DeepCopyInto(out *ManagedCluster) { *out = *in - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedCluster. +func (in *ManagedCluster) DeepCopy() *ManagedCluster { + if in == nil { + return nil } + out := new(ManagedCluster) + in.DeepCopyInto(out) + return out } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Find. -func (in *Find) DeepCopy() *Find { +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterConfig) DeepCopyInto(out *ManagedClusterConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterConfig. +func (in *ManagedClusterConfig) DeepCopy() *ManagedClusterConfig { if in == nil { return nil } - out := new(Find) + out := new(ManagedClusterConfig) in.DeepCopyInto(out) return out } @@ -499,3 +729,23 @@ func (in *PluginSpec) DeepCopy() *PluginSpec { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RepoServerDelegate) DeepCopyInto(out *RepoServerDelegate) { + *out = *in + if in.ManagedCluster != nil { + in, out := &in.ManagedCluster, &out.ManagedCluster + *out = new(ManagedCluster) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepoServerDelegate. +func (in *RepoServerDelegate) DeepCopy() *RepoServerDelegate { + if in == nil { + return nil + } + out := new(RepoServerDelegate) + in.DeepCopyInto(out) + return out +} diff --git a/package/crds/core.akuity.crossplane.io_clusters.yaml b/package/crds/core.akuity.crossplane.io_clusters.yaml index 0aabf29..2622543 100644 --- a/package/crds/core.akuity.crossplane.io_clusters.yaml +++ b/package/crds/core.akuity.crossplane.io_clusters.yaml @@ -88,8 +88,36 @@ spec: type: boolean autoUpgradeDisabled: type: boolean + datadogAnnotationsEnabled: + type: boolean + directClusterSpec: + properties: + caData: + type: string + clusterType: + type: string + kargoInstanceId: + type: string + organization: + type: string + server: + type: string + token: + type: string + type: object + eksAddonEnabled: + type: boolean kustomization: type: string + maintenanceMode: + type: boolean + managedClusterConfig: + properties: + secretKey: + type: string + secretName: + type: string + type: object redisTunneling: type: boolean size: diff --git a/package/crds/core.akuity.crossplane.io_instances.yaml b/package/crds/core.akuity.crossplane.io_instances.yaml index c786f89..4b0bd96 100644 --- a/package/crds/core.akuity.crossplane.io_instances.yaml +++ b/package/crds/core.akuity.crossplane.io_instances.yaml @@ -82,6 +82,23 @@ spec: type: string instanceSpec: properties: + agentPermissionsRules: + items: + properties: + apiGroups: + items: + type: string + type: array + resources: + items: + type: string + type: array + verbs: + items: + type: string + type: array + type: object + type: array appSetDelegate: properties: managedCluster: @@ -114,6 +131,16 @@ spec: redisTunneling: type: boolean type: object + crossplaneExtension: + properties: + resources: + items: + properties: + group: + type: string + type: object + type: array + type: object declarativeManagementEnabled: type: boolean extensions: @@ -125,6 +152,8 @@ spec: type: string type: object type: array + fqdn: + type: string hostAliases: items: properties: @@ -515,6 +544,23 @@ spec: type: string instanceSpec: properties: + agentPermissionsRules: + items: + properties: + apiGroups: + items: + type: string + type: array + resources: + items: + type: string + type: array + verbs: + items: + type: string + type: array + type: object + type: array appSetDelegate: properties: managedCluster: @@ -547,6 +593,16 @@ spec: redisTunneling: type: boolean type: object + crossplaneExtension: + properties: + resources: + items: + properties: + group: + type: string + type: object + type: array + type: object declarativeManagementEnabled: type: boolean extensions: @@ -558,6 +614,8 @@ spec: type: string type: object type: array + fqdn: + type: string hostAliases: items: properties: From 414e40d688ca8944e2fd4b9b93d676201ea0dba4 Mon Sep 17 00:00:00 2001 From: Akuity Bot Date: Fri, 5 Jul 2024 08:06:33 +0000 Subject: [PATCH 02/26] Automatic Update Crossplane Types to v0.15.0 --- .../akuity/v1alpha1/argocdinstance_types.go | 37 ++++++++++--------- .../akuity/v1alpha1/cluster_types.go | 23 ++++++------ .../akuity/v1alpha1/zz_generated.deepcopy.go | 5 +++ .../v1alpha1/argocdinstance_types.go | 37 ++++++++++--------- .../crossplane/v1alpha1/cluster_types.go | 23 ++++++------ .../v1alpha1/zz_generated.deepcopy.go | 5 +++ .../core.akuity.crossplane.io_clusters.yaml | 2 + .../core.akuity.crossplane.io_instances.yaml | 4 ++ 8 files changed, 78 insertions(+), 58 deletions(-) diff --git a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go index fb7e4d1..83572d1 100644 --- a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go @@ -73,24 +73,25 @@ type CrossplaneExtension struct { } type InstanceSpec struct { - IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` - Subdomain string `json:"subdomain,omitempty"` - DeclarativeManagementEnabled bool `json:"declarativeManagementEnabled,omitempty"` - Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` - ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` - ImageUpdaterEnabled bool `json:"imageUpdaterEnabled,omitempty"` - BackendIpAllowListEnabled bool `json:"backendIpAllowListEnabled,omitempty"` - RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` - AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` - SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` - CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` - ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` - AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` - AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` - AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` - HostAliases []*HostAliases `json:"hostAliases,omitempty"` - AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` - Fqdn string `json:"fqdn,omitempty"` + IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` + Subdomain string `json:"subdomain,omitempty"` + DeclarativeManagementEnabled bool `json:"declarativeManagementEnabled,omitempty"` + Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` + ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` + ImageUpdaterEnabled bool `json:"imageUpdaterEnabled,omitempty"` + BackendIpAllowListEnabled bool `json:"backendIpAllowListEnabled,omitempty"` + RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` + AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` + SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` + CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` + ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` + AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` + AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` + AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` + HostAliases []*HostAliases `json:"hostAliases,omitempty"` + AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` + Fqdn string `json:"fqdn,omitempty"` + MultiClusterK8SDashboardEnabled bool `json:"multiClusterK8sDashboardEnabled,omitempty"` } type ManagedCluster struct { diff --git a/internal/types/generated/akuity/v1alpha1/cluster_types.go b/internal/types/generated/akuity/v1alpha1/cluster_types.go index 6f7be0c..cd3b5d9 100644 --- a/internal/types/generated/akuity/v1alpha1/cluster_types.go +++ b/internal/types/generated/akuity/v1alpha1/cluster_types.go @@ -59,15 +59,16 @@ type ManagedClusterConfig struct { } type ClusterData struct { - Size ClusterSize `json:"size,omitempty"` - AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization runtime.RawExtension `json:"kustomization,omitempty"` - AppReplication *bool `json:"appReplication,omitempty"` - TargetVersion string `json:"targetVersion,omitempty"` - RedisTunneling *bool `json:"redisTunneling,omitempty"` - DirectClusterSpec *DirectClusterSpec `json:"directClusterSpec,omitempty"` - DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` - EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` - ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` - MaintenanceMode *bool `json:"maintenanceMode,omitempty"` + Size ClusterSize `json:"size,omitempty"` + AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization runtime.RawExtension `json:"kustomization,omitempty"` + AppReplication *bool `json:"appReplication,omitempty"` + TargetVersion string `json:"targetVersion,omitempty"` + RedisTunneling *bool `json:"redisTunneling,omitempty"` + DirectClusterSpec *DirectClusterSpec `json:"directClusterSpec,omitempty"` + DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` + EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` + ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` + MaintenanceMode *bool `json:"maintenanceMode,omitempty"` + MultiClusterK8SDashboardEnabled *bool `json:"multiClusterK8sDashboardEnabled,omitempty"` } diff --git a/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go index bbfa1d3..001aca5 100644 --- a/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go @@ -248,6 +248,11 @@ func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = new(bool) **out = **in } + if in.MultiClusterK8SDashboardEnabled != nil { + in, out := &in.MultiClusterK8SDashboardEnabled, &out.MultiClusterK8SDashboardEnabled + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterData. diff --git a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go index 1a61ebb..4a2fced 100644 --- a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go @@ -61,24 +61,25 @@ type CrossplaneExtension struct { // +kubebuilder:object:generate=true type InstanceSpec struct { - IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` - Subdomain string `json:"subdomain,omitempty"` - DeclarativeManagementEnabled bool `json:"declarativeManagementEnabled,omitempty"` - Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` - ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` - ImageUpdaterEnabled bool `json:"imageUpdaterEnabled,omitempty"` - BackendIpAllowListEnabled bool `json:"backendIpAllowListEnabled,omitempty"` - RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` - AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` - SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` - CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` - ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` - AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` - AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` - AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` - HostAliases []*HostAliases `json:"hostAliases,omitempty"` - AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` - Fqdn string `json:"fqdn,omitempty"` + IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` + Subdomain string `json:"subdomain,omitempty"` + DeclarativeManagementEnabled bool `json:"declarativeManagementEnabled,omitempty"` + Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` + ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` + ImageUpdaterEnabled bool `json:"imageUpdaterEnabled,omitempty"` + BackendIpAllowListEnabled bool `json:"backendIpAllowListEnabled,omitempty"` + RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` + AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` + SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` + CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` + ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` + AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` + AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` + AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` + HostAliases []*HostAliases `json:"hostAliases,omitempty"` + AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` + Fqdn string `json:"fqdn,omitempty"` + MultiClusterK8SDashboardEnabled bool `json:"multiClusterK8sDashboardEnabled,omitempty"` } // +kubebuilder:object:generate=true diff --git a/internal/types/generated/crossplane/v1alpha1/cluster_types.go b/internal/types/generated/crossplane/v1alpha1/cluster_types.go index 82d7087..0997c04 100644 --- a/internal/types/generated/crossplane/v1alpha1/cluster_types.go +++ b/internal/types/generated/crossplane/v1alpha1/cluster_types.go @@ -44,15 +44,16 @@ type ManagedClusterConfig struct { // +kubebuilder:object:generate=true type ClusterData struct { - Size ClusterSize `json:"size,omitempty"` - AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization string `json:"kustomization,omitempty"` - AppReplication bool `json:"appReplication,omitempty"` - TargetVersion string `json:"targetVersion,omitempty"` - RedisTunneling bool `json:"redisTunneling,omitempty"` - DirectClusterSpec *DirectClusterSpec `json:"directClusterSpec,omitempty"` - DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` - EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` - ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` - MaintenanceMode *bool `json:"maintenanceMode,omitempty"` + Size ClusterSize `json:"size,omitempty"` + AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization string `json:"kustomization,omitempty"` + AppReplication bool `json:"appReplication,omitempty"` + TargetVersion string `json:"targetVersion,omitempty"` + RedisTunneling bool `json:"redisTunneling,omitempty"` + DirectClusterSpec *DirectClusterSpec `json:"directClusterSpec,omitempty"` + DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` + EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` + ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` + MaintenanceMode *bool `json:"maintenanceMode,omitempty"` + MultiClusterK8SDashboardEnabled *bool `json:"multiClusterK8sDashboardEnabled,omitempty"` } diff --git a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go index 2dbe872..ddb1fa0 100644 --- a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go @@ -199,6 +199,11 @@ func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = new(bool) **out = **in } + if in.MultiClusterK8SDashboardEnabled != nil { + in, out := &in.MultiClusterK8SDashboardEnabled, &out.MultiClusterK8SDashboardEnabled + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterData. diff --git a/package/crds/core.akuity.crossplane.io_clusters.yaml b/package/crds/core.akuity.crossplane.io_clusters.yaml index 2622543..9b6b79b 100644 --- a/package/crds/core.akuity.crossplane.io_clusters.yaml +++ b/package/crds/core.akuity.crossplane.io_clusters.yaml @@ -118,6 +118,8 @@ spec: secretName: type: string type: object + multiClusterK8sDashboardEnabled: + type: boolean redisTunneling: type: boolean size: diff --git a/package/crds/core.akuity.crossplane.io_instances.yaml b/package/crds/core.akuity.crossplane.io_instances.yaml index 4b0bd96..2589cf5 100644 --- a/package/crds/core.akuity.crossplane.io_instances.yaml +++ b/package/crds/core.akuity.crossplane.io_instances.yaml @@ -186,6 +186,8 @@ spec: type: string type: object type: array + multiClusterK8sDashboardEnabled: + type: boolean repoServerDelegate: properties: controlPlane: @@ -648,6 +650,8 @@ spec: type: string type: object type: array + multiClusterK8sDashboardEnabled: + type: boolean repoServerDelegate: properties: controlPlane: From 813a46f241f3b70bc77f3fa67c227440761aa711 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 4 Jul 2024 16:05:11 +0800 Subject: [PATCH 03/26] add fqdn, agentPermissionsRules and CrossplaneExtension --- internal/types/instance.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/internal/types/instance.go b/internal/types/instance.go index 9618c7c..2335598 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -515,11 +515,14 @@ func CrossplaneToAkuityAPIInstanceSpec(instanceSpec crossplanetypes.InstanceSpec RepoServerDelegate: CrossplaneToAkuityAPIRepoServerDelegate(instanceSpec.RepoServerDelegate), AuditExtensionEnabled: instanceSpec.AuditExtensionEnabled, SyncHistoryExtensionEnabled: instanceSpec.SyncHistoryExtensionEnabled, + CrossplaneExtension: CrossplaneToAkuityAPICrossplaneExtension(instanceSpec.CrossplaneExtension), ImageUpdaterDelegate: CrossplaneToAkuityAPIImageUpdaterDelegate(instanceSpec.ImageUpdaterDelegate), AppSetDelegate: CrossplaneToAkuityAPIAppSetDelegate(instanceSpec.AppSetDelegate), AssistantExtensionEnabled: instanceSpec.AssistantExtensionEnabled, AppsetPolicy: CrossplaneToAkuityAPIAppsetPolicy(instanceSpec.AppsetPolicy), HostAliases: CrossplaneToAkuityAPIHostAliases(instanceSpec.HostAliases), + AgentPermissionsRules: CrossplaneToAkuityAPIAgentPermissionsRules(instanceSpec.AgentPermissionsRules), + Fqdn: instanceSpec.Fqdn, }, nil } @@ -580,6 +583,21 @@ func CrossplaneToAkuityAPIRepoServerDelegate(repoServerDelegate *crossplanetypes } } +func CrossplaneToAkuityAPICrossplaneExtension(extension *crossplanetypes.CrossplaneExtension) *akuitytypes.CrossplaneExtension { + if extension == nil { + return nil + } + + resources := make([]*akuitytypes.CrossplaneExtensionResource, 0, len(extension.Resources)) + for _, resource := range extension.Resources { + resources = append(resources, &akuitytypes.CrossplaneExtensionResource{ + Group: resource.Group, + }) + } + return &akuitytypes.CrossplaneExtension{Resources: resources} + +} + func CrossplaneToAkuityAPIImageUpdaterDelegate(imageUpdaterDelegate *crossplanetypes.ImageUpdaterDelegate) *akuitytypes.ImageUpdaterDelegate { if imageUpdaterDelegate == nil { return nil @@ -629,6 +647,19 @@ func CrossplaneToAkuityAPIHostAliases(hostAliasesList []*crossplanetypes.HostAli return AkuityHostAliasesList } +func CrossplaneToAkuityAPIAgentPermissionsRules(agentPermissionsRules []*crossplanetypes.AgentPermissionsRule) []*akuitytypes.AgentPermissionsRule { + akuityAgentPermissionsRules := make([]*akuitytypes.AgentPermissionsRule, 0, len(agentPermissionsRules)) + for _, a := range agentPermissionsRules { + copied := a.DeepCopy() + akuityAgentPermissionsRules = append(akuityAgentPermissionsRules, &akuitytypes.AgentPermissionsRule{ + ApiGroups: copied.ApiGroups, + Resources: copied.Resources, + Verbs: copied.Verbs, + }) + } + return akuityAgentPermissionsRules +} + func CrossplaneToAkuityAPIConfigMap(name string, configMapData map[string]string) (*structpb.Struct, error) { if len(configMapData) == 0 { return nil, nil From bfba3853b9c17bf01ea99396fbb1d297258925f9 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 4 Jul 2024 17:20:50 +0800 Subject: [PATCH 04/26] add agentPermissionsRules, fqdn, CrossplaneExtension --- go.mod | 2 +- go.sum | 2 ++ internal/types/instance.go | 46 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5d1a1d9..d73669a 100644 --- a/go.mod +++ b/go.mod @@ -21,6 +21,7 @@ require ( ) require ( + github.com/akuity/api-client-go v0.14.0 // indirect github.com/alevinval/sse v1.0.2 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/go-resty/resty/v2 v2.11.0 // indirect @@ -33,7 +34,6 @@ require ( require ( dario.cat/mergo v1.0.0 // indirect - github.com/akuity/api-client-go v0.10.0 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/go.sum b/go.sum index 822d262..c9b54a4 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/akuity/api-client-go v0.10.0 h1:v38/8a1e1abOkLzpVflytraAcUX0UGDRIum8W7luqBY= github.com/akuity/api-client-go v0.10.0/go.mod h1:F9Rdem0OdJQ+JLsO2I76jyrFFypK9JhgjnlLUve2KU0= +github.com/akuity/api-client-go v0.14.0 h1:kD+I4wTPPoj0gZx+/bLHeTfW+9LTtDFw6HpQNV1HGwg= +github.com/akuity/api-client-go v0.14.0/go.mod h1:ziHCeqFmAytZZ6lZbwvmq9hFG42bLV8iHnz13/SdMoo= github.com/akuity/grpc-gateway-client v0.0.0-20231116134900-80c401329778 h1:qj3+B4PU5AR2mBffDVXvP2d3hLCNDot28KKPWvQnOxs= github.com/akuity/grpc-gateway-client v0.0.0-20231116134900-80c401329778/go.mod h1:0MZqOxL+zq+hGedAjYhkm1tOKuZyjUmE/xA8nqXa9q0= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= diff --git a/internal/types/instance.go b/internal/types/instance.go index 2335598..7c7957a 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -325,11 +325,14 @@ func AkuityAPIToCrossplaneInstanceSpec(instanceSpec *argocdv1.InstanceSpec) (cro RepoServerDelegate: AkuityAPIToCrossplaneRepoServerDelegate(instanceSpec.GetRepoServerDelegate()), AuditExtensionEnabled: instanceSpec.GetAuditExtensionEnabled(), SyncHistoryExtensionEnabled: instanceSpec.GetSyncHistoryExtensionEnabled(), + CrossplaneExtension: AkuityAPIToCrossplaneCrossplaneExtension(instanceSpec.CrossplaneExtension), ImageUpdaterDelegate: AkuityAPIToCrossplaneImageUpdaterDelegate(instanceSpec.GetImageUpdaterDelegate()), AppSetDelegate: AkuityAPIToCrossplaneAppSetDelegate(instanceSpec.GetAppSetDelegate()), AssistantExtensionEnabled: instanceSpec.GetAssistantExtensionEnabled(), AppsetPolicy: AkuityAPIToCrossplaneAppsetPolicy(instanceSpec.GetAppsetPolicy()), HostAliases: AkuityAPIToCrossplaneHostAliases(instanceSpec.GetHostAliases()), + AgentPermissionsRules: AkuityAPIToCrossplaneAgentPermissionsRules(instanceSpec.GetAgentPermissionsRules()), + Fqdn: instanceSpec.GetFqdn(), }, nil } @@ -416,6 +419,21 @@ func AkuityAPIToCrossplaneRepoServerDelegate(repoServerDelegate *argocdv1.RepoSe } } +func AkuityAPIToCrossplaneCrossplaneExtension(crossplaneExtension *argocdv1.CrossplaneExtension) *crossplanetypes.CrossplaneExtension { + if crossplaneExtension == nil { + return nil + } + + resources := make([]*crossplanetypes.CrossplaneExtensionResource, 0, len(crossplaneExtension.Resources)) + for _, r := range crossplaneExtension.Resources { + resource := &crossplanetypes.CrossplaneExtensionResource{ + Group: r.Group, + } + resources = append(resources, resource) + } + return &crossplanetypes.CrossplaneExtension{Resources: resources} +} + func AkuityAPIToCrossplaneImageUpdaterDelegate(imageUpdaterDelegate *argocdv1.ImageUpdaterDelegate) *crossplanetypes.ImageUpdaterDelegate { if imageUpdaterDelegate == nil { return nil @@ -469,6 +487,34 @@ func AkuityAPIToCrossplaneHostAliases(hostAliasesList []*argocdv1.HostAliases) [ return crossplaneHostAliasesList } +func AkuityAPIToCrossplaneAgentPermissionsRules(agentPermissionsRules []*argocdv1.AgentPermissionsRule) []*crossplanetypes.AgentPermissionsRule { + if len(agentPermissionsRules) == 0 { + return nil + } + + crossplaneAgentPermissionsRules := make([]*crossplanetypes.AgentPermissionsRule, 0, len(agentPermissionsRules)) + for _, rule := range agentPermissionsRules { + var apiGroups []string + for _, apiGroup := range rule.ApiGroups { + apiGroups = append(apiGroups, apiGroup) + } + var resources []string + for _, resource := range rule.Resources { + resources = append(resources, resource) + } + var verbs []string + for _, verb := range rule.Verbs { + verbs = append(verbs, verb) + } + crossplaneAgentPermissionsRules = append(crossplaneAgentPermissionsRules, &crossplanetypes.AgentPermissionsRule{ + ApiGroups: apiGroups, + Resources: resources, + Verbs: verbs, + }) + } + return crossplaneAgentPermissionsRules +} + func CrossplaneToAkuityAPIArgoCD(name string, instance *crossplanetypes.ArgoCD) (*structpb.Struct, error) { instanceSpec, err := CrossplaneToAkuityAPIInstanceSpec(instance.Spec.InstanceSpec) if err != nil { From 821c860e4075846b8227aee473869a5306ac5401 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Fri, 5 Jul 2024 17:01:55 +0800 Subject: [PATCH 05/26] add multi cluster dashboard implementation --- go.mod | 2 +- go.sum | 2 + internal/types/cluster.go | 89 ++++++++++++++++++++++++++++----- internal/types/instance.go | 74 ++++++++++++++------------- internal/utils/pointer/value.go | 20 ++++++++ 5 files changed, 138 insertions(+), 49 deletions(-) create mode 100644 internal/utils/pointer/value.go diff --git a/go.mod b/go.mod index d73669a..ff9ae9e 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( ) require ( - github.com/akuity/api-client-go v0.14.0 // indirect + github.com/akuity/api-client-go v0.15.0 // indirect github.com/alevinval/sse v1.0.2 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/go-resty/resty/v2 v2.11.0 // indirect diff --git a/go.sum b/go.sum index c9b54a4..7edfb32 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/akuity/api-client-go v0.10.0 h1:v38/8a1e1abOkLzpVflytraAcUX0UGDRIum8W github.com/akuity/api-client-go v0.10.0/go.mod h1:F9Rdem0OdJQ+JLsO2I76jyrFFypK9JhgjnlLUve2KU0= github.com/akuity/api-client-go v0.14.0 h1:kD+I4wTPPoj0gZx+/bLHeTfW+9LTtDFw6HpQNV1HGwg= github.com/akuity/api-client-go v0.14.0/go.mod h1:ziHCeqFmAytZZ6lZbwvmq9hFG42bLV8iHnz13/SdMoo= +github.com/akuity/api-client-go v0.15.0 h1:w9OPnQGiAMiXIZN0+eqN7Fph/u/g15H8Ug3/PCE/esA= +github.com/akuity/api-client-go v0.15.0/go.mod h1:ziHCeqFmAytZZ6lZbwvmq9hFG42bLV8iHnz13/SdMoo= github.com/akuity/grpc-gateway-client v0.0.0-20231116134900-80c401329778 h1:qj3+B4PU5AR2mBffDVXvP2d3hLCNDot28KKPWvQnOxs= github.com/akuity/grpc-gateway-client v0.0.0-20231116134900-80c401329778/go.mod h1:0MZqOxL+zq+hGedAjYhkm1tOKuZyjUmE/xA8nqXa9q0= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= diff --git a/internal/types/cluster.go b/internal/types/cluster.go index 8b6721f..bc61d6c 100644 --- a/internal/types/cluster.go +++ b/internal/types/cluster.go @@ -13,6 +13,7 @@ import ( "github.com/akuityio/provider-crossplane-akuity/apis/core/v1alpha1" akuitytypes "github.com/akuityio/provider-crossplane-akuity/internal/types/generated/akuity/v1alpha1" generated "github.com/akuityio/provider-crossplane-akuity/internal/types/generated/crossplane/v1alpha1" + "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" ) func AkuityAPIToCrossplaneClusterObservation(cluster *argocdv1.Cluster) (v1alpha1.ClusterObservation, error) { @@ -93,6 +94,58 @@ func AkuityAPIToClusterObservationAgentStateStatus(agentHealthStatuses map[strin return statuses } +func AkuityAPIToCrossplaneDirectClusterSpec(directClusterSpec *argocdv1.DirectClusterSpec) *generated.DirectClusterSpec { + if directClusterSpec == nil { + return nil + } + + return &generated.DirectClusterSpec{ + ClusterType: generated.DirectClusterType(directClusterSpec.ClusterType), + KargoInstanceId: pointer.CopyString(directClusterSpec.KargoInstanceId), + Server: pointer.CopyString(directClusterSpec.Server), + Organization: pointer.CopyString(directClusterSpec.Organization), + Token: pointer.CopyString(directClusterSpec.Token), + CaData: pointer.CopyString(directClusterSpec.CaData), + } +} + +func CrossplaneToAkuityAPIDirectClusterSpec(directClusterSpec *generated.DirectClusterSpec) *akuitytypes.DirectClusterSpec { + if directClusterSpec == nil { + return nil + } + + return &akuitytypes.DirectClusterSpec{ + ClusterType: akuitytypes.DirectClusterType(directClusterSpec.ClusterType), + KargoInstanceId: pointer.CopyString(directClusterSpec.KargoInstanceId), + Server: pointer.CopyString(directClusterSpec.Server), + Organization: pointer.CopyString(directClusterSpec.Organization), + Token: pointer.CopyString(directClusterSpec.Token), + CaData: pointer.CopyString(directClusterSpec.CaData), + } +} + +func AkuityAPIToCrossplaneManagedClusterConfig(managedClusterConfig *argocdv1.ManagedClusterConfig) *generated.ManagedClusterConfig { + if managedClusterConfig == nil { + return nil + } + + return &generated.ManagedClusterConfig{ + SecretName: managedClusterConfig.SecretName, + SecretKey: managedClusterConfig.SecretKey, + } +} + +func CrossplaneToAkuityAPIManagedClusterConfig(managedClusterConfig *generated.ManagedClusterConfig) *akuitytypes.ManagedClusterConfig { + if managedClusterConfig == nil { + return nil + } + + return &akuitytypes.ManagedClusterConfig{ + SecretName: managedClusterConfig.SecretName, + SecretKey: managedClusterConfig.SecretKey, + } +} + func AkuityAPIToCrossplaneCluster(instanceID string, managedCluster v1alpha1.ClusterParameters, cluster *argocdv1.Cluster) (v1alpha1.ClusterParameters, error) { kustomizationYAML, err := AkuityAPIKustomizationToCrossplaneKustomization(cluster.GetData().GetKustomization()) if err != nil { @@ -127,12 +180,18 @@ func AkuityAPIToCrossplaneCluster(instanceID string, managedCluster v1alpha1.Clu Description: cluster.GetDescription(), NamespaceScoped: cluster.GetNamespaceScoped(), Data: generated.ClusterData{ - Size: generated.ClusterSize(size), - AutoUpgradeDisabled: cluster.GetData().GetAutoUpgradeDisabled(), - Kustomization: string(kustomizationYAML), - AppReplication: cluster.GetData().GetAppReplication(), - TargetVersion: cluster.GetData().GetTargetVersion(), - RedisTunneling: cluster.GetData().GetRedisTunneling(), + Size: generated.ClusterSize(size), + AutoUpgradeDisabled: cluster.GetData().GetAutoUpgradeDisabled(), + Kustomization: string(kustomizationYAML), + AppReplication: cluster.GetData().GetAppReplication(), + TargetVersion: cluster.GetData().GetTargetVersion(), + RedisTunneling: cluster.GetData().GetRedisTunneling(), + DirectClusterSpec: AkuityAPIToCrossplaneDirectClusterSpec(cluster.GetData().GetDirectClusterSpec()), + DatadogAnnotationsEnabled: pointer.ToPointer(cluster.GetData().GetDatadogAnnotationsEnabled()), + EksAddonEnabled: pointer.ToPointer(cluster.GetData().GetEksAddonEnabled()), + ManagedClusterConfig: AkuityAPIToCrossplaneManagedClusterConfig(cluster.GetData().GetManagedClusterConfig()), + MaintenanceMode: pointer.ToPointer(cluster.GetData().GetMaintenanceMode()), + MultiClusterK8SDashboardEnabled: pointer.ToPointer(cluster.GetData().GetMultiClusterK8SDashboardEnabled()), }, }, EnableInClusterKubeConfig: managedCluster.EnableInClusterKubeConfig, @@ -169,12 +228,18 @@ func CrossplaneToAkuityAPICluster(cluster v1alpha1.ClusterParameters) (akuitytyp Description: cluster.ClusterSpec.Description, NamespaceScoped: cluster.ClusterSpec.NamespaceScoped, Data: akuitytypes.ClusterData{ - Size: akuitytypes.ClusterSize(cluster.ClusterSpec.Data.Size), - AutoUpgradeDisabled: &cluster.ClusterSpec.Data.AutoUpgradeDisabled, - Kustomization: kustomization, - AppReplication: &cluster.ClusterSpec.Data.AppReplication, - TargetVersion: cluster.ClusterSpec.Data.TargetVersion, - RedisTunneling: &cluster.ClusterSpec.Data.RedisTunneling, + Size: akuitytypes.ClusterSize(cluster.ClusterSpec.Data.Size), + AutoUpgradeDisabled: &cluster.ClusterSpec.Data.AutoUpgradeDisabled, + Kustomization: kustomization, + AppReplication: &cluster.ClusterSpec.Data.AppReplication, + TargetVersion: cluster.ClusterSpec.Data.TargetVersion, + RedisTunneling: &cluster.ClusterSpec.Data.RedisTunneling, + DirectClusterSpec: CrossplaneToAkuityAPIDirectClusterSpec(cluster.ClusterSpec.Data.DirectClusterSpec), + DatadogAnnotationsEnabled: cluster.ClusterSpec.Data.DatadogAnnotationsEnabled, + EksAddonEnabled: cluster.ClusterSpec.Data.EksAddonEnabled, + ManagedClusterConfig: CrossplaneToAkuityAPIManagedClusterConfig(cluster.ClusterSpec.Data.ManagedClusterConfig), + MaintenanceMode: cluster.ClusterSpec.Data.MaintenanceMode, + MultiClusterK8SDashboardEnabled: cluster.ClusterSpec.Data.MultiClusterK8SDashboardEnabled, }, }, }, nil diff --git a/internal/types/instance.go b/internal/types/instance.go index 7c7957a..dfc52c8 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -315,24 +315,25 @@ func AkuityAPIToCrossplaneInstanceSpec(instanceSpec *argocdv1.InstanceSpec) (cro } return crossplanetypes.InstanceSpec{ - IpAllowList: AkuityAPIToCrossplaneIPAllowListEntry(instanceSpec.GetIpAllowList()), - Subdomain: instanceSpec.GetSubdomain(), - DeclarativeManagementEnabled: instanceSpec.GetDeclarativeManagementEnabled(), - Extensions: AkuityAPIToCrossplaneArgoCDExtensionInstallEntry(instanceSpec.GetExtensions()), - ClusterCustomizationDefaults: clusterCustomization, - ImageUpdaterEnabled: instanceSpec.GetImageUpdaterEnabled(), - BackendIpAllowListEnabled: instanceSpec.GetBackendIpAllowListEnabled(), - RepoServerDelegate: AkuityAPIToCrossplaneRepoServerDelegate(instanceSpec.GetRepoServerDelegate()), - AuditExtensionEnabled: instanceSpec.GetAuditExtensionEnabled(), - SyncHistoryExtensionEnabled: instanceSpec.GetSyncHistoryExtensionEnabled(), - CrossplaneExtension: AkuityAPIToCrossplaneCrossplaneExtension(instanceSpec.CrossplaneExtension), - ImageUpdaterDelegate: AkuityAPIToCrossplaneImageUpdaterDelegate(instanceSpec.GetImageUpdaterDelegate()), - AppSetDelegate: AkuityAPIToCrossplaneAppSetDelegate(instanceSpec.GetAppSetDelegate()), - AssistantExtensionEnabled: instanceSpec.GetAssistantExtensionEnabled(), - AppsetPolicy: AkuityAPIToCrossplaneAppsetPolicy(instanceSpec.GetAppsetPolicy()), - HostAliases: AkuityAPIToCrossplaneHostAliases(instanceSpec.GetHostAliases()), - AgentPermissionsRules: AkuityAPIToCrossplaneAgentPermissionsRules(instanceSpec.GetAgentPermissionsRules()), - Fqdn: instanceSpec.GetFqdn(), + IpAllowList: AkuityAPIToCrossplaneIPAllowListEntry(instanceSpec.GetIpAllowList()), + Subdomain: instanceSpec.GetSubdomain(), + DeclarativeManagementEnabled: instanceSpec.GetDeclarativeManagementEnabled(), + Extensions: AkuityAPIToCrossplaneArgoCDExtensionInstallEntry(instanceSpec.GetExtensions()), + ClusterCustomizationDefaults: clusterCustomization, + ImageUpdaterEnabled: instanceSpec.GetImageUpdaterEnabled(), + BackendIpAllowListEnabled: instanceSpec.GetBackendIpAllowListEnabled(), + RepoServerDelegate: AkuityAPIToCrossplaneRepoServerDelegate(instanceSpec.GetRepoServerDelegate()), + AuditExtensionEnabled: instanceSpec.GetAuditExtensionEnabled(), + SyncHistoryExtensionEnabled: instanceSpec.GetSyncHistoryExtensionEnabled(), + CrossplaneExtension: AkuityAPIToCrossplaneCrossplaneExtension(instanceSpec.CrossplaneExtension), + ImageUpdaterDelegate: AkuityAPIToCrossplaneImageUpdaterDelegate(instanceSpec.GetImageUpdaterDelegate()), + AppSetDelegate: AkuityAPIToCrossplaneAppSetDelegate(instanceSpec.GetAppSetDelegate()), + AssistantExtensionEnabled: instanceSpec.GetAssistantExtensionEnabled(), + AppsetPolicy: AkuityAPIToCrossplaneAppsetPolicy(instanceSpec.GetAppsetPolicy()), + HostAliases: AkuityAPIToCrossplaneHostAliases(instanceSpec.GetHostAliases()), + AgentPermissionsRules: AkuityAPIToCrossplaneAgentPermissionsRules(instanceSpec.GetAgentPermissionsRules()), + Fqdn: instanceSpec.GetFqdn(), + MultiClusterK8SDashboardEnabled: instanceSpec.GetMultiClusterK8SDashboardEnabled(), }, nil } @@ -551,24 +552,25 @@ func CrossplaneToAkuityAPIInstanceSpec(instanceSpec crossplanetypes.InstanceSpec } return akuitytypes.InstanceSpec{ - IpAllowList: CrossplaneToAkuityAPIIPAllowListEntry(instanceSpec.IpAllowList), - Subdomain: instanceSpec.Subdomain, - DeclarativeManagementEnabled: instanceSpec.DeclarativeManagementEnabled, - Extensions: CrossplaneToAkuityAPIArgoCDExtensionInstallEntry(instanceSpec.Extensions), - ClusterCustomizationDefaults: clusterCustomization, - ImageUpdaterEnabled: instanceSpec.ImageUpdaterEnabled, - BackendIpAllowListEnabled: instanceSpec.BackendIpAllowListEnabled, - RepoServerDelegate: CrossplaneToAkuityAPIRepoServerDelegate(instanceSpec.RepoServerDelegate), - AuditExtensionEnabled: instanceSpec.AuditExtensionEnabled, - SyncHistoryExtensionEnabled: instanceSpec.SyncHistoryExtensionEnabled, - CrossplaneExtension: CrossplaneToAkuityAPICrossplaneExtension(instanceSpec.CrossplaneExtension), - ImageUpdaterDelegate: CrossplaneToAkuityAPIImageUpdaterDelegate(instanceSpec.ImageUpdaterDelegate), - AppSetDelegate: CrossplaneToAkuityAPIAppSetDelegate(instanceSpec.AppSetDelegate), - AssistantExtensionEnabled: instanceSpec.AssistantExtensionEnabled, - AppsetPolicy: CrossplaneToAkuityAPIAppsetPolicy(instanceSpec.AppsetPolicy), - HostAliases: CrossplaneToAkuityAPIHostAliases(instanceSpec.HostAliases), - AgentPermissionsRules: CrossplaneToAkuityAPIAgentPermissionsRules(instanceSpec.AgentPermissionsRules), - Fqdn: instanceSpec.Fqdn, + IpAllowList: CrossplaneToAkuityAPIIPAllowListEntry(instanceSpec.IpAllowList), + Subdomain: instanceSpec.Subdomain, + DeclarativeManagementEnabled: instanceSpec.DeclarativeManagementEnabled, + Extensions: CrossplaneToAkuityAPIArgoCDExtensionInstallEntry(instanceSpec.Extensions), + ClusterCustomizationDefaults: clusterCustomization, + ImageUpdaterEnabled: instanceSpec.ImageUpdaterEnabled, + BackendIpAllowListEnabled: instanceSpec.BackendIpAllowListEnabled, + RepoServerDelegate: CrossplaneToAkuityAPIRepoServerDelegate(instanceSpec.RepoServerDelegate), + AuditExtensionEnabled: instanceSpec.AuditExtensionEnabled, + SyncHistoryExtensionEnabled: instanceSpec.SyncHistoryExtensionEnabled, + CrossplaneExtension: CrossplaneToAkuityAPICrossplaneExtension(instanceSpec.CrossplaneExtension), + ImageUpdaterDelegate: CrossplaneToAkuityAPIImageUpdaterDelegate(instanceSpec.ImageUpdaterDelegate), + AppSetDelegate: CrossplaneToAkuityAPIAppSetDelegate(instanceSpec.AppSetDelegate), + AssistantExtensionEnabled: instanceSpec.AssistantExtensionEnabled, + AppsetPolicy: CrossplaneToAkuityAPIAppsetPolicy(instanceSpec.AppsetPolicy), + HostAliases: CrossplaneToAkuityAPIHostAliases(instanceSpec.HostAliases), + AgentPermissionsRules: CrossplaneToAkuityAPIAgentPermissionsRules(instanceSpec.AgentPermissionsRules), + Fqdn: instanceSpec.Fqdn, + MultiClusterK8SDashboardEnabled: instanceSpec.MultiClusterK8SDashboardEnabled, }, nil } diff --git a/internal/utils/pointer/value.go b/internal/utils/pointer/value.go new file mode 100644 index 0000000..1d93dd4 --- /dev/null +++ b/internal/utils/pointer/value.go @@ -0,0 +1,20 @@ +package pointer + +func ToPointer[T any](value T) *T { + return &value +} + +func ToValue[T any](value *T, defaultValue T) T { + if value == nil { + return defaultValue + } + return *value +} + +func CopyString(s *string) *string { + if s == nil { + return nil + } + + return ToPointer(ToValue(s, "")) +} From 2f2e5df495c25796345a1df750b4bd8acdc5cb9a Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Fri, 5 Jul 2024 18:13:51 +0800 Subject: [PATCH 06/26] run go mod tidy --- go.mod | 2 +- go.sum | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/go.mod b/go.mod index ff9ae9e..0c94f2d 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/akuityio/provider-crossplane-akuity go 1.21 require ( + github.com/akuity/api-client-go v0.15.0 github.com/akuity/grpc-gateway-client v0.0.0-20231116134900-80c401329778 github.com/avast/retry-go/v4 v4.5.1 github.com/crossplane/crossplane-runtime v1.14.3 @@ -21,7 +22,6 @@ require ( ) require ( - github.com/akuity/api-client-go v0.15.0 // indirect github.com/alevinval/sse v1.0.2 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/go-resty/resty/v2 v2.11.0 // indirect diff --git a/go.sum b/go.sum index 7edfb32..f432c90 100644 --- a/go.sum +++ b/go.sum @@ -2,10 +2,6 @@ buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-2023110619213 buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231106192134-1baebb0a1518.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/akuity/api-client-go v0.10.0 h1:v38/8a1e1abOkLzpVflytraAcUX0UGDRIum8W7luqBY= -github.com/akuity/api-client-go v0.10.0/go.mod h1:F9Rdem0OdJQ+JLsO2I76jyrFFypK9JhgjnlLUve2KU0= -github.com/akuity/api-client-go v0.14.0 h1:kD+I4wTPPoj0gZx+/bLHeTfW+9LTtDFw6HpQNV1HGwg= -github.com/akuity/api-client-go v0.14.0/go.mod h1:ziHCeqFmAytZZ6lZbwvmq9hFG42bLV8iHnz13/SdMoo= github.com/akuity/api-client-go v0.15.0 h1:w9OPnQGiAMiXIZN0+eqN7Fph/u/g15H8Ug3/PCE/esA= github.com/akuity/api-client-go v0.15.0/go.mod h1:ziHCeqFmAytZZ6lZbwvmq9hFG42bLV8iHnz13/SdMoo= github.com/akuity/grpc-gateway-client v0.0.0-20231116134900-80c401329778 h1:qj3+B4PU5AR2mBffDVXvP2d3hLCNDot28KKPWvQnOxs= From fcb2634107f1da1bf271f434bfa2177773616dd0 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Fri, 5 Jul 2024 18:26:51 +0800 Subject: [PATCH 07/26] fix linter --- internal/types/cluster.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/types/cluster.go b/internal/types/cluster.go index bc61d6c..f8ec813 100644 --- a/internal/types/cluster.go +++ b/internal/types/cluster.go @@ -100,12 +100,12 @@ func AkuityAPIToCrossplaneDirectClusterSpec(directClusterSpec *argocdv1.DirectCl } return &generated.DirectClusterSpec{ - ClusterType: generated.DirectClusterType(directClusterSpec.ClusterType), - KargoInstanceId: pointer.CopyString(directClusterSpec.KargoInstanceId), - Server: pointer.CopyString(directClusterSpec.Server), - Organization: pointer.CopyString(directClusterSpec.Organization), - Token: pointer.CopyString(directClusterSpec.Token), - CaData: pointer.CopyString(directClusterSpec.CaData), + ClusterType: generated.DirectClusterType(directClusterSpec.GetClusterType()), + KargoInstanceId: pointer.ToPointer(directClusterSpec.GetKargoInstanceId()), + Server: pointer.ToPointer(directClusterSpec.GetServer()), + Organization: pointer.ToPointer(directClusterSpec.GetOrganization()), + Token: pointer.ToPointer(directClusterSpec.GetToken()), + CaData: pointer.ToPointer(directClusterSpec.GetCaData()), } } @@ -130,8 +130,8 @@ func AkuityAPIToCrossplaneManagedClusterConfig(managedClusterConfig *argocdv1.Ma } return &generated.ManagedClusterConfig{ - SecretName: managedClusterConfig.SecretName, - SecretKey: managedClusterConfig.SecretKey, + SecretName: managedClusterConfig.GetSecretName(), + SecretKey: managedClusterConfig.GetSecretKey(), } } From 05a8f8a7b45adbd89441660e022b88b25bc26d6f Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Fri, 5 Jul 2024 18:32:25 +0800 Subject: [PATCH 08/26] generate mock client --- .../argocd_service_gateway_client_mock.go | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/internal/clients/akuity/mock/argocd_service_gateway_client_mock.go b/internal/clients/akuity/mock/argocd_service_gateway_client_mock.go index 46b97c3..471850e 100644 --- a/internal/clients/akuity/mock/argocd_service_gateway_client_mock.go +++ b/internal/clients/akuity/mock/argocd_service_gateway_client_mock.go @@ -162,6 +162,21 @@ func (mr *MockArgoCDServiceGatewayClientMockRecorder) GetAIAssistantUsageStats(a return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAIAssistantUsageStats", reflect.TypeOf((*MockArgoCDServiceGatewayClient)(nil).GetAIAssistantUsageStats), arg0, arg1) } +// GetClusterAPIServerCAData mocks base method. +func (m *MockArgoCDServiceGatewayClient) GetClusterAPIServerCAData(arg0 context.Context, arg1 *argocdv1.GetClusterAPIServerCADataRequest) (*argocdv1.GetClusterAPIServerCADataResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetClusterAPIServerCAData", arg0, arg1) + ret0, _ := ret[0].(*argocdv1.GetClusterAPIServerCADataResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetClusterAPIServerCAData indicates an expected call of GetClusterAPIServerCAData. +func (mr *MockArgoCDServiceGatewayClientMockRecorder) GetClusterAPIServerCAData(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClusterAPIServerCAData", reflect.TypeOf((*MockArgoCDServiceGatewayClient)(nil).GetClusterAPIServerCAData), arg0, arg1) +} + // GetInstance mocks base method. func (m *MockArgoCDServiceGatewayClient) GetInstance(arg0 context.Context, arg1 *argocdv1.GetInstanceRequest) (*argocdv1.GetInstanceResponse, error) { m.ctrl.T.Helper() @@ -703,6 +718,21 @@ func (mr *MockArgoCDServiceGatewayClientMockRecorder) UpdateInstanceResourceCust return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateInstanceResourceCustomizations", reflect.TypeOf((*MockArgoCDServiceGatewayClient)(nil).UpdateInstanceResourceCustomizations), arg0, arg1) } +// UpdateInstanceWorkspace mocks base method. +func (m *MockArgoCDServiceGatewayClient) UpdateInstanceWorkspace(arg0 context.Context, arg1 *argocdv1.UpdateInstanceWorkspaceRequest) (*argocdv1.UpdateInstanceWorkspaceResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateInstanceWorkspace", arg0, arg1) + ret0, _ := ret[0].(*argocdv1.UpdateInstanceWorkspaceResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateInstanceWorkspace indicates an expected call of UpdateInstanceWorkspace. +func (mr *MockArgoCDServiceGatewayClientMockRecorder) UpdateInstanceWorkspace(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateInstanceWorkspace", reflect.TypeOf((*MockArgoCDServiceGatewayClient)(nil).UpdateInstanceWorkspace), arg0, arg1) +} + // UpsertInstanceAccount mocks base method. func (m *MockArgoCDServiceGatewayClient) UpsertInstanceAccount(arg0 context.Context, arg1 *argocdv1.UpsertInstanceAccountRequest) (*argocdv1.UpsertInstanceAccountResponse, error) { m.ctrl.T.Helper() From 839df90cd9cb477a9792b46da4190b99f2758a86 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Fri, 5 Jul 2024 18:37:52 +0800 Subject: [PATCH 09/26] fix linter --- internal/types/cluster.go | 8 ++++---- internal/types/cluster_test.go | 4 ++-- internal/types/instance.go | 20 +++++++------------- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/internal/types/cluster.go b/internal/types/cluster.go index f8ec813..8ae8674 100644 --- a/internal/types/cluster.go +++ b/internal/types/cluster.go @@ -40,8 +40,8 @@ func AkuityAPIToCrossplaneClusterObservation(cluster *argocdv1.Cluster) (v1alpha ID: cluster.GetId(), Name: cluster.GetName(), Description: cluster.GetDescription(), - Namespace: cluster.GetNamespace(), - NamespaceScoped: cluster.GetNamespaceScoped(), + Namespace: cluster.GetData().GetNamespace(), + NamespaceScoped: cluster.GetData().GetNamespaceScoped(), Labels: cluster.GetData().GetLabels(), Annotations: cluster.GetData().GetAnnotations(), AutoUpgradeDisabled: cluster.GetData().GetAutoUpgradeDisabled(), @@ -173,12 +173,12 @@ func AkuityAPIToCrossplaneCluster(instanceID string, managedCluster v1alpha1.Clu Name: managedCluster.InstanceRef.Name, }, Name: cluster.GetName(), - Namespace: cluster.GetNamespace(), + Namespace: cluster.GetData().GetNamespace(), Labels: cluster.GetData().GetLabels(), Annotations: cluster.GetData().GetAnnotations(), ClusterSpec: generated.ClusterSpec{ Description: cluster.GetDescription(), - NamespaceScoped: cluster.GetNamespaceScoped(), + NamespaceScoped: cluster.GetData().GetNamespaceScoped(), Data: generated.ClusterData{ Size: generated.ClusterSize(size), AutoUpgradeDisabled: cluster.GetData().GetAutoUpgradeDisabled(), diff --git a/internal/types/cluster_test.go b/internal/types/cluster_test.go index 98d0792..7a8d862 100644 --- a/internal/types/cluster_test.go +++ b/internal/types/cluster_test.go @@ -41,8 +41,8 @@ func TestAkuityAPIToCrossplaneClusterObservation(t *testing.T) { ID: fixtures.ArgocdCluster.GetId(), Name: fixtures.ArgocdCluster.GetName(), Description: fixtures.ArgocdCluster.GetDescription(), - Namespace: fixtures.ArgocdCluster.GetNamespace(), - NamespaceScoped: fixtures.ArgocdCluster.GetNamespaceScoped(), + Namespace: fixtures.ArgocdCluster.GetData().GetNamespace(), + NamespaceScoped: fixtures.ArgocdCluster.GetData().GetNamespaceScoped(), Labels: fixtures.ArgocdCluster.GetData().GetLabels(), Annotations: fixtures.ArgocdCluster.GetData().GetAnnotations(), AutoUpgradeDisabled: fixtures.ArgocdCluster.GetData().GetAutoUpgradeDisabled(), diff --git a/internal/types/instance.go b/internal/types/instance.go index dfc52c8..77cd2e3 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -325,7 +325,7 @@ func AkuityAPIToCrossplaneInstanceSpec(instanceSpec *argocdv1.InstanceSpec) (cro RepoServerDelegate: AkuityAPIToCrossplaneRepoServerDelegate(instanceSpec.GetRepoServerDelegate()), AuditExtensionEnabled: instanceSpec.GetAuditExtensionEnabled(), SyncHistoryExtensionEnabled: instanceSpec.GetSyncHistoryExtensionEnabled(), - CrossplaneExtension: AkuityAPIToCrossplaneCrossplaneExtension(instanceSpec.CrossplaneExtension), + CrossplaneExtension: AkuityAPIToCrossplaneCrossplaneExtension(instanceSpec.GetCrossplaneExtension()), ImageUpdaterDelegate: AkuityAPIToCrossplaneImageUpdaterDelegate(instanceSpec.GetImageUpdaterDelegate()), AppSetDelegate: AkuityAPIToCrossplaneAppSetDelegate(instanceSpec.GetAppSetDelegate()), AssistantExtensionEnabled: instanceSpec.GetAssistantExtensionEnabled(), @@ -425,10 +425,10 @@ func AkuityAPIToCrossplaneCrossplaneExtension(crossplaneExtension *argocdv1.Cros return nil } - resources := make([]*crossplanetypes.CrossplaneExtensionResource, 0, len(crossplaneExtension.Resources)) - for _, r := range crossplaneExtension.Resources { + resources := make([]*crossplanetypes.CrossplaneExtensionResource, 0, len(crossplaneExtension.GetResources())) + for _, r := range crossplaneExtension.GetResources() { resource := &crossplanetypes.CrossplaneExtensionResource{ - Group: r.Group, + Group: r.GetGroup(), } resources = append(resources, resource) } @@ -496,17 +496,11 @@ func AkuityAPIToCrossplaneAgentPermissionsRules(agentPermissionsRules []*argocdv crossplaneAgentPermissionsRules := make([]*crossplanetypes.AgentPermissionsRule, 0, len(agentPermissionsRules)) for _, rule := range agentPermissionsRules { var apiGroups []string - for _, apiGroup := range rule.ApiGroups { - apiGroups = append(apiGroups, apiGroup) - } + apiGroups = append(apiGroups, rule.GetApiGroups()...) var resources []string - for _, resource := range rule.Resources { - resources = append(resources, resource) - } + resources = append(resources, rule.GetResources()...) var verbs []string - for _, verb := range rule.Verbs { - verbs = append(verbs, verb) - } + verbs = append(verbs, rule.GetVerbs()...) crossplaneAgentPermissionsRules = append(crossplaneAgentPermissionsRules, &crossplanetypes.AgentPermissionsRule{ ApiGroups: apiGroups, Resources: resources, From 71effe3f6728b45e6320fdd4db0e86eeabc17ad6 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Mon, 8 Jul 2024 13:39:45 +0800 Subject: [PATCH 10/26] fix bugs --- internal/types/cluster.go | 8 ++++---- internal/types/instance.go | 4 ++++ internal/types/test/fixtures/cluster.go | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/types/cluster.go b/internal/types/cluster.go index 8ae8674..d242384 100644 --- a/internal/types/cluster.go +++ b/internal/types/cluster.go @@ -187,11 +187,11 @@ func AkuityAPIToCrossplaneCluster(instanceID string, managedCluster v1alpha1.Clu TargetVersion: cluster.GetData().GetTargetVersion(), RedisTunneling: cluster.GetData().GetRedisTunneling(), DirectClusterSpec: AkuityAPIToCrossplaneDirectClusterSpec(cluster.GetData().GetDirectClusterSpec()), - DatadogAnnotationsEnabled: pointer.ToPointer(cluster.GetData().GetDatadogAnnotationsEnabled()), - EksAddonEnabled: pointer.ToPointer(cluster.GetData().GetEksAddonEnabled()), + DatadogAnnotationsEnabled: cluster.GetData().DatadogAnnotationsEnabled, + EksAddonEnabled: cluster.GetData().EksAddonEnabled, ManagedClusterConfig: AkuityAPIToCrossplaneManagedClusterConfig(cluster.GetData().GetManagedClusterConfig()), - MaintenanceMode: pointer.ToPointer(cluster.GetData().GetMaintenanceMode()), - MultiClusterK8SDashboardEnabled: pointer.ToPointer(cluster.GetData().GetMultiClusterK8SDashboardEnabled()), + MaintenanceMode: cluster.GetData().MaintenanceMode, + MultiClusterK8SDashboardEnabled: cluster.GetData().MultiClusterK8SDashboardEnabled, }, }, EnableInClusterKubeConfig: managedCluster.EnableInClusterKubeConfig, diff --git a/internal/types/instance.go b/internal/types/instance.go index 77cd2e3..a09fd7e 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -690,6 +690,10 @@ func CrossplaneToAkuityAPIHostAliases(hostAliasesList []*crossplanetypes.HostAli } func CrossplaneToAkuityAPIAgentPermissionsRules(agentPermissionsRules []*crossplanetypes.AgentPermissionsRule) []*akuitytypes.AgentPermissionsRule { + if len(agentPermissionsRules) == 0 { + return nil + } + akuityAgentPermissionsRules := make([]*akuitytypes.AgentPermissionsRule, 0, len(agentPermissionsRules)) for _, a := range agentPermissionsRules { copied := a.DeepCopy() diff --git a/internal/types/test/fixtures/cluster.go b/internal/types/test/fixtures/cluster.go index 669f4a8..6f7abc2 100644 --- a/internal/types/test/fixtures/cluster.go +++ b/internal/types/test/fixtures/cluster.go @@ -87,6 +87,8 @@ patches: Name: ClusterName, Namespace: "test-namespace", Data: &argocdv1.ClusterData{ + Namespace: "test-namespace", + NamespaceScoped: true, Labels: Labels, Annotations: Annotations, Size: argocdv1.ClusterSize_CLUSTER_SIZE_MEDIUM, From 5dd2ccd74ae7ad368eedcdc323bbace1871a65a4 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Mon, 8 Jul 2024 14:17:05 +0800 Subject: [PATCH 11/26] prevent lint for *bool values --- internal/types/cluster.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/types/cluster.go b/internal/types/cluster.go index d242384..5f494f2 100644 --- a/internal/types/cluster.go +++ b/internal/types/cluster.go @@ -187,11 +187,11 @@ func AkuityAPIToCrossplaneCluster(instanceID string, managedCluster v1alpha1.Clu TargetVersion: cluster.GetData().GetTargetVersion(), RedisTunneling: cluster.GetData().GetRedisTunneling(), DirectClusterSpec: AkuityAPIToCrossplaneDirectClusterSpec(cluster.GetData().GetDirectClusterSpec()), - DatadogAnnotationsEnabled: cluster.GetData().DatadogAnnotationsEnabled, - EksAddonEnabled: cluster.GetData().EksAddonEnabled, + DatadogAnnotationsEnabled: cluster.GetData().DatadogAnnotationsEnabled, //nolint:all + EksAddonEnabled: cluster.GetData().EksAddonEnabled, //nolint:all ManagedClusterConfig: AkuityAPIToCrossplaneManagedClusterConfig(cluster.GetData().GetManagedClusterConfig()), - MaintenanceMode: cluster.GetData().MaintenanceMode, - MultiClusterK8SDashboardEnabled: cluster.GetData().MultiClusterK8SDashboardEnabled, + MaintenanceMode: cluster.GetData().MaintenanceMode, //nolint:all + MultiClusterK8SDashboardEnabled: cluster.GetData().MultiClusterK8SDashboardEnabled, //nolint:all }, }, EnableInClusterKubeConfig: managedCluster.EnableInClusterKubeConfig, From 1085e6888d8e6f1ef31a85d95622f5386394fe5e Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Mon, 8 Jul 2024 15:08:12 +0800 Subject: [PATCH 12/26] use latest version of crossplane build --- .gitmodules | 2 +- build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index c2fad47..8f84209 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "build"] path = build - url = https://github.com/upbound/build + url = https://github.com/crossplane/build diff --git a/build b/build index 613d169..f67b099 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 613d1694ec9727b759b4ade8fd6b1f3e849c8267 +Subproject commit f67b099288946d6ae11625435cc541b580606e22 From 360e6f9477e363fd1f5d919d60d965a8fb319929 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Tue, 9 Jul 2024 16:14:50 +0800 Subject: [PATCH 13/26] remove unused keys --- internal/types/cluster.go | 73 ++++++++++----------------------------- 1 file changed, 18 insertions(+), 55 deletions(-) diff --git a/internal/types/cluster.go b/internal/types/cluster.go index 5f494f2..97e9c01 100644 --- a/internal/types/cluster.go +++ b/internal/types/cluster.go @@ -13,7 +13,6 @@ import ( "github.com/akuityio/provider-crossplane-akuity/apis/core/v1alpha1" akuitytypes "github.com/akuityio/provider-crossplane-akuity/internal/types/generated/akuity/v1alpha1" generated "github.com/akuityio/provider-crossplane-akuity/internal/types/generated/crossplane/v1alpha1" - "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" ) func AkuityAPIToCrossplaneClusterObservation(cluster *argocdv1.Cluster) (v1alpha1.ClusterObservation, error) { @@ -94,36 +93,6 @@ func AkuityAPIToClusterObservationAgentStateStatus(agentHealthStatuses map[strin return statuses } -func AkuityAPIToCrossplaneDirectClusterSpec(directClusterSpec *argocdv1.DirectClusterSpec) *generated.DirectClusterSpec { - if directClusterSpec == nil { - return nil - } - - return &generated.DirectClusterSpec{ - ClusterType: generated.DirectClusterType(directClusterSpec.GetClusterType()), - KargoInstanceId: pointer.ToPointer(directClusterSpec.GetKargoInstanceId()), - Server: pointer.ToPointer(directClusterSpec.GetServer()), - Organization: pointer.ToPointer(directClusterSpec.GetOrganization()), - Token: pointer.ToPointer(directClusterSpec.GetToken()), - CaData: pointer.ToPointer(directClusterSpec.GetCaData()), - } -} - -func CrossplaneToAkuityAPIDirectClusterSpec(directClusterSpec *generated.DirectClusterSpec) *akuitytypes.DirectClusterSpec { - if directClusterSpec == nil { - return nil - } - - return &akuitytypes.DirectClusterSpec{ - ClusterType: akuitytypes.DirectClusterType(directClusterSpec.ClusterType), - KargoInstanceId: pointer.CopyString(directClusterSpec.KargoInstanceId), - Server: pointer.CopyString(directClusterSpec.Server), - Organization: pointer.CopyString(directClusterSpec.Organization), - Token: pointer.CopyString(directClusterSpec.Token), - CaData: pointer.CopyString(directClusterSpec.CaData), - } -} - func AkuityAPIToCrossplaneManagedClusterConfig(managedClusterConfig *argocdv1.ManagedClusterConfig) *generated.ManagedClusterConfig { if managedClusterConfig == nil { return nil @@ -180,18 +149,15 @@ func AkuityAPIToCrossplaneCluster(instanceID string, managedCluster v1alpha1.Clu Description: cluster.GetDescription(), NamespaceScoped: cluster.GetData().GetNamespaceScoped(), Data: generated.ClusterData{ - Size: generated.ClusterSize(size), - AutoUpgradeDisabled: cluster.GetData().GetAutoUpgradeDisabled(), - Kustomization: string(kustomizationYAML), - AppReplication: cluster.GetData().GetAppReplication(), - TargetVersion: cluster.GetData().GetTargetVersion(), - RedisTunneling: cluster.GetData().GetRedisTunneling(), - DirectClusterSpec: AkuityAPIToCrossplaneDirectClusterSpec(cluster.GetData().GetDirectClusterSpec()), - DatadogAnnotationsEnabled: cluster.GetData().DatadogAnnotationsEnabled, //nolint:all - EksAddonEnabled: cluster.GetData().EksAddonEnabled, //nolint:all - ManagedClusterConfig: AkuityAPIToCrossplaneManagedClusterConfig(cluster.GetData().GetManagedClusterConfig()), - MaintenanceMode: cluster.GetData().MaintenanceMode, //nolint:all - MultiClusterK8SDashboardEnabled: cluster.GetData().MultiClusterK8SDashboardEnabled, //nolint:all + Size: generated.ClusterSize(size), + AutoUpgradeDisabled: cluster.GetData().GetAutoUpgradeDisabled(), + Kustomization: string(kustomizationYAML), + AppReplication: cluster.GetData().GetAppReplication(), + TargetVersion: cluster.GetData().GetTargetVersion(), + RedisTunneling: cluster.GetData().GetRedisTunneling(), + DatadogAnnotationsEnabled: cluster.GetData().DatadogAnnotationsEnabled, //nolint:all + EksAddonEnabled: cluster.GetData().EksAddonEnabled, //nolint:all + ManagedClusterConfig: AkuityAPIToCrossplaneManagedClusterConfig(cluster.GetData().GetManagedClusterConfig()), }, }, EnableInClusterKubeConfig: managedCluster.EnableInClusterKubeConfig, @@ -228,18 +194,15 @@ func CrossplaneToAkuityAPICluster(cluster v1alpha1.ClusterParameters) (akuitytyp Description: cluster.ClusterSpec.Description, NamespaceScoped: cluster.ClusterSpec.NamespaceScoped, Data: akuitytypes.ClusterData{ - Size: akuitytypes.ClusterSize(cluster.ClusterSpec.Data.Size), - AutoUpgradeDisabled: &cluster.ClusterSpec.Data.AutoUpgradeDisabled, - Kustomization: kustomization, - AppReplication: &cluster.ClusterSpec.Data.AppReplication, - TargetVersion: cluster.ClusterSpec.Data.TargetVersion, - RedisTunneling: &cluster.ClusterSpec.Data.RedisTunneling, - DirectClusterSpec: CrossplaneToAkuityAPIDirectClusterSpec(cluster.ClusterSpec.Data.DirectClusterSpec), - DatadogAnnotationsEnabled: cluster.ClusterSpec.Data.DatadogAnnotationsEnabled, - EksAddonEnabled: cluster.ClusterSpec.Data.EksAddonEnabled, - ManagedClusterConfig: CrossplaneToAkuityAPIManagedClusterConfig(cluster.ClusterSpec.Data.ManagedClusterConfig), - MaintenanceMode: cluster.ClusterSpec.Data.MaintenanceMode, - MultiClusterK8SDashboardEnabled: cluster.ClusterSpec.Data.MultiClusterK8SDashboardEnabled, + Size: akuitytypes.ClusterSize(cluster.ClusterSpec.Data.Size), + AutoUpgradeDisabled: &cluster.ClusterSpec.Data.AutoUpgradeDisabled, + Kustomization: kustomization, + AppReplication: &cluster.ClusterSpec.Data.AppReplication, + TargetVersion: cluster.ClusterSpec.Data.TargetVersion, + RedisTunneling: &cluster.ClusterSpec.Data.RedisTunneling, + DatadogAnnotationsEnabled: cluster.ClusterSpec.Data.DatadogAnnotationsEnabled, + EksAddonEnabled: cluster.ClusterSpec.Data.EksAddonEnabled, + ManagedClusterConfig: CrossplaneToAkuityAPIManagedClusterConfig(cluster.ClusterSpec.Data.ManagedClusterConfig), }, }, }, nil From fafec3ee0bc19801aa88bd688c43932495c6c54d Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Tue, 9 Jul 2024 16:19:57 +0800 Subject: [PATCH 14/26] remove unused attribute --- internal/types/instance.go | 74 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/internal/types/instance.go b/internal/types/instance.go index a09fd7e..ec956db 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -315,25 +315,24 @@ func AkuityAPIToCrossplaneInstanceSpec(instanceSpec *argocdv1.InstanceSpec) (cro } return crossplanetypes.InstanceSpec{ - IpAllowList: AkuityAPIToCrossplaneIPAllowListEntry(instanceSpec.GetIpAllowList()), - Subdomain: instanceSpec.GetSubdomain(), - DeclarativeManagementEnabled: instanceSpec.GetDeclarativeManagementEnabled(), - Extensions: AkuityAPIToCrossplaneArgoCDExtensionInstallEntry(instanceSpec.GetExtensions()), - ClusterCustomizationDefaults: clusterCustomization, - ImageUpdaterEnabled: instanceSpec.GetImageUpdaterEnabled(), - BackendIpAllowListEnabled: instanceSpec.GetBackendIpAllowListEnabled(), - RepoServerDelegate: AkuityAPIToCrossplaneRepoServerDelegate(instanceSpec.GetRepoServerDelegate()), - AuditExtensionEnabled: instanceSpec.GetAuditExtensionEnabled(), - SyncHistoryExtensionEnabled: instanceSpec.GetSyncHistoryExtensionEnabled(), - CrossplaneExtension: AkuityAPIToCrossplaneCrossplaneExtension(instanceSpec.GetCrossplaneExtension()), - ImageUpdaterDelegate: AkuityAPIToCrossplaneImageUpdaterDelegate(instanceSpec.GetImageUpdaterDelegate()), - AppSetDelegate: AkuityAPIToCrossplaneAppSetDelegate(instanceSpec.GetAppSetDelegate()), - AssistantExtensionEnabled: instanceSpec.GetAssistantExtensionEnabled(), - AppsetPolicy: AkuityAPIToCrossplaneAppsetPolicy(instanceSpec.GetAppsetPolicy()), - HostAliases: AkuityAPIToCrossplaneHostAliases(instanceSpec.GetHostAliases()), - AgentPermissionsRules: AkuityAPIToCrossplaneAgentPermissionsRules(instanceSpec.GetAgentPermissionsRules()), - Fqdn: instanceSpec.GetFqdn(), - MultiClusterK8SDashboardEnabled: instanceSpec.GetMultiClusterK8SDashboardEnabled(), + IpAllowList: AkuityAPIToCrossplaneIPAllowListEntry(instanceSpec.GetIpAllowList()), + Subdomain: instanceSpec.GetSubdomain(), + DeclarativeManagementEnabled: instanceSpec.GetDeclarativeManagementEnabled(), + Extensions: AkuityAPIToCrossplaneArgoCDExtensionInstallEntry(instanceSpec.GetExtensions()), + ClusterCustomizationDefaults: clusterCustomization, + ImageUpdaterEnabled: instanceSpec.GetImageUpdaterEnabled(), + BackendIpAllowListEnabled: instanceSpec.GetBackendIpAllowListEnabled(), + RepoServerDelegate: AkuityAPIToCrossplaneRepoServerDelegate(instanceSpec.GetRepoServerDelegate()), + AuditExtensionEnabled: instanceSpec.GetAuditExtensionEnabled(), + SyncHistoryExtensionEnabled: instanceSpec.GetSyncHistoryExtensionEnabled(), + CrossplaneExtension: AkuityAPIToCrossplaneCrossplaneExtension(instanceSpec.GetCrossplaneExtension()), + ImageUpdaterDelegate: AkuityAPIToCrossplaneImageUpdaterDelegate(instanceSpec.GetImageUpdaterDelegate()), + AppSetDelegate: AkuityAPIToCrossplaneAppSetDelegate(instanceSpec.GetAppSetDelegate()), + AssistantExtensionEnabled: instanceSpec.GetAssistantExtensionEnabled(), + AppsetPolicy: AkuityAPIToCrossplaneAppsetPolicy(instanceSpec.GetAppsetPolicy()), + HostAliases: AkuityAPIToCrossplaneHostAliases(instanceSpec.GetHostAliases()), + AgentPermissionsRules: AkuityAPIToCrossplaneAgentPermissionsRules(instanceSpec.GetAgentPermissionsRules()), + Fqdn: instanceSpec.GetFqdn(), }, nil } @@ -546,25 +545,24 @@ func CrossplaneToAkuityAPIInstanceSpec(instanceSpec crossplanetypes.InstanceSpec } return akuitytypes.InstanceSpec{ - IpAllowList: CrossplaneToAkuityAPIIPAllowListEntry(instanceSpec.IpAllowList), - Subdomain: instanceSpec.Subdomain, - DeclarativeManagementEnabled: instanceSpec.DeclarativeManagementEnabled, - Extensions: CrossplaneToAkuityAPIArgoCDExtensionInstallEntry(instanceSpec.Extensions), - ClusterCustomizationDefaults: clusterCustomization, - ImageUpdaterEnabled: instanceSpec.ImageUpdaterEnabled, - BackendIpAllowListEnabled: instanceSpec.BackendIpAllowListEnabled, - RepoServerDelegate: CrossplaneToAkuityAPIRepoServerDelegate(instanceSpec.RepoServerDelegate), - AuditExtensionEnabled: instanceSpec.AuditExtensionEnabled, - SyncHistoryExtensionEnabled: instanceSpec.SyncHistoryExtensionEnabled, - CrossplaneExtension: CrossplaneToAkuityAPICrossplaneExtension(instanceSpec.CrossplaneExtension), - ImageUpdaterDelegate: CrossplaneToAkuityAPIImageUpdaterDelegate(instanceSpec.ImageUpdaterDelegate), - AppSetDelegate: CrossplaneToAkuityAPIAppSetDelegate(instanceSpec.AppSetDelegate), - AssistantExtensionEnabled: instanceSpec.AssistantExtensionEnabled, - AppsetPolicy: CrossplaneToAkuityAPIAppsetPolicy(instanceSpec.AppsetPolicy), - HostAliases: CrossplaneToAkuityAPIHostAliases(instanceSpec.HostAliases), - AgentPermissionsRules: CrossplaneToAkuityAPIAgentPermissionsRules(instanceSpec.AgentPermissionsRules), - Fqdn: instanceSpec.Fqdn, - MultiClusterK8SDashboardEnabled: instanceSpec.MultiClusterK8SDashboardEnabled, + IpAllowList: CrossplaneToAkuityAPIIPAllowListEntry(instanceSpec.IpAllowList), + Subdomain: instanceSpec.Subdomain, + DeclarativeManagementEnabled: instanceSpec.DeclarativeManagementEnabled, + Extensions: CrossplaneToAkuityAPIArgoCDExtensionInstallEntry(instanceSpec.Extensions), + ClusterCustomizationDefaults: clusterCustomization, + ImageUpdaterEnabled: instanceSpec.ImageUpdaterEnabled, + BackendIpAllowListEnabled: instanceSpec.BackendIpAllowListEnabled, + RepoServerDelegate: CrossplaneToAkuityAPIRepoServerDelegate(instanceSpec.RepoServerDelegate), + AuditExtensionEnabled: instanceSpec.AuditExtensionEnabled, + SyncHistoryExtensionEnabled: instanceSpec.SyncHistoryExtensionEnabled, + CrossplaneExtension: CrossplaneToAkuityAPICrossplaneExtension(instanceSpec.CrossplaneExtension), + ImageUpdaterDelegate: CrossplaneToAkuityAPIImageUpdaterDelegate(instanceSpec.ImageUpdaterDelegate), + AppSetDelegate: CrossplaneToAkuityAPIAppSetDelegate(instanceSpec.AppSetDelegate), + AssistantExtensionEnabled: instanceSpec.AssistantExtensionEnabled, + AppsetPolicy: CrossplaneToAkuityAPIAppsetPolicy(instanceSpec.AppsetPolicy), + HostAliases: CrossplaneToAkuityAPIHostAliases(instanceSpec.HostAliases), + AgentPermissionsRules: CrossplaneToAkuityAPIAgentPermissionsRules(instanceSpec.AgentPermissionsRules), + Fqdn: instanceSpec.Fqdn, }, nil } From a12d3bc0a42b6bc8b24c96c248e8cd42cd5fdb0e Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Tue, 9 Jul 2024 16:36:14 +0800 Subject: [PATCH 15/26] use not found error --- internal/controller/cluster/cluster.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/controller/cluster/cluster.go b/internal/controller/cluster/cluster.go index fa1542d..949f498 100644 --- a/internal/controller/cluster/cluster.go +++ b/internal/controller/cluster/cluster.go @@ -47,7 +47,6 @@ import ( "github.com/akuityio/provider-crossplane-akuity/internal/clients/kube" "github.com/akuityio/provider-crossplane-akuity/internal/controller/config" "github.com/akuityio/provider-crossplane-akuity/internal/features" - "github.com/akuityio/provider-crossplane-akuity/internal/reason" "github.com/akuityio/provider-crossplane-akuity/internal/types" "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" ) @@ -156,12 +155,15 @@ func (c *External) Observe(ctx context.Context, mg resource.Managed) (managed.Ex akuityCluster, err := c.client.GetCluster(ctx, instanceID, meta.GetExternalName(managedCluster)) if err != nil { - if reason.IsNotFound(err) { - return managed.ExternalObservation{ResourceExists: false}, nil - } - - managedCluster.SetConditions(xpv1.ReconcileError(err)) - return managed.ExternalObservation{}, err + c.logger.Debug("As we are not able to differentiate PermissionDenied/NotFound when calling GetCluster, we simply treat as not found here", "error", err) + return managed.ExternalObservation{ResourceExists: false}, nil + + //if reason.IsNotFound(err) { + // return managed.ExternalObservation{ResourceExists: false}, nil + //} + // + //managedCluster.SetConditions(xpv1.ReconcileError(err)) + //return managed.ExternalObservation{}, err } actualCluster, err := types.AkuityAPIToCrossplaneCluster(instanceID, managedCluster.Spec.ForProvider, akuityCluster) From 9e4c88df468c8908e67d57a94dd83dc7a37f0437 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Tue, 9 Jul 2024 16:41:08 +0800 Subject: [PATCH 16/26] fix linter --- internal/controller/cluster/cluster.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/controller/cluster/cluster.go b/internal/controller/cluster/cluster.go index 949f498..a3e239d 100644 --- a/internal/controller/cluster/cluster.go +++ b/internal/controller/cluster/cluster.go @@ -158,12 +158,12 @@ func (c *External) Observe(ctx context.Context, mg resource.Managed) (managed.Ex c.logger.Debug("As we are not able to differentiate PermissionDenied/NotFound when calling GetCluster, we simply treat as not found here", "error", err) return managed.ExternalObservation{ResourceExists: false}, nil - //if reason.IsNotFound(err) { - // return managed.ExternalObservation{ResourceExists: false}, nil - //} + // if reason.IsNotFound(err) { + // return managed.ExternalObservation{ResourceExists: false}, nil + // } // - //managedCluster.SetConditions(xpv1.ReconcileError(err)) - //return managed.ExternalObservation{}, err + // managedCluster.SetConditions(xpv1.ReconcileError(err)) + // return managed.ExternalObservation{}, err } actualCluster, err := types.AkuityAPIToCrossplaneCluster(instanceID, managedCluster.Spec.ForProvider, akuityCluster) From 6275b0ac4b690f6b11d5b2c2a29df6f9df47696d Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 13:37:39 +0800 Subject: [PATCH 17/26] use default value --- internal/utils/pointer/value.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/internal/utils/pointer/value.go b/internal/utils/pointer/value.go index 1d93dd4..4bd2bfc 100644 --- a/internal/utils/pointer/value.go +++ b/internal/utils/pointer/value.go @@ -4,17 +4,10 @@ func ToPointer[T any](value T) *T { return &value } -func ToValue[T any](value *T, defaultValue T) T { +func ToValue[T any](value *T) T { + var zero T if value == nil { - return defaultValue + return zero } return *value } - -func CopyString(s *string) *string { - if s == nil { - return nil - } - - return ToPointer(ToValue(s, "")) -} From 1f2ead1962d095fa188852a0b399c026ded29ce8 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 13:38:46 +0800 Subject: [PATCH 18/26] use pointer type --- .../akuity/v1alpha1/argocdinstance_types.go | 28 +++++++++---------- internal/types/instance.go | 27 +++++++++--------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go index 83572d1..205d824 100644 --- a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go @@ -47,15 +47,15 @@ type ArgoCDExtensionInstallEntry struct { } type ClusterCustomization struct { - AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` + AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` Kustomization runtime.RawExtension `json:"kustomization,omitempty"` - AppReplication bool `json:"appReplication,omitempty"` - RedisTunneling bool `json:"redisTunneling,omitempty"` + AppReplication *bool `json:"appReplication,omitempty"` + RedisTunneling *bool `json:"redisTunneling,omitempty"` } type AppsetPolicy struct { Policy string `json:"policy,omitempty"` - OverridePolicy bool `json:"overridePolicy,omitempty"` + OverridePolicy *bool `json:"overridePolicy,omitempty"` } type AgentPermissionsRule struct { @@ -75,23 +75,23 @@ type CrossplaneExtension struct { type InstanceSpec struct { IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` Subdomain string `json:"subdomain,omitempty"` - DeclarativeManagementEnabled bool `json:"declarativeManagementEnabled,omitempty"` + DeclarativeManagementEnabled *bool `json:"declarativeManagementEnabled,omitempty"` Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` - ImageUpdaterEnabled bool `json:"imageUpdaterEnabled,omitempty"` - BackendIpAllowListEnabled bool `json:"backendIpAllowListEnabled,omitempty"` + ImageUpdaterEnabled *bool `json:"imageUpdaterEnabled,omitempty"` + BackendIpAllowListEnabled *bool `json:"backendIpAllowListEnabled,omitempty"` RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` - AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` - SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` + AuditExtensionEnabled *bool `json:"auditExtensionEnabled,omitempty"` + SyncHistoryExtensionEnabled *bool `json:"syncHistoryExtensionEnabled,omitempty"` CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` - AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` + AssistantExtensionEnabled *bool `json:"assistantExtensionEnabled,omitempty"` AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` HostAliases []*HostAliases `json:"hostAliases,omitempty"` AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` - Fqdn string `json:"fqdn,omitempty"` - MultiClusterK8SDashboardEnabled bool `json:"multiClusterK8sDashboardEnabled,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + MultiClusterK8SDashboardEnabled *bool `json:"multiClusterK8sDashboardEnabled,omitempty"` } type ManagedCluster struct { @@ -99,12 +99,12 @@ type ManagedCluster struct { } type RepoServerDelegate struct { - ControlPlane bool `json:"controlPlane,omitempty"` + ControlPlane *bool `json:"controlPlane,omitempty"` ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"` } type ImageUpdaterDelegate struct { - ControlPlane bool `json:"controlPlane,omitempty"` + ControlPlane *bool `json:"controlPlane,omitempty"` ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"` } diff --git a/internal/types/instance.go b/internal/types/instance.go index ec956db..c15231a 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -2,6 +2,7 @@ package types import ( "fmt" + "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" "strconv" argocdv1 "github.com/akuity/api-client-go/pkg/api/gen/argocd/v1" @@ -547,22 +548,22 @@ func CrossplaneToAkuityAPIInstanceSpec(instanceSpec crossplanetypes.InstanceSpec return akuitytypes.InstanceSpec{ IpAllowList: CrossplaneToAkuityAPIIPAllowListEntry(instanceSpec.IpAllowList), Subdomain: instanceSpec.Subdomain, - DeclarativeManagementEnabled: instanceSpec.DeclarativeManagementEnabled, + DeclarativeManagementEnabled: pointer.ToPointer(instanceSpec.DeclarativeManagementEnabled), Extensions: CrossplaneToAkuityAPIArgoCDExtensionInstallEntry(instanceSpec.Extensions), ClusterCustomizationDefaults: clusterCustomization, - ImageUpdaterEnabled: instanceSpec.ImageUpdaterEnabled, - BackendIpAllowListEnabled: instanceSpec.BackendIpAllowListEnabled, + ImageUpdaterEnabled: pointer.ToPointer(instanceSpec.ImageUpdaterEnabled), + BackendIpAllowListEnabled: pointer.ToPointer(instanceSpec.BackendIpAllowListEnabled), RepoServerDelegate: CrossplaneToAkuityAPIRepoServerDelegate(instanceSpec.RepoServerDelegate), - AuditExtensionEnabled: instanceSpec.AuditExtensionEnabled, - SyncHistoryExtensionEnabled: instanceSpec.SyncHistoryExtensionEnabled, + AuditExtensionEnabled: pointer.ToPointer(instanceSpec.AuditExtensionEnabled), + SyncHistoryExtensionEnabled: pointer.ToPointer(instanceSpec.SyncHistoryExtensionEnabled), CrossplaneExtension: CrossplaneToAkuityAPICrossplaneExtension(instanceSpec.CrossplaneExtension), ImageUpdaterDelegate: CrossplaneToAkuityAPIImageUpdaterDelegate(instanceSpec.ImageUpdaterDelegate), AppSetDelegate: CrossplaneToAkuityAPIAppSetDelegate(instanceSpec.AppSetDelegate), - AssistantExtensionEnabled: instanceSpec.AssistantExtensionEnabled, + AssistantExtensionEnabled: pointer.ToPointer(instanceSpec.AssistantExtensionEnabled), AppsetPolicy: CrossplaneToAkuityAPIAppsetPolicy(instanceSpec.AppsetPolicy), HostAliases: CrossplaneToAkuityAPIHostAliases(instanceSpec.HostAliases), AgentPermissionsRules: CrossplaneToAkuityAPIAgentPermissionsRules(instanceSpec.AgentPermissionsRules), - Fqdn: instanceSpec.Fqdn, + Fqdn: pointer.ToPointer(instanceSpec.Fqdn), }, nil } @@ -603,10 +604,10 @@ func CrossplaneToAkuityAPIClusterCustomization(clusterCustomization *crossplanet } return &akuitytypes.ClusterCustomization{ - AutoUpgradeDisabled: clusterCustomization.AutoUpgradeDisabled, + AutoUpgradeDisabled: pointer.ToPointer(clusterCustomization.AutoUpgradeDisabled), Kustomization: kustomization, - AppReplication: clusterCustomization.AppReplication, - RedisTunneling: clusterCustomization.RedisTunneling, + AppReplication: pointer.ToPointer(clusterCustomization.AppReplication), + RedisTunneling: pointer.ToPointer(clusterCustomization.RedisTunneling), }, nil } @@ -616,7 +617,7 @@ func CrossplaneToAkuityAPIRepoServerDelegate(repoServerDelegate *crossplanetypes } return &akuitytypes.RepoServerDelegate{ - ControlPlane: repoServerDelegate.ControlPlane, + ControlPlane: pointer.ToPointer(repoServerDelegate.ControlPlane), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: repoServerDelegate.ManagedCluster.ClusterName, }, @@ -644,7 +645,7 @@ func CrossplaneToAkuityAPIImageUpdaterDelegate(imageUpdaterDelegate *crossplanet } return &akuitytypes.ImageUpdaterDelegate{ - ControlPlane: imageUpdaterDelegate.ControlPlane, + ControlPlane: pointer.ToPointer(imageUpdaterDelegate.ControlPlane), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: imageUpdaterDelegate.ManagedCluster.ClusterName, }, @@ -670,7 +671,7 @@ func CrossplaneToAkuityAPIAppsetPolicy(appsetPolicy *crossplanetypes.AppsetPolic return &akuitytypes.AppsetPolicy{ Policy: appsetPolicy.Policy, - OverridePolicy: appsetPolicy.OverridePolicy, + OverridePolicy: pointer.ToPointer(appsetPolicy.OverridePolicy), } } From 06ac675ebfe74fce914f7d629c0218675cf08787 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 16:39:30 +0800 Subject: [PATCH 19/26] fix compiler error for test case --- internal/controller/cluster/cluster_test.go | 10 +++++--- internal/types/instance.go | 2 +- internal/types/test/fixtures/instance.go | 26 +++++++++++---------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/internal/controller/cluster/cluster_test.go b/internal/controller/cluster/cluster_test.go index e588500..a1d2174 100644 --- a/internal/controller/cluster/cluster_test.go +++ b/internal/controller/cluster/cluster_test.go @@ -394,9 +394,13 @@ func TestObserve_GetClusterErr(t *testing.T) { Return(nil, errors.New("fake")).Times(1) resp, err := client.Observe(ctx, &managedCluster) - require.Error(t, err) - assert.Equal(t, managed.ExternalObservation{}, resp) - assert.Equal(t, xpv1.ReasonReconcileError, managedCluster.Status.Conditions[0].Reason) + // require.Error(t, err) + // assert.Equal(t, managed.ExternalObservation{}, resp) + // assert.Equal(t, xpv1.ReasonReconcileError, managedCluster.Status.Conditions[0].Reason) + + // we use not found for permission denied error + require.NoError(t, err) + assert.Equal(t, managed.ExternalObservation{ResourceExists: false}, resp) } func TestObserve_HealthStatusNotHealthy(t *testing.T) { diff --git a/internal/types/instance.go b/internal/types/instance.go index c15231a..40bc0a4 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -2,10 +2,10 @@ package types import ( "fmt" - "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" "strconv" argocdv1 "github.com/akuity/api-client-go/pkg/api/gen/argocd/v1" + "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" "google.golang.org/protobuf/types/known/structpb" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/internal/types/test/fixtures/instance.go b/internal/types/test/fixtures/instance.go index 0361b35..6ea9ef0 100644 --- a/internal/types/test/fixtures/instance.go +++ b/internal/types/test/fixtures/instance.go @@ -2,6 +2,7 @@ package fixtures import ( argocdv1 "github.com/akuity/api-client-go/pkg/api/gen/argocd/v1" + "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" "github.com/akuityio/provider-crossplane-akuity/apis/core/v1alpha1" akuitytypes "github.com/akuityio/provider-crossplane-akuity/internal/types/generated/akuity/v1alpha1" @@ -47,7 +48,7 @@ var ( AkuityAppsetPolicy = &akuitytypes.AppsetPolicy{ Policy: "policy", - OverridePolicy: true, + OverridePolicy: pointer.ToPointer(true), } ArgocdAppsetPolicy = &argocdv1.AppsetPolicy{ @@ -79,7 +80,7 @@ var ( } AkuityImageUpdaterDelegate = &akuitytypes.ImageUpdaterDelegate{ - ControlPlane: true, + ControlPlane: pointer.ToPointer(true), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: "test-cluster", }, @@ -100,7 +101,7 @@ var ( } AkuityRepoServerDelegate = &akuitytypes.RepoServerDelegate{ - ControlPlane: true, + ControlPlane: pointer.ToPointer(true), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: "test-cluster", }, @@ -187,10 +188,10 @@ var ( } AkuityClusterCustomization = &akuitytypes.ClusterCustomization{ - AutoUpgradeDisabled: true, + AutoUpgradeDisabled: pointer.ToPointer(true), Kustomization: Kustomization, - AppReplication: true, - RedisTunneling: true, + AppReplication: pointer.ToPointer(true), + RedisTunneling: pointer.ToPointer(true), } ArgocdClusterCustomization = &argocdv1.ClusterCustomization{ @@ -210,19 +211,20 @@ var ( AkuityInstanceSpec = akuitytypes.InstanceSpec{ IpAllowList: AkuityIpAllowList, Subdomain: "example.com", - DeclarativeManagementEnabled: true, + DeclarativeManagementEnabled: pointer.ToPointer(true), Extensions: AkuityInstallEntryList, ClusterCustomizationDefaults: AkuityClusterCustomization, - ImageUpdaterEnabled: true, - BackendIpAllowListEnabled: true, + ImageUpdaterEnabled: pointer.ToPointer(true), + BackendIpAllowListEnabled: pointer.ToPointer(true), RepoServerDelegate: AkuityRepoServerDelegate, - AuditExtensionEnabled: true, - SyncHistoryExtensionEnabled: true, + AuditExtensionEnabled: pointer.ToPointer(true), + SyncHistoryExtensionEnabled: pointer.ToPointer(true), ImageUpdaterDelegate: AkuityImageUpdaterDelegate, AppSetDelegate: AkuityAppSetDelegate, - AssistantExtensionEnabled: true, + AssistantExtensionEnabled: pointer.ToPointer(true), AppsetPolicy: AkuityAppsetPolicy, HostAliases: AkuityHostAliasesList, + Fqdn: pointer.ToPointer(""), } ArgocdInstanceSpec = &argocdv1.InstanceSpec{ From f20f9ad89756aedb6a6f6f42207ecb50a8f271d1 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 17:29:59 +0800 Subject: [PATCH 20/26] add comment; remove unused attribute --- internal/controller/cluster/cluster.go | 3 + .../akuity/v1alpha1/argocdinstance_types.go | 60 ++++----- .../akuity/v1alpha1/cluster_types.go | 49 ++------ .../akuity/v1alpha1/zz_generated.deepcopy.go | 119 ------------------ .../v1alpha1/argocdinstance_types.go | 37 +++--- .../crossplane/v1alpha1/cluster_types.go | 38 ++---- .../v1alpha1/zz_generated.deepcopy.go | 77 ------------ 7 files changed, 60 insertions(+), 323 deletions(-) diff --git a/internal/controller/cluster/cluster.go b/internal/controller/cluster/cluster.go index a3e239d..0b31c85 100644 --- a/internal/controller/cluster/cluster.go +++ b/internal/controller/cluster/cluster.go @@ -158,6 +158,9 @@ func (c *External) Observe(ctx context.Context, mg resource.Managed) (managed.Ex c.logger.Debug("As we are not able to differentiate PermissionDenied/NotFound when calling GetCluster, we simply treat as not found here", "error", err) return managed.ExternalObservation{ResourceExists: false}, nil + // As mentioned above, we simply treat PermissionDenied/NotFound as not found error here, otherwise, the provider + // is not able to create cluster. + // if reason.IsNotFound(err) { // return managed.ExternalObservation{ResourceExists: false}, nil // } diff --git a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go index 205d824..d06e008 100644 --- a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go @@ -10,10 +10,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// ArgoCD is the Schema for the argocd API type ArgoCD struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -21,23 +17,10 @@ type ArgoCD struct { Spec ArgoCDSpec `json:"spec,omitempty"` } -//+kubebuilder:object:root=true - -// ArgoCDList contains a list of ArgoCD -type ArgoCDList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ArgoCD `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ArgoCD{}, &ArgoCDList{}) -} - type ArgoCDSpec struct { - Description string `json:"description"` - Version string `json:"version"` - Shard string `json:"shard"` + Description string `json:"description"` + Version string `json:"version"` + InstanceSpec InstanceSpec `json:"instanceSpec,omitempty"` } @@ -73,25 +56,24 @@ type CrossplaneExtension struct { } type InstanceSpec struct { - IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` - Subdomain string `json:"subdomain,omitempty"` - DeclarativeManagementEnabled *bool `json:"declarativeManagementEnabled,omitempty"` - Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` - ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` - ImageUpdaterEnabled *bool `json:"imageUpdaterEnabled,omitempty"` - BackendIpAllowListEnabled *bool `json:"backendIpAllowListEnabled,omitempty"` - RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` - AuditExtensionEnabled *bool `json:"auditExtensionEnabled,omitempty"` - SyncHistoryExtensionEnabled *bool `json:"syncHistoryExtensionEnabled,omitempty"` - CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` - ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` - AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` - AssistantExtensionEnabled *bool `json:"assistantExtensionEnabled,omitempty"` - AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` - HostAliases []*HostAliases `json:"hostAliases,omitempty"` - AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - MultiClusterK8SDashboardEnabled *bool `json:"multiClusterK8sDashboardEnabled,omitempty"` + IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` + Subdomain string `json:"subdomain,omitempty"` + DeclarativeManagementEnabled *bool `json:"declarativeManagementEnabled,omitempty"` + Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` + ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` + ImageUpdaterEnabled *bool `json:"imageUpdaterEnabled,omitempty"` + BackendIpAllowListEnabled *bool `json:"backendIpAllowListEnabled,omitempty"` + RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` + AuditExtensionEnabled *bool `json:"auditExtensionEnabled,omitempty"` + SyncHistoryExtensionEnabled *bool `json:"syncHistoryExtensionEnabled,omitempty"` + CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` + ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` + AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` + AssistantExtensionEnabled *bool `json:"assistantExtensionEnabled,omitempty"` + AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` + HostAliases []*HostAliases `json:"hostAliases,omitempty"` + AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` } type ManagedCluster struct { diff --git a/internal/types/generated/akuity/v1alpha1/cluster_types.go b/internal/types/generated/akuity/v1alpha1/cluster_types.go index cd3b5d9..4002afc 100644 --- a/internal/types/generated/akuity/v1alpha1/cluster_types.go +++ b/internal/types/generated/akuity/v1alpha1/cluster_types.go @@ -10,10 +10,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Cluster is the Schema for the cluster API type Cluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -23,52 +19,25 @@ type Cluster struct { type ClusterSize string -type DirectClusterType string - -//+kubebuilder:object:root=true - -// ClusterList contains a list of Cluster -type ClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Cluster `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Cluster{}, &ClusterList{}) -} - type ClusterSpec struct { Description string `json:"description,omitempty"` NamespaceScoped bool `json:"namespaceScoped,omitempty"` Data ClusterData `json:"data,omitempty"` } -type DirectClusterSpec struct { - ClusterType DirectClusterType `json:"clusterType,omitempty"` - KargoInstanceId *string `json:"kargoInstanceId,omitempty"` - Server *string `json:"server,omitempty"` - Organization *string `json:"organization,omitempty"` - Token *string `json:"token,omitempty"` - CaData *string `json:"caData,omitempty"` -} - type ManagedClusterConfig struct { SecretName string `json:"secretName,omitempty"` SecretKey string `json:"secretKey,omitempty"` } type ClusterData struct { - Size ClusterSize `json:"size,omitempty"` - AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization runtime.RawExtension `json:"kustomization,omitempty"` - AppReplication *bool `json:"appReplication,omitempty"` - TargetVersion string `json:"targetVersion,omitempty"` - RedisTunneling *bool `json:"redisTunneling,omitempty"` - DirectClusterSpec *DirectClusterSpec `json:"directClusterSpec,omitempty"` - DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` - EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` - ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` - MaintenanceMode *bool `json:"maintenanceMode,omitempty"` - MultiClusterK8SDashboardEnabled *bool `json:"multiClusterK8sDashboardEnabled,omitempty"` + Size ClusterSize `json:"size,omitempty"` + AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization runtime.RawExtension `json:"kustomization,omitempty"` + AppReplication *bool `json:"appReplication,omitempty"` + TargetVersion string `json:"targetVersion,omitempty"` + RedisTunneling *bool `json:"redisTunneling,omitempty"` + DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` + EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` + ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` } diff --git a/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go index 001aca5..88d1154 100644 --- a/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go @@ -114,38 +114,6 @@ func (in *ArgoCDExtensionInstallEntry) DeepCopy() *ArgoCDExtensionInstallEntry { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ArgoCDList) DeepCopyInto(out *ArgoCDList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ArgoCD, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoCDList. -func (in *ArgoCDList) DeepCopy() *ArgoCDList { - if in == nil { - return nil - } - out := new(ArgoCDList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ArgoCDList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArgoCDSpec) DeepCopyInto(out *ArgoCDSpec) { *out = *in @@ -223,11 +191,6 @@ func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = new(bool) **out = **in } - if in.DirectClusterSpec != nil { - in, out := &in.DirectClusterSpec, &out.DirectClusterSpec - *out = new(DirectClusterSpec) - (*in).DeepCopyInto(*out) - } if in.DatadogAnnotationsEnabled != nil { in, out := &in.DatadogAnnotationsEnabled, &out.DatadogAnnotationsEnabled *out = new(bool) @@ -243,16 +206,6 @@ func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = new(ManagedClusterConfig) **out = **in } - if in.MaintenanceMode != nil { - in, out := &in.MaintenanceMode, &out.MaintenanceMode - *out = new(bool) - **out = **in - } - if in.MultiClusterK8SDashboardEnabled != nil { - in, out := &in.MultiClusterK8SDashboardEnabled, &out.MultiClusterK8SDashboardEnabled - *out = new(bool) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterData. @@ -265,38 +218,6 @@ func (in *ClusterData) DeepCopy() *ClusterData { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { *out = *in @@ -354,46 +275,6 @@ func (in *CrossplaneExtensionResource) DeepCopy() *CrossplaneExtensionResource { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DirectClusterSpec) DeepCopyInto(out *DirectClusterSpec) { - *out = *in - if in.KargoInstanceId != nil { - in, out := &in.KargoInstanceId, &out.KargoInstanceId - *out = new(string) - **out = **in - } - if in.Server != nil { - in, out := &in.Server, &out.Server - *out = new(string) - **out = **in - } - if in.Organization != nil { - in, out := &in.Organization, &out.Organization - *out = new(string) - **out = **in - } - if in.Token != nil { - in, out := &in.Token, &out.Token - *out = new(string) - **out = **in - } - if in.CaData != nil { - in, out := &in.CaData, &out.CaData - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DirectClusterSpec. -func (in *DirectClusterSpec) DeepCopy() *DirectClusterSpec { - if in == nil { - return nil - } - out := new(DirectClusterSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HostAliases) DeepCopyInto(out *HostAliases) { *out = *in diff --git a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go index 4a2fced..1a61ebb 100644 --- a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go @@ -61,25 +61,24 @@ type CrossplaneExtension struct { // +kubebuilder:object:generate=true type InstanceSpec struct { - IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` - Subdomain string `json:"subdomain,omitempty"` - DeclarativeManagementEnabled bool `json:"declarativeManagementEnabled,omitempty"` - Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` - ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` - ImageUpdaterEnabled bool `json:"imageUpdaterEnabled,omitempty"` - BackendIpAllowListEnabled bool `json:"backendIpAllowListEnabled,omitempty"` - RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` - AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` - SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` - CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` - ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` - AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` - AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` - AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` - HostAliases []*HostAliases `json:"hostAliases,omitempty"` - AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` - Fqdn string `json:"fqdn,omitempty"` - MultiClusterK8SDashboardEnabled bool `json:"multiClusterK8sDashboardEnabled,omitempty"` + IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` + Subdomain string `json:"subdomain,omitempty"` + DeclarativeManagementEnabled bool `json:"declarativeManagementEnabled,omitempty"` + Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` + ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` + ImageUpdaterEnabled bool `json:"imageUpdaterEnabled,omitempty"` + BackendIpAllowListEnabled bool `json:"backendIpAllowListEnabled,omitempty"` + RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` + AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` + SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` + CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` + ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` + AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` + AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` + AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` + HostAliases []*HostAliases `json:"hostAliases,omitempty"` + AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` + Fqdn string `json:"fqdn,omitempty"` } // +kubebuilder:object:generate=true diff --git a/internal/types/generated/crossplane/v1alpha1/cluster_types.go b/internal/types/generated/crossplane/v1alpha1/cluster_types.go index 0997c04..8a1de52 100644 --- a/internal/types/generated/crossplane/v1alpha1/cluster_types.go +++ b/internal/types/generated/crossplane/v1alpha1/cluster_types.go @@ -7,18 +7,11 @@ package v1alpha1 type ClusterSize string -type DirectClusterType string - // +kubebuilder:object:generate=true type Cluster struct { Spec ClusterSpec `json:"spec,omitempty"` } -// +kubebuilder:object:generate=true -type ClusterList struct { - Items []Cluster `json:"items"` -} - // +kubebuilder:object:generate=true type ClusterSpec struct { Description string `json:"description,omitempty"` @@ -26,16 +19,6 @@ type ClusterSpec struct { Data ClusterData `json:"data,omitempty"` } -// +kubebuilder:object:generate=true -type DirectClusterSpec struct { - ClusterType DirectClusterType `json:"clusterType,omitempty"` - KargoInstanceId *string `json:"kargoInstanceId,omitempty"` - Server *string `json:"server,omitempty"` - Organization *string `json:"organization,omitempty"` - Token *string `json:"token,omitempty"` - CaData *string `json:"caData,omitempty"` -} - // +kubebuilder:object:generate=true type ManagedClusterConfig struct { SecretName string `json:"secretName,omitempty"` @@ -44,16 +27,13 @@ type ManagedClusterConfig struct { // +kubebuilder:object:generate=true type ClusterData struct { - Size ClusterSize `json:"size,omitempty"` - AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization string `json:"kustomization,omitempty"` - AppReplication bool `json:"appReplication,omitempty"` - TargetVersion string `json:"targetVersion,omitempty"` - RedisTunneling bool `json:"redisTunneling,omitempty"` - DirectClusterSpec *DirectClusterSpec `json:"directClusterSpec,omitempty"` - DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` - EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` - ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` - MaintenanceMode *bool `json:"maintenanceMode,omitempty"` - MultiClusterK8SDashboardEnabled *bool `json:"multiClusterK8sDashboardEnabled,omitempty"` + Size ClusterSize `json:"size,omitempty"` + AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization string `json:"kustomization,omitempty"` + AppReplication bool `json:"appReplication,omitempty"` + TargetVersion string `json:"targetVersion,omitempty"` + RedisTunneling bool `json:"redisTunneling,omitempty"` + DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` + EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` + ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` } diff --git a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go index ddb1fa0..d2deadd 100644 --- a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go @@ -174,11 +174,6 @@ func (in *ClusterCustomization) DeepCopy() *ClusterCustomization { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = *in - if in.DirectClusterSpec != nil { - in, out := &in.DirectClusterSpec, &out.DirectClusterSpec - *out = new(DirectClusterSpec) - (*in).DeepCopyInto(*out) - } if in.DatadogAnnotationsEnabled != nil { in, out := &in.DatadogAnnotationsEnabled, &out.DatadogAnnotationsEnabled *out = new(bool) @@ -194,16 +189,6 @@ func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = new(ManagedClusterConfig) **out = **in } - if in.MaintenanceMode != nil { - in, out := &in.MaintenanceMode, &out.MaintenanceMode - *out = new(bool) - **out = **in - } - if in.MultiClusterK8SDashboardEnabled != nil { - in, out := &in.MultiClusterK8SDashboardEnabled, &out.MultiClusterK8SDashboardEnabled - *out = new(bool) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterData. @@ -216,28 +201,6 @@ func (in *ClusterData) DeepCopy() *ClusterData { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { *out = *in @@ -358,46 +321,6 @@ func (in *CrossplaneExtensionResource) DeepCopy() *CrossplaneExtensionResource { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DirectClusterSpec) DeepCopyInto(out *DirectClusterSpec) { - *out = *in - if in.KargoInstanceId != nil { - in, out := &in.KargoInstanceId, &out.KargoInstanceId - *out = new(string) - **out = **in - } - if in.Server != nil { - in, out := &in.Server, &out.Server - *out = new(string) - **out = **in - } - if in.Organization != nil { - in, out := &in.Organization, &out.Organization - *out = new(string) - **out = **in - } - if in.Token != nil { - in, out := &in.Token, &out.Token - *out = new(string) - **out = **in - } - if in.CaData != nil { - in, out := &in.CaData, &out.CaData - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DirectClusterSpec. -func (in *DirectClusterSpec) DeepCopy() *DirectClusterSpec { - if in == nil { - return nil - } - out := new(DirectClusterSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Discover) DeepCopyInto(out *Discover) { *out = *in From c540817cb1563e5ae268932721759ea2702c13d5 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 17:54:09 +0800 Subject: [PATCH 21/26] use ptr.To instead of pointer.ToPointer --- internal/controller/cluster/cluster.go | 2 +- internal/types/instance.go | 28 ++++++++++++------------ internal/types/test/fixtures/instance.go | 28 ++++++++++++------------ internal/utils/pointer/value.go | 13 ----------- 4 files changed, 29 insertions(+), 42 deletions(-) delete mode 100644 internal/utils/pointer/value.go diff --git a/internal/controller/cluster/cluster.go b/internal/controller/cluster/cluster.go index 0b31c85..2b2ded9 100644 --- a/internal/controller/cluster/cluster.go +++ b/internal/controller/cluster/cluster.go @@ -160,7 +160,7 @@ func (c *External) Observe(ctx context.Context, mg resource.Managed) (managed.Ex // As mentioned above, we simply treat PermissionDenied/NotFound as not found error here, otherwise, the provider // is not able to create cluster. - + // if reason.IsNotFound(err) { // return managed.ExternalObservation{ResourceExists: false}, nil // } diff --git a/internal/types/instance.go b/internal/types/instance.go index 40bc0a4..1f026cc 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -5,11 +5,11 @@ import ( "strconv" argocdv1 "github.com/akuity/api-client-go/pkg/api/gen/argocd/v1" - "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" "google.golang.org/protobuf/types/known/structpb" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/utils/ptr" "sigs.k8s.io/yaml" "github.com/akuityio/provider-crossplane-akuity/apis/core/v1alpha1" @@ -548,22 +548,22 @@ func CrossplaneToAkuityAPIInstanceSpec(instanceSpec crossplanetypes.InstanceSpec return akuitytypes.InstanceSpec{ IpAllowList: CrossplaneToAkuityAPIIPAllowListEntry(instanceSpec.IpAllowList), Subdomain: instanceSpec.Subdomain, - DeclarativeManagementEnabled: pointer.ToPointer(instanceSpec.DeclarativeManagementEnabled), + DeclarativeManagementEnabled: ptr.To(instanceSpec.DeclarativeManagementEnabled), Extensions: CrossplaneToAkuityAPIArgoCDExtensionInstallEntry(instanceSpec.Extensions), ClusterCustomizationDefaults: clusterCustomization, - ImageUpdaterEnabled: pointer.ToPointer(instanceSpec.ImageUpdaterEnabled), - BackendIpAllowListEnabled: pointer.ToPointer(instanceSpec.BackendIpAllowListEnabled), + ImageUpdaterEnabled: ptr.To(instanceSpec.ImageUpdaterEnabled), + BackendIpAllowListEnabled: ptr.To(instanceSpec.BackendIpAllowListEnabled), RepoServerDelegate: CrossplaneToAkuityAPIRepoServerDelegate(instanceSpec.RepoServerDelegate), - AuditExtensionEnabled: pointer.ToPointer(instanceSpec.AuditExtensionEnabled), - SyncHistoryExtensionEnabled: pointer.ToPointer(instanceSpec.SyncHistoryExtensionEnabled), + AuditExtensionEnabled: ptr.To(instanceSpec.AuditExtensionEnabled), + SyncHistoryExtensionEnabled: ptr.To(instanceSpec.SyncHistoryExtensionEnabled), CrossplaneExtension: CrossplaneToAkuityAPICrossplaneExtension(instanceSpec.CrossplaneExtension), ImageUpdaterDelegate: CrossplaneToAkuityAPIImageUpdaterDelegate(instanceSpec.ImageUpdaterDelegate), AppSetDelegate: CrossplaneToAkuityAPIAppSetDelegate(instanceSpec.AppSetDelegate), - AssistantExtensionEnabled: pointer.ToPointer(instanceSpec.AssistantExtensionEnabled), + AssistantExtensionEnabled: ptr.To(instanceSpec.AssistantExtensionEnabled), AppsetPolicy: CrossplaneToAkuityAPIAppsetPolicy(instanceSpec.AppsetPolicy), HostAliases: CrossplaneToAkuityAPIHostAliases(instanceSpec.HostAliases), AgentPermissionsRules: CrossplaneToAkuityAPIAgentPermissionsRules(instanceSpec.AgentPermissionsRules), - Fqdn: pointer.ToPointer(instanceSpec.Fqdn), + Fqdn: ptr.To(instanceSpec.Fqdn), }, nil } @@ -604,10 +604,10 @@ func CrossplaneToAkuityAPIClusterCustomization(clusterCustomization *crossplanet } return &akuitytypes.ClusterCustomization{ - AutoUpgradeDisabled: pointer.ToPointer(clusterCustomization.AutoUpgradeDisabled), + AutoUpgradeDisabled: ptr.To(clusterCustomization.AutoUpgradeDisabled), Kustomization: kustomization, - AppReplication: pointer.ToPointer(clusterCustomization.AppReplication), - RedisTunneling: pointer.ToPointer(clusterCustomization.RedisTunneling), + AppReplication: ptr.To(clusterCustomization.AppReplication), + RedisTunneling: ptr.To(clusterCustomization.RedisTunneling), }, nil } @@ -617,7 +617,7 @@ func CrossplaneToAkuityAPIRepoServerDelegate(repoServerDelegate *crossplanetypes } return &akuitytypes.RepoServerDelegate{ - ControlPlane: pointer.ToPointer(repoServerDelegate.ControlPlane), + ControlPlane: ptr.To(repoServerDelegate.ControlPlane), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: repoServerDelegate.ManagedCluster.ClusterName, }, @@ -645,7 +645,7 @@ func CrossplaneToAkuityAPIImageUpdaterDelegate(imageUpdaterDelegate *crossplanet } return &akuitytypes.ImageUpdaterDelegate{ - ControlPlane: pointer.ToPointer(imageUpdaterDelegate.ControlPlane), + ControlPlane: ptr.To(imageUpdaterDelegate.ControlPlane), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: imageUpdaterDelegate.ManagedCluster.ClusterName, }, @@ -671,7 +671,7 @@ func CrossplaneToAkuityAPIAppsetPolicy(appsetPolicy *crossplanetypes.AppsetPolic return &akuitytypes.AppsetPolicy{ Policy: appsetPolicy.Policy, - OverridePolicy: pointer.ToPointer(appsetPolicy.OverridePolicy), + OverridePolicy: ptr.To(appsetPolicy.OverridePolicy), } } diff --git a/internal/types/test/fixtures/instance.go b/internal/types/test/fixtures/instance.go index 6ea9ef0..6e43ac9 100644 --- a/internal/types/test/fixtures/instance.go +++ b/internal/types/test/fixtures/instance.go @@ -2,7 +2,7 @@ package fixtures import ( argocdv1 "github.com/akuity/api-client-go/pkg/api/gen/argocd/v1" - "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" + "k8s.io/utils/ptr" "github.com/akuityio/provider-crossplane-akuity/apis/core/v1alpha1" akuitytypes "github.com/akuityio/provider-crossplane-akuity/internal/types/generated/akuity/v1alpha1" @@ -48,7 +48,7 @@ var ( AkuityAppsetPolicy = &akuitytypes.AppsetPolicy{ Policy: "policy", - OverridePolicy: pointer.ToPointer(true), + OverridePolicy: ptr.To(true), } ArgocdAppsetPolicy = &argocdv1.AppsetPolicy{ @@ -80,7 +80,7 @@ var ( } AkuityImageUpdaterDelegate = &akuitytypes.ImageUpdaterDelegate{ - ControlPlane: pointer.ToPointer(true), + ControlPlane: ptr.To(true), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: "test-cluster", }, @@ -101,7 +101,7 @@ var ( } AkuityRepoServerDelegate = &akuitytypes.RepoServerDelegate{ - ControlPlane: pointer.ToPointer(true), + ControlPlane: ptr.To(true), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: "test-cluster", }, @@ -188,10 +188,10 @@ var ( } AkuityClusterCustomization = &akuitytypes.ClusterCustomization{ - AutoUpgradeDisabled: pointer.ToPointer(true), + AutoUpgradeDisabled: ptr.To(true), Kustomization: Kustomization, - AppReplication: pointer.ToPointer(true), - RedisTunneling: pointer.ToPointer(true), + AppReplication: ptr.To(true), + RedisTunneling: ptr.To(true), } ArgocdClusterCustomization = &argocdv1.ClusterCustomization{ @@ -211,20 +211,20 @@ var ( AkuityInstanceSpec = akuitytypes.InstanceSpec{ IpAllowList: AkuityIpAllowList, Subdomain: "example.com", - DeclarativeManagementEnabled: pointer.ToPointer(true), + DeclarativeManagementEnabled: ptr.To(true), Extensions: AkuityInstallEntryList, ClusterCustomizationDefaults: AkuityClusterCustomization, - ImageUpdaterEnabled: pointer.ToPointer(true), - BackendIpAllowListEnabled: pointer.ToPointer(true), + ImageUpdaterEnabled: ptr.To(true), + BackendIpAllowListEnabled: ptr.To(true), RepoServerDelegate: AkuityRepoServerDelegate, - AuditExtensionEnabled: pointer.ToPointer(true), - SyncHistoryExtensionEnabled: pointer.ToPointer(true), + AuditExtensionEnabled: ptr.To(true), + SyncHistoryExtensionEnabled: ptr.To(true), ImageUpdaterDelegate: AkuityImageUpdaterDelegate, AppSetDelegate: AkuityAppSetDelegate, - AssistantExtensionEnabled: pointer.ToPointer(true), + AssistantExtensionEnabled: ptr.To(true), AppsetPolicy: AkuityAppsetPolicy, HostAliases: AkuityHostAliasesList, - Fqdn: pointer.ToPointer(""), + Fqdn: ptr.To(""), } ArgocdInstanceSpec = &argocdv1.InstanceSpec{ diff --git a/internal/utils/pointer/value.go b/internal/utils/pointer/value.go deleted file mode 100644 index 4bd2bfc..0000000 --- a/internal/utils/pointer/value.go +++ /dev/null @@ -1,13 +0,0 @@ -package pointer - -func ToPointer[T any](value T) *T { - return &value -} - -func ToValue[T any](value *T) T { - var zero T - if value == nil { - return zero - } - return *value -} From 89b56542faaca20dede4c8c098f7da71509676f0 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 17:58:34 +0800 Subject: [PATCH 22/26] go mod tidy --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0c94f2d..c714e00 100644 --- a/go.mod +++ b/go.mod @@ -95,7 +95,7 @@ require ( k8s.io/component-base v0.29.1 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 // indirect - k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect + k8s.io/utils v0.0.0-20240102154912-e7106e64919e sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 From 9c4d236654ce7ee1e3c016f25ede167509f53ff8 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 18:07:56 +0800 Subject: [PATCH 23/26] remove unused attributes --- .../core.akuity.crossplane.io_clusters.yaml | 19 ------------------- .../core.akuity.crossplane.io_instances.yaml | 4 ---- 2 files changed, 23 deletions(-) diff --git a/package/crds/core.akuity.crossplane.io_clusters.yaml b/package/crds/core.akuity.crossplane.io_clusters.yaml index 9b6b79b..ed4c7e6 100644 --- a/package/crds/core.akuity.crossplane.io_clusters.yaml +++ b/package/crds/core.akuity.crossplane.io_clusters.yaml @@ -90,27 +90,10 @@ spec: type: boolean datadogAnnotationsEnabled: type: boolean - directClusterSpec: - properties: - caData: - type: string - clusterType: - type: string - kargoInstanceId: - type: string - organization: - type: string - server: - type: string - token: - type: string - type: object eksAddonEnabled: type: boolean kustomization: type: string - maintenanceMode: - type: boolean managedClusterConfig: properties: secretKey: @@ -118,8 +101,6 @@ spec: secretName: type: string type: object - multiClusterK8sDashboardEnabled: - type: boolean redisTunneling: type: boolean size: diff --git a/package/crds/core.akuity.crossplane.io_instances.yaml b/package/crds/core.akuity.crossplane.io_instances.yaml index 2589cf5..4b0bd96 100644 --- a/package/crds/core.akuity.crossplane.io_instances.yaml +++ b/package/crds/core.akuity.crossplane.io_instances.yaml @@ -186,8 +186,6 @@ spec: type: string type: object type: array - multiClusterK8sDashboardEnabled: - type: boolean repoServerDelegate: properties: controlPlane: @@ -650,8 +648,6 @@ spec: type: string type: object type: array - multiClusterK8sDashboardEnabled: - type: boolean repoServerDelegate: properties: controlPlane: From 66a349c0285ece4e2c9acf7ed1110139bfbab7ed Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 18:20:36 +0800 Subject: [PATCH 24/26] Revert "chore(deps): bump sigs.k8s.io/controller-runtime from 0.17.0 to 0.18.4 (#30)" This reverts commit ba729b9f3245a5036cbddf91440237e5774d032f. --- go.mod | 7 ++++--- go.sum | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 3e44da7..6153b62 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( k8s.io/apimachinery v0.30.2 k8s.io/client-go v0.30.2 k8s.io/kubectl v0.30.2 - sigs.k8s.io/controller-runtime v0.18.4 + sigs.k8s.io/controller-runtime v0.17.0 sigs.k8s.io/controller-tools v0.14.0 ) @@ -43,7 +43,7 @@ require ( github.com/dave/jennifer v1.7.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.11.2 // indirect - github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/evanphx/json-patch/v5 v5.8.1 // indirect github.com/fatih/color v1.16.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect @@ -93,7 +93,8 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/api v0.30.2 - k8s.io/apiextensions-apiserver v0.30.1 // indirect + k8s.io/apiextensions-apiserver v0.29.1 // indirect + k8s.io/component-base v0.30.2 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect k8s.io/utils v0.0.0-20240102154912-e7106e64919e diff --git a/go.sum b/go.sum index 8e8d45a..11d2edf 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+ github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= -github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/evanphx/json-patch/v5 v5.8.1 h1:iPEdwg0XayoS+E7Mth9JxwUtOgyVxnDTXHtKhZPlZxA= +github.com/evanphx/json-patch/v5 v5.8.1/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -117,10 +117,10 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= -github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= +github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= +github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -277,12 +277,14 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= -k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= -k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4= +k8s.io/apiextensions-apiserver v0.29.1 h1:S9xOtyk9M3Sk1tIpQMu9wXHm5O2MX6Y1kIpPMimZBZw= +k8s.io/apiextensions-apiserver v0.29.1/go.mod h1:zZECpujY5yTW58co8V2EQR4BD6A9pktVgHhvc0uLfeU= k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= +k8s.io/component-base v0.30.2 h1:pqGBczYoW1sno8q9ObExUqrYSKhtE5rW3y6gX88GZII= +k8s.io/component-base v0.30.2/go.mod h1:yQLkQDrkK8J6NtP+MGJOws+/PPeEXNpwFixsUI7h/OE= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= @@ -291,8 +293,8 @@ k8s.io/kubectl v0.30.2 h1:cgKNIvsOiufgcs4yjvgkK0+aPCfa8pUwzXdJtkbhsH8= k8s.io/kubectl v0.30.2/go.mod h1:rz7GHXaxwnigrqob0lJsiA07Df8RE3n1TSaC2CTeuB4= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= -sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= +sigs.k8s.io/controller-runtime v0.17.0 h1:fjJQf8Ukya+VjogLO6/bNX9HE6Y2xpsO5+fyS26ur/s= +sigs.k8s.io/controller-runtime v0.17.0/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= sigs.k8s.io/controller-tools v0.14.0 h1:rnNoCC5wSXlrNoBKKzL70LNJKIQKEzT6lloG6/LF73A= sigs.k8s.io/controller-tools v0.14.0/go.mod h1:TV7uOtNNnnR72SpzhStvPkoS/U5ir0nMudrkrC4M9Sc= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= From b9bdc50cbbb79cd40f91bccd471644b0a5acb443 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 18:21:38 +0800 Subject: [PATCH 25/26] Revert "chore(deps): bump k8s.io/kubectl from 0.29.1 to 0.30.2 (#32)" This reverts commit fc514785fea79082b3ac34eb1fdd80104e941fa4. --- go.mod | 22 ++++++++++------------ go.sum | 44 ++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/go.mod b/go.mod index 6153b62..2b7b6b9 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/akuityio/provider-crossplane-akuity -go 1.22.0 - -toolchain go1.22.5 +go 1.21 require ( github.com/akuity/api-client-go v0.15.0 @@ -16,9 +14,9 @@ require ( go.uber.org/mock v0.4.0 google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe gopkg.in/alecthomas/kingpin.v2 v2.2.6 - k8s.io/apimachinery v0.30.2 - k8s.io/client-go v0.30.2 - k8s.io/kubectl v0.30.2 + k8s.io/apimachinery v0.29.1 + k8s.io/client-go v0.29.1 + k8s.io/kubectl v0.29.1 sigs.k8s.io/controller-runtime v0.17.0 sigs.k8s.io/controller-tools v0.14.0 ) @@ -54,7 +52,7 @@ require ( github.com/gobuffalo/flect v1.0.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect @@ -76,14 +74,14 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/mod v0.15.0 // indirect + golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.17.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect @@ -92,11 +90,11 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.30.2 + k8s.io/api v0.29.1 k8s.io/apiextensions-apiserver v0.29.1 // indirect - k8s.io/component-base v0.30.2 // indirect + k8s.io/component-base v0.29.1 // indirect k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect + k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 // indirect k8s.io/utils v0.0.0-20240102154912-e7106e64919e sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/go.sum b/go.sum index 11d2edf..3f111ea 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/cel-go v0.18.1 h1:V/lAXKq4C3BYLDy/ARzMtpkEEYfHQpZzVyzy69nEUjs= github.com/google/cel-go v0.18.1/go.mod h1:PVAybmSnWkNMUZR/tEWFUiJ1Np4Hz0MHsZJcgC4zln4= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= @@ -117,10 +117,10 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= -github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= -github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= +github.com/onsi/ginkgo/v2 v2.14.0 h1:vSmGj2Z5YPb9JwCWT6z6ihcUvDhuXLc3sJiqd3jMKAY= +github.com/onsi/ginkgo/v2 v2.14.0/go.mod h1:JkUdW7JkN0V6rFvsHcJ478egV3XH9NxpD27Hal/PhZw= +github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -176,8 +176,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -237,8 +237,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -275,22 +275,22 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= -k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= +k8s.io/api v0.29.1 h1:DAjwWX/9YT7NQD4INu49ROJuZAAAP/Ijki48GUPzxqw= +k8s.io/api v0.29.1/go.mod h1:7Kl10vBRUXhnQQI8YR/R327zXC8eJ7887/+Ybta+RoQ= k8s.io/apiextensions-apiserver v0.29.1 h1:S9xOtyk9M3Sk1tIpQMu9wXHm5O2MX6Y1kIpPMimZBZw= k8s.io/apiextensions-apiserver v0.29.1/go.mod h1:zZECpujY5yTW58co8V2EQR4BD6A9pktVgHhvc0uLfeU= -k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= -k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= -k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= -k8s.io/component-base v0.30.2 h1:pqGBczYoW1sno8q9ObExUqrYSKhtE5rW3y6gX88GZII= -k8s.io/component-base v0.30.2/go.mod h1:yQLkQDrkK8J6NtP+MGJOws+/PPeEXNpwFixsUI7h/OE= +k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc= +k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= +k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A= +k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks= +k8s.io/component-base v0.29.1 h1:MUimqJPCRnnHsskTTjKD+IC1EHBbRCVyi37IoFBrkYw= +k8s.io/component-base v0.29.1/go.mod h1:fP9GFjxYrLERq1GcWWZAE3bqbNcDKDytn2srWuHTtKc= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/kubectl v0.30.2 h1:cgKNIvsOiufgcs4yjvgkK0+aPCfa8pUwzXdJtkbhsH8= -k8s.io/kubectl v0.30.2/go.mod h1:rz7GHXaxwnigrqob0lJsiA07Df8RE3n1TSaC2CTeuB4= +k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 h1:m6dl1pkxz3HuE2mP9MUYPCCGyy6IIFlv/vTlLBDxIwA= +k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15/go.mod h1:Pa1PvrP7ACSkuX6I7KYomY6cmMA0Tx86waBhDUgoKPw= +k8s.io/kubectl v0.29.1 h1:rWnW3hi/rEUvvg7jp4iYB68qW5un/urKbv7fu3Vj0/s= +k8s.io/kubectl v0.29.1/go.mod h1:SZzvLqtuOJYSvZzPZR9weSuP0wDQ+N37CENJf0FhDF4= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/controller-runtime v0.17.0 h1:fjJQf8Ukya+VjogLO6/bNX9HE6Y2xpsO5+fyS26ur/s= From 4475ae32dfaba04fad9e72b2c88a5226386d1fc4 Mon Sep 17 00:00:00 2001 From: Yiwei Gong Date: Thu, 11 Jul 2024 18:23:58 +0800 Subject: [PATCH 26/26] remove unused attributes --- .../v1alpha1/argocdinstance_types.go | 5 --- .../v1alpha1/configmanagementplugin_types.go | 5 --- .../v1alpha1/zz_generated.deepcopy.go | 44 ------------------- 3 files changed, 54 deletions(-) diff --git a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go index 1a61ebb..6eb74c4 100644 --- a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go @@ -10,11 +10,6 @@ type ArgoCD struct { Spec ArgoCDSpec `json:"spec,omitempty"` } -// +kubebuilder:object:generate=true -type ArgoCDList struct { - Items []ArgoCD `json:"items"` -} - // +kubebuilder:object:generate=true type ArgoCDSpec struct { Description string `json:"description,omitempty"` diff --git a/internal/types/generated/crossplane/v1alpha1/configmanagementplugin_types.go b/internal/types/generated/crossplane/v1alpha1/configmanagementplugin_types.go index 62ab046..7cd67b9 100644 --- a/internal/types/generated/crossplane/v1alpha1/configmanagementplugin_types.go +++ b/internal/types/generated/crossplane/v1alpha1/configmanagementplugin_types.go @@ -12,11 +12,6 @@ type ConfigManagementPlugin struct { Spec PluginSpec `json:"spec,omitempty"` } -// +kubebuilder:object:generate=true -type ConfigManagementPluginList struct { - Items []ConfigManagementPlugin `json:"items"` -} - // +kubebuilder:object:generate=true type PluginSpec struct { Version string `json:"version,omitempty"` diff --git a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go index d2deadd..c3655d1 100644 --- a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go @@ -102,28 +102,6 @@ func (in *ArgoCDExtensionInstallEntry) DeepCopy() *ArgoCDExtensionInstallEntry { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ArgoCDList) DeepCopyInto(out *ArgoCDList) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ArgoCD, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoCDList. -func (in *ArgoCDList) DeepCopy() *ArgoCDList { - if in == nil { - return nil - } - out := new(ArgoCDList) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArgoCDSpec) DeepCopyInto(out *ArgoCDSpec) { *out = *in @@ -258,28 +236,6 @@ func (in *ConfigManagementPlugin) DeepCopy() *ConfigManagementPlugin { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigManagementPluginList) DeepCopyInto(out *ConfigManagementPluginList) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ConfigManagementPlugin, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigManagementPluginList. -func (in *ConfigManagementPluginList) DeepCopy() *ConfigManagementPluginList { - if in == nil { - return nil - } - out := new(ConfigManagementPluginList) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CrossplaneExtension) DeepCopyInto(out *CrossplaneExtension) { *out = *in