From 28b720f60c21e1f803182e05f31010a9418360dd Mon Sep 17 00:00:00 2001 From: Gianluca Mardente Date: Mon, 24 Feb 2025 09:58:29 +0100 Subject: [PATCH] Remove CRD version v1alpha1 --- Makefile | 20 +- api/v1alpha1/clusterconfiguration_types.go | 190 - api/v1alpha1/clusterprofile_conversion.go | 54 - api/v1alpha1/clusterprofile_types.go | 55 - api/v1alpha1/clusterreport_types.go | 136 - api/v1alpha1/clustersummary_conversion.go | 54 - api/v1alpha1/clustersummary_types.go | 307 - api/v1alpha1/conversion_test.go | 219 - api/v1alpha1/conversion_utils.go | 101 - api/v1alpha1/doc.go | 20 - api/v1alpha1/fuzz_test.go | 92 - api/v1alpha1/groupversion_info.go | 38 - api/v1alpha1/index/cluster.go | 82 - api/v1alpha1/index/index.go | 36 - api/v1alpha1/profile_conversion.go | 54 - api/v1alpha1/profile_types.go | 55 - api/v1alpha1/spec.go | 630 -- api/v1alpha1/status.go | 40 - api/v1alpha1/v1alpha1_suite_test.go | 29 - api/v1alpha1/zz_generated.conversion.go | 1613 ---- api/v1alpha1/zz_generated.deepcopy.go | 1016 --- ...ojectsveltos.io_clusterconfigurations.yaml | 375 - ...fig.projectsveltos.io_clusterprofiles.yaml | 937 --- ...nfig.projectsveltos.io_clusterreports.yaml | 312 - ...ig.projectsveltos.io_clustersummaries.yaml | 927 --- .../config.projectsveltos.io_profiles.yaml | 937 --- config/crd/kustomization.yaml | 12 +- .../cainjection_in_clusterconfigurations.yaml | 12 +- .../cainjection_in_clusterprofiles.yaml | 12 +- .../cainjection_in_clusterreports.yaml | 12 +- .../cainjection_in_clustersummaries.yaml | 12 +- .../crd/patches/cainjection_in_profiles.yaml | 12 +- .../webhook_in_clusterconfigurations.yaml | 30 +- .../patches/webhook_in_clusterprofiles.yaml | 30 +- .../patches/webhook_in_clusterreports.yaml | 30 +- .../patches/webhook_in_clustersummaries.yaml | 30 +- config/crd/patches/webhook_in_profiles.yaml | 30 +- go.mod | 4 +- go.sum | 4 +- manifest/manifest.yaml | 7171 +++++------------ test/fv/conversion_test.go | 207 - test/fv/fv_suite_test.go | 2 - 42 files changed, 1941 insertions(+), 13998 deletions(-) delete mode 100644 api/v1alpha1/clusterconfiguration_types.go delete mode 100644 api/v1alpha1/clusterprofile_conversion.go delete mode 100644 api/v1alpha1/clusterprofile_types.go delete mode 100644 api/v1alpha1/clusterreport_types.go delete mode 100644 api/v1alpha1/clustersummary_conversion.go delete mode 100644 api/v1alpha1/clustersummary_types.go delete mode 100644 api/v1alpha1/conversion_test.go delete mode 100644 api/v1alpha1/conversion_utils.go delete mode 100644 api/v1alpha1/doc.go delete mode 100644 api/v1alpha1/fuzz_test.go delete mode 100644 api/v1alpha1/groupversion_info.go delete mode 100644 api/v1alpha1/index/cluster.go delete mode 100644 api/v1alpha1/index/index.go delete mode 100644 api/v1alpha1/profile_conversion.go delete mode 100644 api/v1alpha1/profile_types.go delete mode 100644 api/v1alpha1/spec.go delete mode 100644 api/v1alpha1/status.go delete mode 100644 api/v1alpha1/v1alpha1_suite_test.go delete mode 100644 api/v1alpha1/zz_generated.conversion.go delete mode 100644 api/v1alpha1/zz_generated.deepcopy.go delete mode 100644 test/fv/conversion_test.go diff --git a/Makefile b/Makefile index 4ae1c1c4..8c262715 100644 --- a/Makefile +++ b/Makefile @@ -162,18 +162,6 @@ generate: $(CONTROLLER_GEN) ## Generate code containing DeepCopy, DeepCopyInto, go generate $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." -.PHONY: generate-go-conversions -generate-go-conversions: $(CONVERSION_GEN) ## Generate conversions go code for config.projectsveltos.io api - $(MAKE) clean-generated-conversions SRC_DIRS="./api/v1alpha1" - $(CONVERSION_GEN) \ - --output-file=zz_generated.conversion.go \ - --go-header-file=./hack/boilerplate.generatego.txt \ - ./api/v1alpha1 - -.PHONY: clean-generated-conversions -clean-generated-conversions: ## Remove files generated by conversion-gen from the mentioned dirs. Example SRC_DIRS="./api/v1alpha4" - (IFS=','; for i in $(SRC_DIRS); do find $$i -type f -name 'zz_generated.conversion*' -exec rm -f {} \;; done) - .PHONY: fmt fmt: $(GOIMPORTS) ## Run go fmt against code. $(GOIMPORTS) -local github.com/projectsveltos -w . @@ -194,8 +182,7 @@ govulncheck: $(GOVULNCHECK) .PHONY: check-manifests check-manifests: manifests ## Verify manifests file is up to date test `git status --porcelain $(GENERATED_FILES) | grep -cE '(^\?)|(^ M)'` -eq 0 || (echo "The manifest file changed, please 'make manifests' and commit the results"; exit 1) - test `git status --porcelain ./api/v1alpha1/zz_generated.conversion.go | grep -cE '(^\?)|(^ M)'` -eq 0 || (echo "The conversion generated file changed, please 'make generate-go-conversions' and commit the results"; exit 1) - + ifeq ($(shell go env GOOS),darwin) # Use the darwin/amd64 binary until an arm64 version is available KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path --arch amd64 $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION)) else @@ -367,11 +354,6 @@ deploy-projectsveltos: $(KUSTOMIZE) @echo "Waiting for projectsveltos addon-controller to be available..." $(KUBECTL) wait --for=condition=Available deployment/addon-controller -n projectsveltos --timeout=$(TIMEOUT) - @echo "Install sveltos conversion webhook (dev is used for conversion-webhook)" - $(KUBECTL) apply -f https://raw.githubusercontent.com/projectsveltos/conversion-webhook/dev/manifest/manifest.yaml - - @echo "Waiting for projectsveltos conversion webhook to be available..." - $(KUBECTL) wait --for=condition=Available deployment/conversion-webhook -n projectsveltos --timeout=$(TIMEOUT) prepare-configmap-with-kustomize: $(KUBECTL) mkdir tmp; cd tmp; git clone git@github.com:gianlucam76/kustomize.git; \ diff --git a/api/v1alpha1/clusterconfiguration_types.go b/api/v1alpha1/clusterconfiguration_types.go deleted file mode 100644 index 2f757a70..00000000 --- a/api/v1alpha1/clusterconfiguration_types.go +++ /dev/null @@ -1,190 +0,0 @@ -/* -Copyright 2022-23. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "fmt" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - ClusterConfigurationKind = "ClusterConfiguration" -) - -type Resource struct { - // Name of the resource deployed in the Cluster. - // +kubebuilder:validation:MinLength=1 - Name string `json:"name"` - - // Namespace of the resource deployed in the Cluster. - // Empty for resources scoped at cluster level. - // +optional - Namespace string `json:"namespace,omitempty"` - - // Group of the resource deployed in the Cluster. - Group string `json:"group"` - - // Kind of the resource deployed in the Cluster. - // +kubebuilder:validation:MinLength=1 - Kind string `json:"kind"` - - // Version of the resource deployed in the Cluster. - // +kubebuilder:validation:MinLength=1 - Version string `json:"version"` - - // LastAppliedTime identifies when this resource was last applied to the cluster. - // +optional - LastAppliedTime *metav1.Time `json:"lastAppliedTime,omitempty"` - - // Owner is the list of ConfigMap/Secret containing this resource. - Owner corev1.ObjectReference `json:"owner"` - - // IgnoreForConfigurationDrift indicates to not track resource - // for configuration drift detection. - // This field has a meaning only when mode is ContinuousWithDriftDetection - // +kubebuilder:default:=false - // +optional - IgnoreForConfigurationDrift bool `json:"ignoreForConfigurationDrift,omitempty"` -} - -type Chart struct { - // RepoURL URL of the repo containing the helm chart deployed - // in the Cluster. - // +kubebuilder:validation:MinLength=1 - RepoURL string `json:"repoURL"` - - // ReleaseName name of the release deployed in the Cluster. - // +kubebuilder:validation:MinLength=1 - ReleaseName string `json:"releaseName"` - - // Namespace where chart is deployed in the Cluster. - // +optional - Namespace string `json:"namespace,omitempty"` - - // ChartVersion is the version of the helm chart deployed in the Cluster. - ChartVersion string `json:"chartVersion"` - - // AppVersion is the version of the app deployed in the Cluster. - // +optional - AppVersion string `json:"appVersion,omitempty"` - - // The URL to an icon file. - Icon string `json:"icon,omitempty"` - - // LastAppliedTime identifies when this resource was last applied to the cluster. - LastAppliedTime *metav1.Time `json:"lastAppliedTime"` -} - -type Feature struct { - // FeatureID is an indentifier of the feature whose status is reported - FeatureID FeatureID `json:"featureID"` - - // Resources is a list of resources deployed in the Cluster. - // +optional - Resources []Resource `json:"resources,omitempty"` - - // Charts is a list of helm charts deployed in the Cluster. - // +optional - Charts []Chart `json:"charts,omitempty"` -} - -// ProfileResource keeps info on all of the resources deployed in this Cluster -// due to a given Profile -type ProfileResource struct { - // ProfileName is the name of the Profile matching the Cluster. - ProfileName string `json:"profileName"` - - // Features contains the list of policies deployed in the Cluster because - // of a given feature - // +optional - Features []Feature `json:"Features,omitempty"` -} - -// ClusterProfileResource keeps info on all of the resources deployed in this Cluster -// due to a given ClusterProfile -type ClusterProfileResource struct { - // ProfileName is the name of the ClusterProfile matching the Cluster. - ClusterProfileName string `json:"clusterProfileName"` - - // Features contains the list of policies deployed in the Cluster because - // of a given feature - // +optional - Features []Feature `json:"Features,omitempty"` -} - -// ClusterConfigurationStatus defines the observed state of ClusterConfiguration -type ClusterConfigurationStatus struct { - // ClusterProfileResources is the list of resources currently deployed in a Cluster due - // to ClusterProfiles - // +optional - ClusterProfileResources []ClusterProfileResource `json:"clusterProfileResources,omitempty"` - - // ProfileResources is the list of resources currently deployed in a Cluster due - // to Profiles - // +optional - ProfileResources []ProfileResource `json:"profileResources,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:resource:path=clusterconfigurations,scope=Namespaced -//+kubebuilder:subresource:status - -// ClusterConfiguration is the Schema for the clusterconfigurations API -type ClusterConfiguration struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Status ClusterConfigurationStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// ClusterConfigurationList contains a list of ClusterConfiguration -type ClusterConfigurationList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterConfiguration `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ClusterConfiguration{}, &ClusterConfigurationList{}) -} - -// GetClusterConfigurationSectionIndex returns Status.ClusterProfileResources index for given ClusterProfile. -// If not found, returns an error -func GetClusterConfigurationSectionIndex(clusterConfiguration *ClusterConfiguration, - profileKind, profileName string) (int, error) { - - if profileKind == ClusterProfileKind { - for i := range clusterConfiguration.Status.ClusterProfileResources { - if clusterConfiguration.Status.ClusterProfileResources[i].ClusterProfileName == profileName { - return i, nil - } - } - } else { - for i := range clusterConfiguration.Status.ProfileResources { - if clusterConfiguration.Status.ProfileResources[i].ProfileName == profileName { - return i, nil - } - } - } - - return -1, fmt.Errorf("section for %s/%s not present in clusterConfiguration %s/%s", - profileKind, profileName, clusterConfiguration.Namespace, clusterConfiguration.Name) -} diff --git a/api/v1alpha1/clusterprofile_conversion.go b/api/v1alpha1/clusterprofile_conversion.go deleted file mode 100644 index 70de1eb3..00000000 --- a/api/v1alpha1/clusterprofile_conversion.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2024. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - configv1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" -) - -// ConvertTo converts v1alpha1 to the Hub version (v1beta1). -func (src *ClusterProfile) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*configv1beta1.ClusterProfile) - err := Convert_v1alpha1_ClusterProfile_To_v1beta1_ClusterProfile(src, dst, nil) - if err != nil { - return err - } - - if src.Spec.ClusterSelector == "" { - dst.Spec.ClusterSelector.LabelSelector = metav1.LabelSelector{} - } - - return nil -} - -// ConvertFrom converts from the Hub version (v1beta1) to this v1alpha1. -func (dst *ClusterProfile) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*configv1beta1.ClusterProfile) - err := Convert_v1beta1_ClusterProfile_To_v1alpha1_ClusterProfile(src, dst, nil) - if err != nil { - return err - } - - if src.Spec.ClusterSelector.MatchLabels == nil { - dst.Spec.ClusterSelector = "" - } - - return nil -} diff --git a/api/v1alpha1/clusterprofile_types.go b/api/v1alpha1/clusterprofile_types.go deleted file mode 100644 index 83e7dc6e..00000000 --- a/api/v1alpha1/clusterprofile_types.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2022. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // ClusterProfileFinalizer allows ClusterProfileReconciler to clean up resources associated with - // ClusterProfile before removing it from the apiserver. - ClusterProfileFinalizer = "clusterprofilefinalizer.projectsveltos.io" - - ClusterProfileKind = "ClusterProfile" -) - -//+kubebuilder:object:root=true -//+kubebuilder:resource:path=clusterprofiles,scope=Cluster -//+kubebuilder:subresource:status - -// ClusterProfile is the Schema for the clusterprofiles API -type ClusterProfile struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec Spec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// ClusterProfileList contains a list of ClusterProfile -type ClusterProfileList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterProfile `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ClusterProfile{}, &ClusterProfileList{}) -} diff --git a/api/v1alpha1/clusterreport_types.go b/api/v1alpha1/clusterreport_types.go deleted file mode 100644 index a894213a..00000000 --- a/api/v1alpha1/clusterreport_types.go +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright 2022. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// HelmAction represents the type of action on a give resource or helm release -type HelmAction string - -// Define the HelmAction constants. -const ( - NoHelmAction HelmAction = "No Action" - InstallHelmAction HelmAction = "Install" - UpgradeHelmAction HelmAction = "Upgrade" - UninstallHelmAction HelmAction = "Delete" - ConflictHelmAction HelmAction = "Conflict" -) - -type ResourceAction string - -// Define the Action constants. -const ( - NoResourceAction ResourceAction = "No Action" - CreateResourceAction ResourceAction = "Create" - UpdateResourceAction ResourceAction = "Update" - DeleteResourceAction ResourceAction = "Delete" - ConflictResourceAction ResourceAction = "Conflict" -) - -type ReleaseReport struct { - // ReleaseName of the release deployed in the CAPI Cluster. - // +kubebuilder:validation:MinLength=1 - ReleaseName string `json:"chartName"` - - // Namespace where release is deployed in the CAPI Cluster. - // +kubebuilder:validation:MinLength=1 - ReleaseNamespace string `json:"releaseNamespace"` - - // ChartVersion is the version of the helm chart deployed - // in the CAPI Cluster. - ChartVersion string `json:"chartVersion"` - - // Action represent the type of operation on the Helm Chart - // +kubebuilder:validation:Enum=No Action;Install;Upgrade;Delete;Conflict - // +optional - Action string `json:"action,omitempty"` - - // Message is for any message that needs to added to better - // explain the action. - // +optional - Message string `json:"message,omitempty"` -} - -type ResourceReport struct { - // Resource contains information about Kubernetes Resource - Resource Resource `json:"resource"` - - // Action represent the type of operation on the Kubernetes resource. - // +kubebuilder:validation:Enum=No Action;Create;Update;Delete;Conflict - Action string `json:"action,omitempty"` - - // Message is for any message that needs to added to better - // explain the action. - // +optional - Message string `json:"message,omitempty"` -} - -// ClusterReportSpec defines the desired state of ClusterReport -type ClusterReportSpec struct { - // ClusterNamespace is the namespace of the CAPI Cluster this - // ClusterReport is for. - ClusterNamespace string `json:"clusterNamespace"` - - // ClusterName is the name of the CAPI Cluster this ClusterReport - // is for. - ClusterName string `json:"clusterName"` -} - -// ClusterReportStatus defines the observed state of ClusterReport -type ClusterReportStatus struct { - // ReleaseReports contains report on helm releases - // +optional - ReleaseReports []ReleaseReport `json:"releaseReports,omitempty"` - - // ResourceReports contains report on Kubernetes resources - // deployed because of PolicyRefs - // +optional - ResourceReports []ResourceReport `json:"resourceReports,omitempty"` - - // KustomizeResourceReports contains report on Kubernetes resources - // deployed because of KustomizationRefs - // +optional - KustomizeResourceReports []ResourceReport `json:"kustomizeResourceReports,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:resource:path=clusterreports,scope=Namespaced -//+kubebuilder:subresource:status - -// ClusterReport is the Schema for the clusterreports API -type ClusterReport struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterReportSpec `json:"spec,omitempty"` - Status ClusterReportStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// ClusterReportList contains a list of ClusterReport -type ClusterReportList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterReport `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ClusterReport{}, &ClusterReportList{}) -} diff --git a/api/v1alpha1/clustersummary_conversion.go b/api/v1alpha1/clustersummary_conversion.go deleted file mode 100644 index e96c126f..00000000 --- a/api/v1alpha1/clustersummary_conversion.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2024. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - configv1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" -) - -// ConvertTo converts v1alpha1 to the Hub version (v1beta1). -func (src *ClusterSummary) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*configv1beta1.ClusterSummary) - err := Convert_v1alpha1_ClusterSummary_To_v1beta1_ClusterSummary(src, dst, nil) - if err != nil { - return err - } - - if src.Spec.ClusterProfileSpec.ClusterSelector == "" { - dst.Spec.ClusterProfileSpec.ClusterSelector.LabelSelector = metav1.LabelSelector{} - } - - return nil -} - -// ConvertFrom converts from the Hub version (v1beta1) to this v1alpha1. -func (dst *ClusterSummary) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*configv1beta1.ClusterSummary) - err := Convert_v1beta1_ClusterSummary_To_v1alpha1_ClusterSummary(src, dst, nil) - if err != nil { - return err - } - - if src.Spec.ClusterProfileSpec.ClusterSelector.MatchLabels == nil { - dst.Spec.ClusterProfileSpec.ClusterSelector = "" - } - - return nil -} diff --git a/api/v1alpha1/clustersummary_types.go b/api/v1alpha1/clustersummary_types.go deleted file mode 100644 index 6fb690ba..00000000 --- a/api/v1alpha1/clustersummary_types.go +++ /dev/null @@ -1,307 +0,0 @@ -/* -Copyright 2022-23. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "context" - "fmt" - - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/client" - - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1beta1" -) - -const ( - // ClusterSummaryFinalizer allows ClusterSummaryReconciler to clean up resources associated with - // ClusterSummary before removing it from the apiserver. - ClusterSummaryFinalizer = "clustersummaryfinalizer.projectsveltos.io" - - ClusterSummaryKind = "ClusterSummary" -) - -// +kubebuilder:validation:Enum:=Resources;Helm;Kustomize -type FeatureID string - -const ( - // FeatureResources is the identifier for generic Resources feature - FeatureResources = FeatureID("Resources") - - // FeatureHelm is the identifier for Helm feature - FeatureHelm = FeatureID("Helm") - - // FeatureKustomize is the identifier for Kustomize feature - FeatureKustomize = FeatureID("Kustomize") -) - -// +kubebuilder:validation:Enum:=Provisioning;Provisioned;Failed;FailedNonRetriable;Removing;Removed -type FeatureStatus string - -const ( - // FeatureStatusProvisioning indicates that feature is being - // provisioned in the workload cluster - FeatureStatusProvisioning = FeatureStatus("Provisioning") - - // FeatureStatusProvisioned indicates that feature has being - // provisioned in the workload cluster - FeatureStatusProvisioned = FeatureStatus("Provisioned") - - // FeatureStatusFailed indicates that configuring the feature - // in the workload cluster failed - FeatureStatusFailed = FeatureStatus("Failed") - - // FeatureStatusFailedNonRetriable indicates that configuring the feature - // in the workload cluster failed with a non retriable error - FeatureStatusFailedNonRetriable = FeatureStatus("FailedNonRetriable") - - // FeatureStatusRemoving indicates that feature is being - // removed - FeatureStatusRemoving = FeatureStatus("Removing") - - // FeatureStatusRemoved indicates that feature is removed - FeatureStatusRemoved = FeatureStatus("Removed") -) - -// FeatureSummary contains a summary of the state of a workload -// cluster feature. -type FeatureSummary struct { - // FeatureID is an indentifier of the feature whose status is reported - FeatureID FeatureID `json:"featureID"` - - // Hash represents of a unique value for a feature at a fixed point in - // time - // +optional - Hash []byte `json:"hash,omitempty"` - - // Status represents the state of the feature in the workload cluster - // +optional - Status FeatureStatus `json:"status,omitempty"` - - // FailureReason indicates the type of error that occurred. - // +optional - FailureReason *string `json:"failureReason,omitempty"` - - // FailureMessage provides more information about the error. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // DeployedGroupVersionKind contains all GroupVersionKinds deployed in either - // the workload cluster or the management cluster because of this feature. - // Each element has format kind.version.group - // Deprecated: Replaced by FeatureDeploymentInfo field instead - // +optional - DeployedGroupVersionKind []string `json:"deployedGroupVersionKind,omitempty"` - - // LastAppliedTime is the time feature was last reconciled - // +optional - LastAppliedTime *metav1.Time `json:"lastAppliedTime,omitempty"` -} - -type FeatureDeploymentInfo struct { - // FeatureID is an indentifier of the feature whose status is reported - FeatureID FeatureID `json:"featureID"` - - // DeployedGroupVersionKind contains all GroupVersionKinds deployed in either - // the workload cluster or the management cluster because of this feature. - // Each element has format kind.version.group - // +optional - DeployedGroupVersionKind []string `json:"deployedGroupVersionKind,omitempty"` -} - -// HelChartStatus specifies whether ClusterSummary is successfully managing -// an helm chart or not -// +kubebuilder:validation:Enum:=Managing;Conflict -type HelmChartStatus string - -const ( - // HelChartStatusManaging indicates helm chart is successfully being managed - HelmChartStatusManaging = HelmChartStatus("Managing") - - // HelChartStatusConflict indicates there is a conflict with another - // ClusterSummary to manage the helm chart - HelmChartStatusConflict = HelmChartStatus("Conflict") -) - -type HelmChartSummary struct { - // ReleaseName is the chart release - // +kubebuilder:validation:MinLength=1 - ReleaseName string `json:"releaseName"` - - // ReleaseNamespace is the namespace release will be installed - // +kubebuilder:validation:MinLength=1 - ReleaseNamespace string `json:"releaseNamespace"` - - // Status indicates whether ClusterSummary can manage the helm - // chart or there is a conflict - Status HelmChartStatus `json:"status"` - - // ValuesHash represents of a unique value for the values section - // +optional - ValuesHash []byte `json:"valuesHash,omitempty"` - - // Status indicates whether ClusterSummary can manage the helm - // chart or there is a conflict - // +optional - ConflictMessage string `json:"conflictMessage,omitempty"` -} - -// ClusterSummarySpec defines the desired state of ClusterSummary -type ClusterSummarySpec struct { - // ClusterNamespace is the namespace of the workload Cluster this - // ClusterSummary is for. - ClusterNamespace string `json:"clusterNamespace"` - - // ClusterName is the name of the workload Cluster this ClusterSummary is for. - ClusterName string `json:"clusterName"` - - // ClusterType is the type of Cluster - ClusterType libsveltosv1alpha1.ClusterType `json:"clusterType"` - - // ClusterProfileSpec represent the configuration that will be applied to - // the workload cluster. - ClusterProfileSpec Spec `json:"clusterProfileSpec,omitempty"` -} - -// ClusterSummaryStatus defines the observed state of ClusterSummary -type ClusterSummaryStatus struct { - // Dependencies is a summary reporting the status of the dependencies - // for the associated ClusterProfile - Dependencies *string `json:"dependencies,omitempty"` - - // FeatureSummaries reports the status of each workload cluster feature - // directly managed by ClusterProfile. - // +listType=map - // +listMapKey=featureID - // +optional - FeatureSummaries []FeatureSummary `json:"featureSummaries,omitempty"` - - // DeployedGVKs reports the list of GVKs deployed by ClusterSummary - // in a managed cluster - // +listType=map - // +listMapKey=featureID - // +optional - DeployedGVKs []FeatureDeploymentInfo `json:"deployedGVKs,omitempty"` - - // HelmReleaseSummaries reports the status of each helm chart - // directly managed by ClusterProfile. - // +listType=atomic - // +optional - HelmReleaseSummaries []HelmChartSummary `json:"helmReleaseSummaries,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:resource:path=clustersummaries,scope=Namespaced -//+kubebuilder:subresource:status - -// ClusterSummary is the Schema for the clustersummaries API -type ClusterSummary struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterSummarySpec `json:"spec,omitempty"` - Status ClusterSummaryStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// ClusterSummaryList contains a list of ClusterSummary -type ClusterSummaryList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterSummary `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ClusterSummary{}, &ClusterSummaryList{}) -} - -func GetClusterSummary(ctx context.Context, c client.Client, namespace, name string, -) (*ClusterSummary, error) { - - clusterSummary := &ClusterSummary{} - err := c.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, clusterSummary) - if err != nil { - return nil, err - } - - return clusterSummary, nil -} - -// GetProfileOwnerReference returns the ClusterProfile/Profile owning a given ClusterSummary -func GetProfileOwnerReference(clusterSummary *ClusterSummary) (*metav1.OwnerReference, error) { - for _, ref := range clusterSummary.OwnerReferences { - if ref.Kind != ClusterProfileKind && - ref.Kind != ProfileKind { - - continue - } - gv, err := schema.ParseGroupVersion(ref.APIVersion) - if err != nil { - return nil, errors.WithStack(err) - } - if gv.Group == GroupVersion.Group { - return &ref, nil - } - } - - return nil, fmt.Errorf("(Cluster)Profile owner not found") -} - -// GetProfileOwnerAndTier returns the (Cluster)Profile owning this clusterSummary and its tier. -// Returns nil if (Cluster)Profile does not exist anymore. -func GetProfileOwnerAndTier(ctx context.Context, c client.Client, clusterSummary *ClusterSummary, -) (client.Object, int32, error) { - - for _, ref := range clusterSummary.OwnerReferences { - gv, err := schema.ParseGroupVersion(ref.APIVersion) - if err != nil { - return nil, 0, errors.WithStack(err) - } - if gv.Group != GroupVersion.Group { - continue - } - - if ref.Kind == ClusterProfileKind { - clusterProfile := &ClusterProfile{} - err := c.Get(ctx, types.NamespacedName{Name: ref.Name}, clusterProfile) - if err != nil { - if apierrors.IsNotFound(err) { - return nil, 0, nil - } - return nil, 0, err - } - return clusterProfile, clusterProfile.Spec.Tier, nil - } else if ref.Kind == ProfileKind { - profile := &Profile{} - err := c.Get(ctx, - types.NamespacedName{Namespace: clusterSummary.Namespace, Name: ref.Name}, - profile) - if err != nil { - if apierrors.IsNotFound(err) { - return nil, 0, nil - } - return nil, 0, err - } - return profile, profile.Spec.Tier, nil - } - } - return nil, 0, nil -} diff --git a/api/v1alpha1/conversion_test.go b/api/v1alpha1/conversion_test.go deleted file mode 100644 index 6893f348..00000000 --- a/api/v1alpha1/conversion_test.go +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright 2022. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1_test - -import ( - "fmt" - "reflect" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/cluster-api/util" - - configv1alpha1 "github.com/projectsveltos/addon-controller/api/v1alpha1" - configv1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" - libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" -) - -var _ = Describe("Conversion", func() { - Context("Convert from v1alpha1 to v1beta1 and back", func() { - It("ClusterProfile conversion", func() { - key := randomString() - value := randomString() - - const tier = 100 - clusterProfile := configv1alpha1.ClusterProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: randomString(), - }, - Spec: configv1alpha1.Spec{ - Tier: tier, - StopMatchingBehavior: configv1alpha1.LeavePolicies, - ValidateHealths: []configv1alpha1.ValidateHealth{ - { - Name: randomString(), - FeatureID: configv1alpha1.FeatureHelm, - }, - }, - ClusterSelector: libsveltosv1alpha1.Selector(fmt.Sprintf("%s=%s", key, value)), - HelmCharts: []configv1alpha1.HelmChart{ - { - RepositoryURL: randomString(), - RepositoryName: randomString(), - ChartName: randomString(), - ChartVersion: randomString(), - ReleaseName: randomString(), - ReleaseNamespace: randomString(), - Values: randomString(), - Options: &configv1alpha1.HelmOptions{ - Labels: map[string]string{ - randomString(): randomString(), - }, - }, - }, - }, - PolicyRefs: []configv1alpha1.PolicyRef{ - { - Kind: string(libsveltosv1beta1.ConfigMapReferencedResourceKind), - Namespace: randomString(), - Name: randomString(), - }, - }, - KustomizationRefs: []configv1alpha1.KustomizationRef{ - { - Namespace: randomString(), - Name: randomString(), - Kind: string(libsveltosv1alpha1.SecretReferencedResourceKind), - }, - }, - ClusterRefs: []corev1.ObjectReference{ - { - Kind: libsveltosv1alpha1.SveltosClusterKind, - Namespace: randomString(), - Name: randomString(), - }, - }, - }, - } - - dst := &configv1beta1.ClusterProfile{} - Expect(clusterProfile.ConvertTo(dst)).To(Succeed()) - - Expect(len(dst.Spec.ClusterSelector.LabelSelector.MatchLabels)).To(Equal(1)) - Expect(dst.Spec.ClusterSelector.LabelSelector.MatchLabels[key]).To(Equal(value)) - - final := &configv1alpha1.ClusterProfile{} - Expect(final.ConvertFrom(dst)).To(Succeed()) - - Expect(reflect.DeepEqual(final.ObjectMeta, clusterProfile.ObjectMeta)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Spec.PolicyRefs, clusterProfile.Spec.PolicyRefs)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Spec.KustomizationRefs, clusterProfile.Spec.KustomizationRefs)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Spec.ClusterRefs, clusterProfile.Spec.ClusterRefs)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Status, clusterProfile.Status)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Spec.ValidateHealths, clusterProfile.Spec.ValidateHealths)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Spec.StopMatchingBehavior, clusterProfile.Spec.StopMatchingBehavior)).To(BeTrue()) - Expect(final.Spec.Tier).To(Equal(clusterProfile.Spec.Tier)) - }) - - It("Profile conversion", func() { - key1 := randomString() - value1 := randomString() - key2 := randomString() - value2 := randomString() - - profile := configv1alpha1.Profile{ - ObjectMeta: metav1.ObjectMeta{ - Name: randomString(), - }, - Spec: configv1alpha1.Spec{ - ClusterSelector: libsveltosv1alpha1.Selector(fmt.Sprintf("%s=%s, %s=%s", key1, value1, key2, value2)), - HelmCharts: []configv1alpha1.HelmChart{ - { - RepositoryURL: randomString(), - RepositoryName: randomString(), - ChartName: randomString(), - ChartVersion: randomString(), - ReleaseName: randomString(), - ReleaseNamespace: randomString(), - Values: randomString(), - Options: &configv1alpha1.HelmOptions{ - Labels: map[string]string{ - randomString(): randomString(), - }, - }, - }, - { - RepositoryURL: randomString(), - RepositoryName: randomString(), - ChartName: randomString(), - ChartVersion: randomString(), - ReleaseName: randomString(), - ReleaseNamespace: randomString(), - Values: randomString(), - Options: &configv1alpha1.HelmOptions{ - Labels: map[string]string{ - randomString(): randomString(), - }, - }, - }, - }, - PolicyRefs: []configv1alpha1.PolicyRef{ - { - Kind: string(libsveltosv1beta1.ConfigMapReferencedResourceKind), - Namespace: randomString(), - Name: randomString(), - }, - { - Kind: string(libsveltosv1beta1.ConfigMapReferencedResourceKind), - Namespace: randomString(), - Name: randomString(), - }, - }, - KustomizationRefs: []configv1alpha1.KustomizationRef{ - { - Namespace: randomString(), - Name: randomString(), - Kind: string(libsveltosv1alpha1.SecretReferencedResourceKind), - }, - { - Namespace: randomString(), - Name: randomString(), - Kind: string(libsveltosv1alpha1.SecretReferencedResourceKind), - }, - }, - ClusterRefs: []corev1.ObjectReference{ - { - Kind: libsveltosv1alpha1.SveltosClusterKind, - Namespace: randomString(), - Name: randomString(), - }, - { - Kind: libsveltosv1alpha1.SveltosClusterKind, - Namespace: randomString(), - Name: randomString(), - }, - }, - }, - } - - dst := &configv1beta1.Profile{} - Expect(profile.ConvertTo(dst)).To(Succeed()) - - Expect(len(dst.Spec.ClusterSelector.LabelSelector.MatchLabels)).To(Equal(2)) - Expect(dst.Spec.ClusterSelector.LabelSelector.MatchLabels[key1]).To(Equal(value1)) - Expect(dst.Spec.ClusterSelector.LabelSelector.MatchLabels[key2]).To(Equal(value2)) - - final := &configv1alpha1.Profile{} - Expect(final.ConvertFrom(dst)).To(Succeed()) - - Expect(reflect.DeepEqual(final.ObjectMeta, profile.ObjectMeta)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Spec.PolicyRefs, profile.Spec.PolicyRefs)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Spec.KustomizationRefs, profile.Spec.KustomizationRefs)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Spec.ClusterRefs, profile.Spec.ClusterRefs)).To(BeTrue()) - Expect(reflect.DeepEqual(final.Status, profile.Status)).To(BeTrue()) - }) - }) -}) - -func randomString() string { - const length = 10 - return util.RandomString(length) -} diff --git a/api/v1alpha1/conversion_utils.go b/api/v1alpha1/conversion_utils.go deleted file mode 100644 index b0560dca..00000000 --- a/api/v1alpha1/conversion_utils.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright 2024. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "fmt" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - - configv1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" - libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" -) - -func Convert_v1alpha1_Spec_To_v1beta1_Spec(srcSpec *Spec, dstSpec *configv1beta1.Spec, scope conversion.Scope, -) error { - - if err := autoConvert_v1alpha1_Spec_To_v1beta1_Spec(srcSpec, dstSpec, nil); err != nil { - return err - } - - labelSelector, err := metav1.ParseToLabelSelector(string(srcSpec.ClusterSelector)) - if err != nil { - return fmt.Errorf("error converting labels.Selector to metav1.Selector: %w", err) - } - dstSpec.ClusterSelector = libsveltosv1beta1.Selector{LabelSelector: *labelSelector} - - return nil -} - -func Convert_v1beta1_Spec_To_v1alpha1_Spec(srcSpec *configv1beta1.Spec, dstSpec *Spec, scope conversion.Scope, -) error { - - if err := autoConvert_v1beta1_Spec_To_v1alpha1_Spec(srcSpec, dstSpec, nil); err != nil { - return err - } - - labelSelector, err := srcSpec.ClusterSelector.ToSelector() - if err != nil { - return fmt.Errorf("failed to convert : %w", err) - } - - dstSpec.ClusterSelector = libsveltosv1alpha1.Selector(labelSelector.String()) - - return nil -} - -func Convert_v1beta1_HelmChart_To_v1alpha1_HelmChart(src *configv1beta1.HelmChart, dst *HelmChart, s conversion.Scope, -) error { - - if err := autoConvert_v1beta1_HelmChart_To_v1alpha1_HelmChart(src, dst, nil); err != nil { - return err - } - - return nil -} - -func Convert_v1beta1_HelmInstallOptions_To_v1alpha1_HelmInstallOptions( - src *configv1beta1.HelmInstallOptions, dst *HelmInstallOptions, s conversion.Scope) error { - - if err := autoConvert_v1beta1_HelmInstallOptions_To_v1alpha1_HelmInstallOptions(src, dst, s); err != nil { - return err - } - - return nil -} - -func Convert_v1beta1_HelmUninstallOptions_To_v1alpha1_HelmUninstallOptions( - src *configv1beta1.HelmUninstallOptions, dst *HelmUninstallOptions, s conversion.Scope) error { - - if err := autoConvert_v1beta1_HelmUninstallOptions_To_v1alpha1_HelmUninstallOptions(src, dst, s); err != nil { - return err - } - - return nil -} - -func Convert_v1beta1_HelmUpgradeOptions_To_v1alpha1_HelmUpgradeOptions( - src *configv1beta1.HelmUpgradeOptions, dst *HelmUpgradeOptions, s conversion.Scope) error { - - if err := autoConvert_v1beta1_HelmUpgradeOptions_To_v1alpha1_HelmUpgradeOptions(src, dst, s); err != nil { - return err - } - - return nil -} diff --git a/api/v1alpha1/doc.go b/api/v1alpha1/doc.go deleted file mode 100644 index cdcb087f..00000000 --- a/api/v1alpha1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2024. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -// +k8s:conversion-gen=github.com/projectsveltos/addon-controller/api/v1beta1 -// +k8s:deepcopy-gen=package diff --git a/api/v1alpha1/fuzz_test.go b/api/v1alpha1/fuzz_test.go deleted file mode 100644 index 372afecc..00000000 --- a/api/v1alpha1/fuzz_test.go +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright 2024. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1_test - -import ( - "fmt" - "testing" - - fuzz "github.com/google/gofuzz" - "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" - - configv1alpha1 "github.com/projectsveltos/addon-controller/api/v1alpha1" - configv1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" - libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" -) - -func TestFuzzyConversion(t *testing.T) { - t.Run("for ClusterProfile", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &configv1beta1.ClusterProfile{}, - Spoke: &configv1alpha1.ClusterProfile{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) - - t.Run("for Profile", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &configv1beta1.Profile{}, - Spoke: &configv1alpha1.Profile{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) -} - -func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { - return []interface{}{ - profileClusterSelectorFuzzer, - clusterProfileClusterSelectorFuzzer, - v1beta1ProfileClusterSelectorFuzzer, - v1beta1ClusterProfileClusterSelectorFuzzer, - } -} - -func profileClusterSelectorFuzzer(in *configv1alpha1.Profile, _ fuzz.Continue) { - in.Spec.ClusterSelector = libsveltosv1alpha1.Selector( - fmt.Sprintf("%s=%s", - randomString(), randomString(), - )) -} - -func clusterProfileClusterSelectorFuzzer(in *configv1alpha1.ClusterProfile, _ fuzz.Continue) { - in.Spec.ClusterSelector = libsveltosv1alpha1.Selector( - fmt.Sprintf("%s=%s", - randomString(), randomString(), - )) -} - -func v1beta1ProfileClusterSelectorFuzzer(in *configv1beta1.Profile, _ fuzz.Continue) { - in.Spec.ClusterSelector = libsveltosv1beta1.Selector{ - LabelSelector: metav1.LabelSelector{ - MatchExpressions: nil, - MatchLabels: map[string]string{ - randomString(): randomString(), - }, - }, - } -} - -func v1beta1ClusterProfileClusterSelectorFuzzer(in *configv1beta1.ClusterProfile, _ fuzz.Continue) { - in.Spec.ClusterSelector = libsveltosv1beta1.Selector{ - LabelSelector: metav1.LabelSelector{ - MatchExpressions: nil, - MatchLabels: map[string]string{ - randomString(): randomString(), - }, - }, - } -} diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go deleted file mode 100644 index 60fdcc9c..00000000 --- a/api/v1alpha1/groupversion_info.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2022. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha1 contains API Schema definitions for the config v1alpha1 API group -// +kubebuilder:object:generate=true -// +groupName=config.projectsveltos.io -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "config.projectsveltos.io", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme - - localSchemeBuilder = SchemeBuilder.SchemeBuilder -) diff --git a/api/v1alpha1/index/cluster.go b/api/v1alpha1/index/cluster.go deleted file mode 100644 index 9fe0c25d..00000000 --- a/api/v1alpha1/index/cluster.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2022. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package index - -import ( - "context" - "fmt" - - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - configv1alpha1 "github.com/projectsveltos/addon-controller/api/v1alpha1" -) - -const ( - // ClusterNamespaceField is used by the ClusterSummary Controller to index ClusterSummary - // by CAPI Cluster namespace, and add a watch on CAPI Cluster. - ClusterNamespaceField = ".spec.clusterNamespace" - - // ClusterNameField is used by the ClusterSummary Controller to index ClusterSummary - // by CAPI Cluster name, and add a watch on CAPI Cluster. - ClusterNameField = ".spec.clusterName" -) - -// ByClusterNamespace adds the CAPI Cluster namespace index to the -// managers cache. -func ByClusterNamespace(ctx context.Context, mgr ctrl.Manager) error { - if err := mgr.GetCache().IndexField(ctx, &configv1alpha1.ClusterSummary{}, - ClusterNamespaceField, - clusterSummaryByClusterNamespace, - ); err != nil { - return errors.Wrap(err, "error setting index field") - } - - return nil -} - -// ByClusterNamespace adds the CAPI Cluster name index to the -// managers cache. -func ByClusterName(ctx context.Context, mgr ctrl.Manager) error { - if err := mgr.GetCache().IndexField(ctx, &configv1alpha1.ClusterSummary{}, - ClusterNameField, - clusterSummaryByClusterName, - ); err != nil { - return errors.Wrap(err, "error setting index field") - } - - return nil -} - -func clusterSummaryByClusterNamespace(o client.Object) []string { - clusterSummary, ok := o.(*configv1alpha1.ClusterSummary) - if !ok { - panic(fmt.Sprintf("Expected a ClusterSummary but got a %T", o)) - } - - return []string{clusterSummary.Spec.ClusterNamespace} -} - -func clusterSummaryByClusterName(o client.Object) []string { - clusterSummary, ok := o.(*configv1alpha1.ClusterSummary) - if !ok { - panic(fmt.Sprintf("Expected a ClusterSummary but got a %T", o)) - } - - return []string{clusterSummary.Spec.ClusterName} -} diff --git a/api/v1alpha1/index/index.go b/api/v1alpha1/index/index.go deleted file mode 100644 index 97288af3..00000000 --- a/api/v1alpha1/index/index.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package index - -import ( - "context" - - ctrl "sigs.k8s.io/controller-runtime" -) - -// AddDefaultIndexes registers the default list of indexes. -func AddDefaultIndexes(ctx context.Context, mgr ctrl.Manager) error { - if err := ByClusterNamespace(ctx, mgr); err != nil { - return err - } - - if err := ByClusterName(ctx, mgr); err != nil { - return err - } - - return nil -} diff --git a/api/v1alpha1/profile_conversion.go b/api/v1alpha1/profile_conversion.go deleted file mode 100644 index 504eeb72..00000000 --- a/api/v1alpha1/profile_conversion.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2024. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - configv1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" -) - -// ConvertTo converts v1alpha1 to the Hub version (v1beta1). -func (src *Profile) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*configv1beta1.Profile) - err := Convert_v1alpha1_Profile_To_v1beta1_Profile(src, dst, nil) - if err != nil { - return err - } - - if src.Spec.ClusterSelector == "" { - dst.Spec.ClusterSelector.LabelSelector = metav1.LabelSelector{} - } - - return nil -} - -// ConvertFrom converts from the Hub version (v1beta1) to this v1alpha1. -func (dst *Profile) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*configv1beta1.Profile) - err := Convert_v1beta1_Profile_To_v1alpha1_Profile(src, dst, nil) - if err != nil { - return err - } - - if src.Spec.ClusterSelector.MatchLabels == nil { - dst.Spec.ClusterSelector = "" - } - - return nil -} diff --git a/api/v1alpha1/profile_types.go b/api/v1alpha1/profile_types.go deleted file mode 100644 index 3ed40444..00000000 --- a/api/v1alpha1/profile_types.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2023. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // ProfileFinalizer allows ProfileReconciler to clean up resources associated with - // Profile before removing it from the apiserver. - ProfileFinalizer = "profilefinalizer.projectsveltos.io" - - ProfileKind = "Profile" -) - -//+kubebuilder:object:root=true -//+kubebuilder:resource:path=profiles,scope=Namespaced -//+kubebuilder:subresource:status - -// Profile is the Schema for the profiles API -type Profile struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec Spec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// ProfileList contains a list of Profile -type ProfileList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Profile `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Profile{}, &ProfileList{}) -} diff --git a/api/v1alpha1/spec.go b/api/v1alpha1/spec.go deleted file mode 100644 index d8bdc569..00000000 --- a/api/v1alpha1/spec.go +++ /dev/null @@ -1,630 +0,0 @@ -/* -Copyright 2023-24. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" -) - -const ( - // ClusterNameLabel is the label set on: - // - ClusterSummary instances created by a ClusterProfile instance for a given cluster; - // - ClusterConfiguration instances created by a ClusterProfile instance for a given cluster; - // - ClusterReport instances created by a ClusterProfile instance for a given cluster; - ClusterNameLabel = "projectsveltos.io/cluster-name" - - // ClusterTypeLabel is the label set on: - // - ClusterSummary instances created by a ClusterProfile instance for a given cluster; - // - ClusterConfiguration instances created by a ClusterProfile instance for a given cluster; - // - ClusterReport instances created by a ClusterProfile instance for a given cluster; - ClusterTypeLabel = "projectsveltos.io/cluster-type" -) - -type DryRunReconciliationError struct{} - -func (m *DryRunReconciliationError) Error() string { - return "mode is DryRun. Nothing is reconciled" -} - -type ValidateHealth struct { - // Name is the name of this check - Name string `json:"name"` - - // FeatureID is an indentifier of the feature (Helm/Kustomize/Resources) - // This field indicates when to run this check. - // For instance: - // - if set to Helm this check will be run after all helm - // charts specified in the ClusterProfile are deployed. - // - if set to Resources this check will be run after the content - // of all the ConfigMaps/Secrets referenced by ClusterProfile in the - // PolicyRef sections is deployed - FeatureID FeatureID `json:"featureID"` - - // Group of the resource to fetch in the managed Cluster. - Group string `json:"group"` - - // Version of the resource to fetch in the managed Cluster. - Version string `json:"version"` - - // Kind of the resource to fetch in the managed Cluster. - // +kubebuilder:validation:MinLength=1 - Kind string `json:"kind"` - - // LabelFilters allows to filter resources based on current labels. - // +optional - LabelFilters []libsveltosv1alpha1.LabelFilter `json:"labelFilters,omitempty"` - - // Namespace of the resource to fetch in the managed Cluster. - // Empty for resources scoped at cluster level. - // +optional - Namespace string `json:"namespace,omitempty"` - - // Script is a text containing a lua script. - // Must return struct with field "health" - // representing whether object is a match (true or false) - // +optional - Script string `json:"script,omitempty"` -} - -// SyncMode specifies how features are synced in a workload cluster. -// +kubebuilder:validation:Enum:=OneTime;Continuous;ContinuousWithDriftDetection;DryRun -type SyncMode string - -const ( - // SyncModeOneTime indicates feature sync should happen only once - SyncModeOneTime = SyncMode("OneTime") - - // SyncModeContinuous indicates feature sync should continuously happen - SyncModeContinuous = SyncMode("Continuous") - - // SyncModeContinuousWithDriftDetection indicates that feature synchronization - // should occur continuously. If configuration drift is detected in the managed - // cluster, it will be overridden. - SyncModeContinuousWithDriftDetection = SyncMode("ContinuousWithDriftDetection") - - // SyncModeDryRun indicates feature sync should continuously happen - // no feature will be updated in the CAPI Cluster though. - SyncModeDryRun = SyncMode("DryRun") -) - -// DeploymentType indicates whether resources need to be deployed -// into the management cluster (local) or the managed cluster (remote) -// +kubebuilder:validation:Enum:=Local;Remote -type DeploymentType string - -const ( - // DeploymentTypeLocal indicates resource deployment need to - // be in the management cluster - DeploymentTypeLocal = DeploymentType("Local") - - // DeploymentTypeRemote indicates resource deployment need to - // be in the managed cluster - DeploymentTypeRemote = DeploymentType("Remote") -) - -type ValueFrom struct { - // Namespace of the referenced resource. - // For ClusterProfile namespace can be left empty. In such a case, namespace will - // be implicit set to cluster's namespace. - // For Profile namespace must be left empty. The Profile namespace will be used. - Namespace string `json:"namespace"` - - // Name of the referenced resource. - // +kubebuilder:validation:MinLength=1 - Name string `json:"name"` - - // Kind of the resource. Supported kinds are: - // - ConfigMap/Secret - // +kubebuilder:validation:Enum=ConfigMap;Secret - Kind string `json:"kind"` -} - -// HelmChartAction specifies action on an helm chart -// +kubebuilder:validation:Enum:=Install;Uninstall -type HelmChartAction string - -const ( - // HelmChartActionInstall will cause Helm chart to be installed - HelmChartActionInstall = HelmChartAction("Install") - - // HelmChartActionUninstall will cause Helm chart to be removed - HelmChartActionUninstall = HelmChartAction("Uninstall") -) - -type HelmOptions struct { - // SkipCRDs controls whether CRDs should be installed during install/upgrade operation. - // By default, CRDs are installed if not already present. - // +kubebuilder:default:=false - // +optional - SkipCRDs bool `json:"skipCRDs,omitempty"` - - // SkipSchemaValidation determines if JSON schema validation is disabled. - // +kubebuilder:default:=false - // +optional - SkipSchemaValidation bool `json:"skipSchemaValidation,omitempty"` - - // if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet - // are in a ready state before marking the release as successful. It will wait for as long as --timeout - // Default to false - // +kubebuilder:default:=false - // +optional - Wait bool `json:"wait,omitempty"` - - // if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. - // It will wait for as long as --timeout - // Default to false - // +kubebuilder:default:=false - // +optional - WaitForJobs bool `json:"waitForJobs,omitempty"` - - // time to wait for any individual Kubernetes operation (like Jobs for hooks) (default 5m0s) - // +optional - Timeout *metav1.Duration `json:"timeout,omitempty"` - - // prevent hooks from running during install/upgrade/uninstall - // Default to false - // +kubebuilder:default:=false - // +optional - DisableHooks bool `json:"disableHooks,omitempty"` - - // if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema - // Default to false - // +kubebuilder:default:=false - // +optional - DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"` - - // if set, the installation process deletes the installation/upgrades on failure. - // The --wait flag will be set automatically if --atomic is used - // Default to false - // +kubebuilder:default:=false - // +optional - Atomic bool `json:"atomic,omitempty"` - - // update dependencies if they are missing before installing the chart - // Default to false - // +kubebuilder:default:=false - // +optional - DependencyUpdate bool `json:"dependencyUpdate,omitempty"` - - // Labels that would be added to release metadata. - // +optional - Labels map[string]string `json:"labels,omitempty"` - - // EnableClientCache is a flag to enable Helm client cache. If it is not specified, it will be set to false. - // +kubebuilder:default=false - // +optional - EnableClientCache bool `json:"enableClientCache,omitempty"` - - // Description is the description of an helm operation - // +optional - Description string `json:"description,omitempty"` - - // HelmInstallOptions are options specific to helm install - // +optional - InstallOptions HelmInstallOptions `json:"installOptions,omitempty"` - - // HelmUpgradeOptions are options specific to helm upgrade - // +optional - UpgradeOptions HelmUpgradeOptions `json:"upgradeOptions,omitempty"` - - // HelmUninstallOptions are options specific to helm uninstall - // +optional - UninstallOptions HelmUninstallOptions `json:"uninstallOptions,omitempty"` -} - -type HelmInstallOptions struct { - // Create the release namespace if not present. Defaults to true - // +kubebuilder:default:=true - // +optional - CreateNamespace bool `json:"createNamespace,omitempty"` - - // Replaces if set indicates to replace an older release with this one - // +kubebuilder:default:=true - // +optional - Replace bool `json:"replace,omitempty"` -} - -type HelmUpgradeOptions struct { - // Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway. - // This should be used with caution. - // +kubebuilder:default:=false - // +optional - Force bool `json:"force,omitempty"` - - // ResetValues will reset the values to the chart's built-ins rather than merging with existing. - // +kubebuilder:default:=false - // +optional - ResetValues bool `json:"resetValues,omitempty"` - - // ReuseValues copies values from the current release to a new release if the - // new release does not have any values. If the request already has values, - // or if there are no values in the current release, this does nothing. - // This is skipped if the ResetValues flag is set, in which case the - // request values are not altered. - // +kubebuilder:default:=false - // +optional - ReuseValues bool `json:"reuseValues,omitempty"` - - // ResetThenReuseValues will reset the values to the chart's built-ins then merge with user's last supplied values. - // +kubebuilder:default:=false - // +optional - ResetThenReuseValues bool `json:"resetThenReuseValues,omitempty"` - - // Recreate will (if true) recreate pods after a rollback. - // +kubebuilder:default:=false - // +optional - Recreate bool `json:"recreate,omitempty"` - - // MaxHistory limits the maximum number of revisions saved per release - // Default to 2 - // +kubebuilder:default=2 - // +optional - MaxHistory int `json:"maxHistory,omitempty"` - - // CleanupOnFail will, if true, cause the upgrade to delete newly-created resources on a failed update. - // +kubebuilder:default:=false - // +optional - CleanupOnFail bool `json:"cleanupOnFail,omitempty"` - - // SubNotes determines whether sub-notes are rendered in the chart. - // +kubebuilder:default:=false - // +optional - SubNotes bool `json:"subNotes,omitempty"` - - // UpgradeCRDs upgrade CRDs from the Helm Chart's crds directory - // By default, CRDs are not applied during Helm upgrade action by Helm - // https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ - // +kubebuilder:default:=false - // +optional - UpgradeCRDs bool `json:"upgradeCRDs,omitempty"` -} - -type HelmUninstallOptions struct { - // When uninstall a chart with this flag, Helm removes the resources associated with the chart, - // but it keeps the release information. This allows to see details about the uninstalled release - // using the helm history command. - // +optional - KeepHistory bool `json:"keepHistory,omitempty"` - - // DeletionPropagation - // +kubebuilder:validation:Enum:=orphan;foreground;background - // +optional - DeletionPropagation string `json:"deletionPropagation,omitempty"` -} - -type HelmChart struct { - // RepositoryURL is the URL helm chart repository - // +kubebuilder:validation:MinLength=1 - RepositoryURL string `json:"repositoryURL"` - - // RepositoryName is the name helm chart repository - // +kubebuilder:validation:MinLength=1 - RepositoryName string `json:"repositoryName"` - - // ChartName is the chart name - // +kubebuilder:validation:MinLength=1 - ChartName string `json:"chartName"` - - // ChartVersion is the chart version - // +kubebuilder:validation:MinLength=1 - ChartVersion string `json:"chartVersion"` - - // ReleaseName is the chart release - // +kubebuilder:validation:MinLength=1 - ReleaseName string `json:"releaseName"` - - // ReleaseNamespace is the namespace release will be installed - // +kubebuilder:validation:MinLength=1 - ReleaseNamespace string `json:"releaseNamespace"` - - // Values field allows to define configuration for the Helm release. - // These values can be static or leverage Go templates for dynamic customization. - // When expressed as templates, the values are filled in using information from - // resources within the management cluster before deployment. - // +optional - Values string `json:"values,omitempty"` - - // ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - // it is possible to store configuration for the Helm release. - // These values can be static or leverage Go templates for dynamic customization. - // When expressed as templates, the values are filled in using information from - // resources within the management cluster before deployment. - // +optional - ValuesFrom []ValueFrom `json:"valuesFrom,omitempty"` - - // HelmChartAction is the action that will be taken on the helm chart - // +kubebuilder:default:=Install - // +optional - HelmChartAction HelmChartAction `json:"helmChartAction,omitempty"` - - // Options allows to set flags which are used during installation. - // +optional - Options *HelmOptions `json:"options,omitempty"` -} - -type KustomizationRef struct { - // Namespace of the referenced resource. - // For ClusterProfile namespace can be left empty. In such a case, namespace will - // be implicit set to cluster's namespace. - // For Profile namespace must be left empty. The Profile namespace will be used. - Namespace string `json:"namespace"` - - // Name of the referenced resource. - // +kubebuilder:validation:MinLength=1 - Name string `json:"name"` - - // Kind of the resource. Supported kinds are: - // - flux GitRepository;OCIRepository;Bucket - // - ConfigMap/Secret - // +kubebuilder:validation:Enum=GitRepository;OCIRepository;Bucket;ConfigMap;Secret - Kind string `json:"kind"` - - // Path to the directory containing the kustomization.yaml file, or the - // set of plain YAMLs a kustomization.yaml should be generated for. - // Defaults to 'None', which translates to the root path of the SourceRef. - // +optional - Path string `json:"path,omitempty"` - - // TargetNamespace sets or overrides the namespace in the - // kustomization.yaml file. - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=63 - // +kubebuilder:validation:Optional - // +optional - TargetNamespace string `json:"targetNamespace,omitempty"` - - // DeploymentType indicates whether resources need to be deployed - // into the management cluster (local) or the managed cluster (remote) - // +kubebuilder:default:=Remote - // +optional - DeploymentType DeploymentType `json:"deploymentType,omitempty"` - - // Values is a map[string]string type that allows to define a set of key-value pairs. - // These key-value pairs can optionally leverage Go templates for further processing. - // With Sveltos, you can define key-value pairs where the values can be Go templates. - // These templates have access to management cluster information during deployment. This allows - // to do more than just replace placeholders. Variables can be used to dynamically - // construct values based on other resources or variables within the Kustomize output. - // For example, imagine you have a Region key with a template value like: - // '{{ index .Cluster.metadata.labels "region" }}'. - // This template retrieves the region label from the cluster instance metadata. - // Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - // The output itself can also contain templates, like: - // region: '{{ default "west" .Region }}'. - // This way, the final output from Kustomize will have the region set dynamically based on - // the actual region retrieved earlier. - // +optional - Values map[string]string `json:"values,omitempty"` - - // ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - // it is possible to define key-value pairs. These key-value pairs can optionally leverage - // Go templates for further processing. - // With Sveltos, you can define key-value pairs where the values can be Go templates. - // These templates have access to management cluster information during deployment. This allows - // to do more than just replace placeholders. Variables can be used to dynamically - // construct values based on other resources or variables within the Kustomize output. - // For example, imagine you have a Region key with a template value like: - // '{{ index .Cluster.metadata.labels "region" }}'. - // This template retrieves the region label from the cluster instance metadata. - // Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - // The output itself can also contain templates, like: - // region: '{{ default "west" .Region }}'. - // This way, the final output from Kustomize will have the region set dynamically based on - // the actual region retrieved earlier. - // +optional - ValuesFrom []ValueFrom `json:"valuesFrom,omitempty"` -} - -// StopMatchingBehavior indicates what will happen when Cluster stops matching -// a ClusterProfile. By default, withdrawpolicies, deployed Helm charts and Kubernetes -// resources will be removed from Cluster. LeavePolicy instead leaves Helm charts -// and Kubernetes policies in the Cluster. -// +kubebuilder:validation:Enum:=WithdrawPolicies;LeavePolicies -type StopMatchingBehavior string - -// Define the StopMatchingBehavior constants. -const ( - WithdrawPolicies StopMatchingBehavior = "WithdrawPolicies" - LeavePolicies StopMatchingBehavior = "LeavePolicies" -) - -type TemplateResourceRef struct { - // Resource references a Kubernetes instance in the management - // cluster to fetch and use during template instantiation. - Resource corev1.ObjectReference `json:"resource"` - - // Identifier is how the resource will be referred to in the - // template - Identifier string `json:"identifier"` -} - -type PolicyRef struct { - // Namespace of the referenced resource. - // For ClusterProfile namespace can be left empty. In such a case, namespace will - // be implicit set to cluster's namespace. - // For Profile namespace must be left empty. Profile namespace will be used. - // +optional - Namespace string `json:"namespace,omitempty"` - - // Name of the referenced resource. - // +kubebuilder:validation:MinLength=1 - Name string `json:"name"` - - // Kind of the resource. Supported kinds are: - // - ConfigMap/Secret - // - flux GitRepository;OCIRepository;Bucket - // +kubebuilder:validation:Enum=GitRepository;OCIRepository;Bucket;ConfigMap;Secret - Kind string `json:"kind"` - - // Path to the directory containing the YAML files. - // Defaults to 'None', which translates to the root path of the SourceRef. - // Used only for GitRepository;OCIRepository;Bucket - // +optional - Path string `json:"path,omitempty"` - - // DeploymentType indicates whether resources need to be deployed - // into the management cluster (local) or the managed cluster (remote) - // +kubebuilder:default:=Remote - // +optional - DeploymentType DeploymentType `json:"deploymentType,omitempty"` -} - -type Clusters struct { - // Hash represents of a unique value for ClusterProfile Spec at - // a fixed point in time - // +optional - Hash []byte `json:"hash,omitempty"` - - // Clusters reference all the clusters currently matching - // ClusterProfile ClusterSelector and already updated/being updated - // to ClusterProfile Spec - Clusters []corev1.ObjectReference `json:"clusters,omitempty"` -} - -type Spec struct { - // ClusterSelector identifies clusters to associate to. - // +optional - ClusterSelector libsveltosv1alpha1.Selector `json:"clusterSelector,omitempty"` - - // ClusterRefs identifies clusters to associate to. - // +optional - ClusterRefs []corev1.ObjectReference `json:"clusterRefs,omitempty"` - - // SetRefs identifies referenced (cluster)Sets. - // - ClusterProfile can reference ClusterSet; - // - Profile can reference Set; - // +optional - SetRefs []string `json:"setRefs,omitempty"` - - // SyncMode specifies how features are synced in a matching workload cluster. - // - OneTime means, first time a workload cluster matches the ClusterProfile, - // features will be deployed in such cluster. Any subsequent feature configuration - // change won't be applied into the matching workload clusters; - // - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile, - // the specified features are deployed. Subsequent changes to the feature configuration are also - // automatically applied to all matching workload clusters. - // _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors - // matching managed clusters for configuration drift. If drift is detected, a reconciliation is - // triggered to ensure the managed cluster's configuration aligns with the ClusterProfile. - // - DryRun means no change will be propagated to any matching cluster. A report - // instead will be generated summarizing what would happen in any matching cluster - // because of the changes made to ClusterProfile while in DryRun mode. - // +kubebuilder:default:=Continuous - // +optional - SyncMode SyncMode `json:"syncMode,omitempty"` - - // Tier controls the order of deployment for ClusterProfile or Profile resources targeting - // the same cluster resources. - // Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes - // resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it. - // Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest** - // Tier value takes priority and deploys the resource. - // Higher Tier values represent lower priority. The default Tier value is 100. - // Using Tiers provides finer control over resource deployment within your cluster, particularly useful - // when multiple configurations manage the same resources. - // +kubebuilder:default:=100 - // +kubebuilder:validation:Minimum=1 - // +optional - Tier int32 `json:"tier,omitempty"` - - // By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after - // encountering the first conflict (e.g., another ClusterProfile already deployed the resource). - // If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - // if conflicts are detected for previous resources. - // +kubebuilder:default:=false - // +optional - ContinueOnConflict bool `json:"continueOnConflict,omitempty"` - - // The maximum number of clusters that can be updated concurrently. - // Value can be an absolute number (ex: 5) or a percentage of desired cluster (ex: 10%). - // Defaults to 100%. - // Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile - // changes, only 30% of matching clusters will be updated in parallel. Only when updates - // in those cluster succeed, other matching clusters are updated. - // +kubebuilder:validation:XIntOrString - // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" - // +optional - MaxUpdate *intstr.IntOrString `json:"maxUpdate,omitempty"` - - // StopMatchingBehavior indicates what behavior should be when a Cluster stop matching - // the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will - // be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead - // leave ClusterProfile deployed policies in the Cluster. - // +kubebuilder:default:=WithdrawPolicies - // +optional - StopMatchingBehavior StopMatchingBehavior `json:"stopMatchingBehavior,omitempty"` - - // Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed - // by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade - // when a ConfigMap/Secret instance mounted as volume is modified. - // When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically - // starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it. - // +kubebuilder:default:=false - // +optional - Reloader bool `json:"reloader,omitempty"` - - // TemplateResourceRefs is a list of resource to collect from the management cluster. - // Those resources' values will be used to instantiate templates contained in referenced - // PolicyRefs and Helm charts - // +patchMergeKey=identifier - // +patchStrategy=merge,retainKeys - // +listType=map - // +listMapKey=identifier - // +optional - TemplateResourceRefs []TemplateResourceRef `json:"templateResourceRefs,omitempty" patchStrategy:"merge" patchMergeKey:"identifier"` - - // DependsOn specifies a list of other ClusterProfiles that this instance depends on. - // In any managed cluster that matches this ClusterProfile, the add-ons and applications - // defined in this instance will not be deployed until all add-ons and applications in the - // ClusterProfiles listed as dependencies are deployed. - DependsOn []string `json:"dependsOn,omitempty"` - - // PolicyRefs references all the ConfigMaps/Secrets containing kubernetes resources - // that need to be deployed in the matching CAPI clusters. - // +optional - PolicyRefs []PolicyRef `json:"policyRefs,omitempty"` - - // Helm charts is a list of helm charts that need to be deployed - HelmCharts []HelmChart `json:"helmCharts,omitempty"` - - // Kustomization refs is a list of kustomization paths. Kustomization will - // be run on those paths and the outcome will be deployed. - KustomizationRefs []KustomizationRef `json:"kustomizationRefs,omitempty"` - - // ValidateHealths is a slice of Lua functions to run against - // the managed cluster to validate the state of those add-ons/applications - // is healthy - ValidateHealths []ValidateHealth `json:"validateHealths,omitempty"` - - // ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in - // a managed cluster based on this ClusterProfile/Profile instance. - // **Important:** If a resource deployed by Sveltos already has a label with a key present in - // `ExtraLabels`, the value from `ExtraLabels` will override the existing value. - // +optional - ExtraLabels map[string]string `json:"extraLabels,omitempty"` - - // ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources - // deployed in a managed cluster based on this ClusterProfile/Profile instance. - // **Important:** If a resource deployed by Sveltos already has a annotation with a key present in - // `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. - // +optional - ExtraAnnotations map[string]string `json:"extraAnnotations,omitempty"` -} diff --git a/api/v1alpha1/status.go b/api/v1alpha1/status.go deleted file mode 100644 index c896daf4..00000000 --- a/api/v1alpha1/status.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2023. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" -) - -// Status defines the observed state of ClusterProfile/Profile -type Status struct { - // MatchingClusterRefs reference all the clusters currently matching - // ClusterProfile ClusterSelector - // +optional - MatchingClusterRefs []corev1.ObjectReference `json:"matchingClusters,omitempty"` - - // UpdatingClusters reference all the cluster currently matching - // ClusterProfile ClusterSelector and being updated - // +optional - UpdatingClusters Clusters `json:"updatingClusters,omitempty"` - - // UpdatedClusters contains information all the cluster currently matching - // ClusterProfile ClusterSelector and already updated to latest ClusterProfile - // Spec - // +optional - UpdatedClusters Clusters `json:"updatedClusters,omitempty"` -} diff --git a/api/v1alpha1/v1alpha1_suite_test.go b/api/v1alpha1/v1alpha1_suite_test.go deleted file mode 100644 index d42e1d5d..00000000 --- a/api/v1alpha1/v1alpha1_suite_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2022. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1_test - -import ( - "testing" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" -) - -func TestControllers(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Controllers Suite") -} diff --git a/api/v1alpha1/zz_generated.conversion.go b/api/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index a09a5171..00000000 --- a/api/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,1613 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - unsafe "unsafe" - - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - intstr "k8s.io/apimachinery/pkg/util/intstr" - - v1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" - apiv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" - apiv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*Chart)(nil), (*v1beta1.Chart)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Chart_To_v1beta1_Chart(a.(*Chart), b.(*v1beta1.Chart), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Chart)(nil), (*Chart)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Chart_To_v1alpha1_Chart(a.(*v1beta1.Chart), b.(*Chart), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterConfiguration)(nil), (*v1beta1.ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterConfiguration_To_v1beta1_ClusterConfiguration(a.(*ClusterConfiguration), b.(*v1beta1.ClusterConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterConfiguration)(nil), (*ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterConfiguration_To_v1alpha1_ClusterConfiguration(a.(*v1beta1.ClusterConfiguration), b.(*ClusterConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterConfigurationList)(nil), (*v1beta1.ClusterConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterConfigurationList_To_v1beta1_ClusterConfigurationList(a.(*ClusterConfigurationList), b.(*v1beta1.ClusterConfigurationList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterConfigurationList)(nil), (*ClusterConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterConfigurationList_To_v1alpha1_ClusterConfigurationList(a.(*v1beta1.ClusterConfigurationList), b.(*ClusterConfigurationList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterConfigurationStatus)(nil), (*v1beta1.ClusterConfigurationStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterConfigurationStatus_To_v1beta1_ClusterConfigurationStatus(a.(*ClusterConfigurationStatus), b.(*v1beta1.ClusterConfigurationStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterConfigurationStatus)(nil), (*ClusterConfigurationStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterConfigurationStatus_To_v1alpha1_ClusterConfigurationStatus(a.(*v1beta1.ClusterConfigurationStatus), b.(*ClusterConfigurationStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterProfile)(nil), (*v1beta1.ClusterProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterProfile_To_v1beta1_ClusterProfile(a.(*ClusterProfile), b.(*v1beta1.ClusterProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterProfile)(nil), (*ClusterProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterProfile_To_v1alpha1_ClusterProfile(a.(*v1beta1.ClusterProfile), b.(*ClusterProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterProfileList)(nil), (*v1beta1.ClusterProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterProfileList_To_v1beta1_ClusterProfileList(a.(*ClusterProfileList), b.(*v1beta1.ClusterProfileList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterProfileList)(nil), (*ClusterProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterProfileList_To_v1alpha1_ClusterProfileList(a.(*v1beta1.ClusterProfileList), b.(*ClusterProfileList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterProfileResource)(nil), (*v1beta1.ClusterProfileResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterProfileResource_To_v1beta1_ClusterProfileResource(a.(*ClusterProfileResource), b.(*v1beta1.ClusterProfileResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterProfileResource)(nil), (*ClusterProfileResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterProfileResource_To_v1alpha1_ClusterProfileResource(a.(*v1beta1.ClusterProfileResource), b.(*ClusterProfileResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterReport)(nil), (*v1beta1.ClusterReport)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterReport_To_v1beta1_ClusterReport(a.(*ClusterReport), b.(*v1beta1.ClusterReport), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterReport)(nil), (*ClusterReport)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterReport_To_v1alpha1_ClusterReport(a.(*v1beta1.ClusterReport), b.(*ClusterReport), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterReportList)(nil), (*v1beta1.ClusterReportList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterReportList_To_v1beta1_ClusterReportList(a.(*ClusterReportList), b.(*v1beta1.ClusterReportList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterReportList)(nil), (*ClusterReportList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterReportList_To_v1alpha1_ClusterReportList(a.(*v1beta1.ClusterReportList), b.(*ClusterReportList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterReportSpec)(nil), (*v1beta1.ClusterReportSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterReportSpec_To_v1beta1_ClusterReportSpec(a.(*ClusterReportSpec), b.(*v1beta1.ClusterReportSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterReportSpec)(nil), (*ClusterReportSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterReportSpec_To_v1alpha1_ClusterReportSpec(a.(*v1beta1.ClusterReportSpec), b.(*ClusterReportSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterReportStatus)(nil), (*v1beta1.ClusterReportStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterReportStatus_To_v1beta1_ClusterReportStatus(a.(*ClusterReportStatus), b.(*v1beta1.ClusterReportStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterReportStatus)(nil), (*ClusterReportStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterReportStatus_To_v1alpha1_ClusterReportStatus(a.(*v1beta1.ClusterReportStatus), b.(*ClusterReportStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterSummary)(nil), (*v1beta1.ClusterSummary)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterSummary_To_v1beta1_ClusterSummary(a.(*ClusterSummary), b.(*v1beta1.ClusterSummary), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterSummary)(nil), (*ClusterSummary)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterSummary_To_v1alpha1_ClusterSummary(a.(*v1beta1.ClusterSummary), b.(*ClusterSummary), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterSummaryList)(nil), (*v1beta1.ClusterSummaryList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterSummaryList_To_v1beta1_ClusterSummaryList(a.(*ClusterSummaryList), b.(*v1beta1.ClusterSummaryList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterSummaryList)(nil), (*ClusterSummaryList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterSummaryList_To_v1alpha1_ClusterSummaryList(a.(*v1beta1.ClusterSummaryList), b.(*ClusterSummaryList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterSummarySpec)(nil), (*v1beta1.ClusterSummarySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterSummarySpec_To_v1beta1_ClusterSummarySpec(a.(*ClusterSummarySpec), b.(*v1beta1.ClusterSummarySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterSummarySpec)(nil), (*ClusterSummarySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterSummarySpec_To_v1alpha1_ClusterSummarySpec(a.(*v1beta1.ClusterSummarySpec), b.(*ClusterSummarySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterSummaryStatus)(nil), (*v1beta1.ClusterSummaryStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ClusterSummaryStatus_To_v1beta1_ClusterSummaryStatus(a.(*ClusterSummaryStatus), b.(*v1beta1.ClusterSummaryStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterSummaryStatus)(nil), (*ClusterSummaryStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterSummaryStatus_To_v1alpha1_ClusterSummaryStatus(a.(*v1beta1.ClusterSummaryStatus), b.(*ClusterSummaryStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Clusters)(nil), (*v1beta1.Clusters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Clusters_To_v1beta1_Clusters(a.(*Clusters), b.(*v1beta1.Clusters), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Clusters)(nil), (*Clusters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Clusters_To_v1alpha1_Clusters(a.(*v1beta1.Clusters), b.(*Clusters), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DryRunReconciliationError)(nil), (*v1beta1.DryRunReconciliationError)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_DryRunReconciliationError_To_v1beta1_DryRunReconciliationError(a.(*DryRunReconciliationError), b.(*v1beta1.DryRunReconciliationError), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DryRunReconciliationError)(nil), (*DryRunReconciliationError)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DryRunReconciliationError_To_v1alpha1_DryRunReconciliationError(a.(*v1beta1.DryRunReconciliationError), b.(*DryRunReconciliationError), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Feature)(nil), (*v1beta1.Feature)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Feature_To_v1beta1_Feature(a.(*Feature), b.(*v1beta1.Feature), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Feature)(nil), (*Feature)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Feature_To_v1alpha1_Feature(a.(*v1beta1.Feature), b.(*Feature), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FeatureDeploymentInfo)(nil), (*v1beta1.FeatureDeploymentInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_FeatureDeploymentInfo_To_v1beta1_FeatureDeploymentInfo(a.(*FeatureDeploymentInfo), b.(*v1beta1.FeatureDeploymentInfo), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.FeatureDeploymentInfo)(nil), (*FeatureDeploymentInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FeatureDeploymentInfo_To_v1alpha1_FeatureDeploymentInfo(a.(*v1beta1.FeatureDeploymentInfo), b.(*FeatureDeploymentInfo), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FeatureSummary)(nil), (*v1beta1.FeatureSummary)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_FeatureSummary_To_v1beta1_FeatureSummary(a.(*FeatureSummary), b.(*v1beta1.FeatureSummary), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.FeatureSummary)(nil), (*FeatureSummary)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FeatureSummary_To_v1alpha1_FeatureSummary(a.(*v1beta1.FeatureSummary), b.(*FeatureSummary), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*HelmChart)(nil), (*v1beta1.HelmChart)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_HelmChart_To_v1beta1_HelmChart(a.(*HelmChart), b.(*v1beta1.HelmChart), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*HelmChartSummary)(nil), (*v1beta1.HelmChartSummary)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_HelmChartSummary_To_v1beta1_HelmChartSummary(a.(*HelmChartSummary), b.(*v1beta1.HelmChartSummary), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.HelmChartSummary)(nil), (*HelmChartSummary)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_HelmChartSummary_To_v1alpha1_HelmChartSummary(a.(*v1beta1.HelmChartSummary), b.(*HelmChartSummary), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*HelmInstallOptions)(nil), (*v1beta1.HelmInstallOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_HelmInstallOptions_To_v1beta1_HelmInstallOptions(a.(*HelmInstallOptions), b.(*v1beta1.HelmInstallOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*HelmOptions)(nil), (*v1beta1.HelmOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_HelmOptions_To_v1beta1_HelmOptions(a.(*HelmOptions), b.(*v1beta1.HelmOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.HelmOptions)(nil), (*HelmOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_HelmOptions_To_v1alpha1_HelmOptions(a.(*v1beta1.HelmOptions), b.(*HelmOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*HelmUninstallOptions)(nil), (*v1beta1.HelmUninstallOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_HelmUninstallOptions_To_v1beta1_HelmUninstallOptions(a.(*HelmUninstallOptions), b.(*v1beta1.HelmUninstallOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*HelmUpgradeOptions)(nil), (*v1beta1.HelmUpgradeOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_HelmUpgradeOptions_To_v1beta1_HelmUpgradeOptions(a.(*HelmUpgradeOptions), b.(*v1beta1.HelmUpgradeOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KustomizationRef)(nil), (*v1beta1.KustomizationRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_KustomizationRef_To_v1beta1_KustomizationRef(a.(*KustomizationRef), b.(*v1beta1.KustomizationRef), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KustomizationRef)(nil), (*KustomizationRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KustomizationRef_To_v1alpha1_KustomizationRef(a.(*v1beta1.KustomizationRef), b.(*KustomizationRef), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PolicyRef)(nil), (*v1beta1.PolicyRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PolicyRef_To_v1beta1_PolicyRef(a.(*PolicyRef), b.(*v1beta1.PolicyRef), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.PolicyRef)(nil), (*PolicyRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_PolicyRef_To_v1alpha1_PolicyRef(a.(*v1beta1.PolicyRef), b.(*PolicyRef), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Profile)(nil), (*v1beta1.Profile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Profile_To_v1beta1_Profile(a.(*Profile), b.(*v1beta1.Profile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Profile)(nil), (*Profile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Profile_To_v1alpha1_Profile(a.(*v1beta1.Profile), b.(*Profile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ProfileList)(nil), (*v1beta1.ProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ProfileList_To_v1beta1_ProfileList(a.(*ProfileList), b.(*v1beta1.ProfileList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ProfileList)(nil), (*ProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ProfileList_To_v1alpha1_ProfileList(a.(*v1beta1.ProfileList), b.(*ProfileList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ProfileResource)(nil), (*v1beta1.ProfileResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ProfileResource_To_v1beta1_ProfileResource(a.(*ProfileResource), b.(*v1beta1.ProfileResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ProfileResource)(nil), (*ProfileResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ProfileResource_To_v1alpha1_ProfileResource(a.(*v1beta1.ProfileResource), b.(*ProfileResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ReleaseReport)(nil), (*v1beta1.ReleaseReport)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ReleaseReport_To_v1beta1_ReleaseReport(a.(*ReleaseReport), b.(*v1beta1.ReleaseReport), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ReleaseReport)(nil), (*ReleaseReport)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ReleaseReport_To_v1alpha1_ReleaseReport(a.(*v1beta1.ReleaseReport), b.(*ReleaseReport), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Resource)(nil), (*v1beta1.Resource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Resource_To_v1beta1_Resource(a.(*Resource), b.(*v1beta1.Resource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Resource)(nil), (*Resource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Resource_To_v1alpha1_Resource(a.(*v1beta1.Resource), b.(*Resource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ResourceReport)(nil), (*v1beta1.ResourceReport)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ResourceReport_To_v1beta1_ResourceReport(a.(*ResourceReport), b.(*v1beta1.ResourceReport), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ResourceReport)(nil), (*ResourceReport)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ResourceReport_To_v1alpha1_ResourceReport(a.(*v1beta1.ResourceReport), b.(*ResourceReport), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Status)(nil), (*v1beta1.Status)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Status_To_v1beta1_Status(a.(*Status), b.(*v1beta1.Status), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Status)(nil), (*Status)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Status_To_v1alpha1_Status(a.(*v1beta1.Status), b.(*Status), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*TemplateResourceRef)(nil), (*v1beta1.TemplateResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_TemplateResourceRef_To_v1beta1_TemplateResourceRef(a.(*TemplateResourceRef), b.(*v1beta1.TemplateResourceRef), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.TemplateResourceRef)(nil), (*TemplateResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_TemplateResourceRef_To_v1alpha1_TemplateResourceRef(a.(*v1beta1.TemplateResourceRef), b.(*TemplateResourceRef), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ValidateHealth)(nil), (*v1beta1.ValidateHealth)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ValidateHealth_To_v1beta1_ValidateHealth(a.(*ValidateHealth), b.(*v1beta1.ValidateHealth), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ValidateHealth)(nil), (*ValidateHealth)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ValidateHealth_To_v1alpha1_ValidateHealth(a.(*v1beta1.ValidateHealth), b.(*ValidateHealth), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ValueFrom)(nil), (*v1beta1.ValueFrom)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ValueFrom_To_v1beta1_ValueFrom(a.(*ValueFrom), b.(*v1beta1.ValueFrom), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ValueFrom)(nil), (*ValueFrom)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ValueFrom_To_v1alpha1_ValueFrom(a.(*v1beta1.ValueFrom), b.(*ValueFrom), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*Spec)(nil), (*v1beta1.Spec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Spec_To_v1beta1_Spec(a.(*Spec), b.(*v1beta1.Spec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.HelmChart)(nil), (*HelmChart)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_HelmChart_To_v1alpha1_HelmChart(a.(*v1beta1.HelmChart), b.(*HelmChart), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.HelmInstallOptions)(nil), (*HelmInstallOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_HelmInstallOptions_To_v1alpha1_HelmInstallOptions(a.(*v1beta1.HelmInstallOptions), b.(*HelmInstallOptions), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.HelmUninstallOptions)(nil), (*HelmUninstallOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_HelmUninstallOptions_To_v1alpha1_HelmUninstallOptions(a.(*v1beta1.HelmUninstallOptions), b.(*HelmUninstallOptions), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.HelmUpgradeOptions)(nil), (*HelmUpgradeOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_HelmUpgradeOptions_To_v1alpha1_HelmUpgradeOptions(a.(*v1beta1.HelmUpgradeOptions), b.(*HelmUpgradeOptions), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.Spec)(nil), (*Spec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Spec_To_v1alpha1_Spec(a.(*v1beta1.Spec), b.(*Spec), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_Chart_To_v1beta1_Chart(in *Chart, out *v1beta1.Chart, s conversion.Scope) error { - out.RepoURL = in.RepoURL - out.ReleaseName = in.ReleaseName - out.Namespace = in.Namespace - out.ChartVersion = in.ChartVersion - out.AppVersion = in.AppVersion - out.Icon = in.Icon - out.LastAppliedTime = (*v1.Time)(unsafe.Pointer(in.LastAppliedTime)) - return nil -} - -// Convert_v1alpha1_Chart_To_v1beta1_Chart is an autogenerated conversion function. -func Convert_v1alpha1_Chart_To_v1beta1_Chart(in *Chart, out *v1beta1.Chart, s conversion.Scope) error { - return autoConvert_v1alpha1_Chart_To_v1beta1_Chart(in, out, s) -} - -func autoConvert_v1beta1_Chart_To_v1alpha1_Chart(in *v1beta1.Chart, out *Chart, s conversion.Scope) error { - out.RepoURL = in.RepoURL - out.ReleaseName = in.ReleaseName - out.Namespace = in.Namespace - out.ChartVersion = in.ChartVersion - out.AppVersion = in.AppVersion - out.Icon = in.Icon - out.LastAppliedTime = (*v1.Time)(unsafe.Pointer(in.LastAppliedTime)) - return nil -} - -// Convert_v1beta1_Chart_To_v1alpha1_Chart is an autogenerated conversion function. -func Convert_v1beta1_Chart_To_v1alpha1_Chart(in *v1beta1.Chart, out *Chart, s conversion.Scope) error { - return autoConvert_v1beta1_Chart_To_v1alpha1_Chart(in, out, s) -} - -func autoConvert_v1alpha1_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in *ClusterConfiguration, out *v1beta1.ClusterConfiguration, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_ClusterConfigurationStatus_To_v1beta1_ClusterConfigurationStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_ClusterConfiguration_To_v1beta1_ClusterConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in *ClusterConfiguration, out *v1beta1.ClusterConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in, out, s) -} - -func autoConvert_v1beta1_ClusterConfiguration_To_v1alpha1_ClusterConfiguration(in *v1beta1.ClusterConfiguration, out *ClusterConfiguration, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterConfigurationStatus_To_v1alpha1_ClusterConfigurationStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ClusterConfiguration_To_v1alpha1_ClusterConfiguration is an autogenerated conversion function. -func Convert_v1beta1_ClusterConfiguration_To_v1alpha1_ClusterConfiguration(in *v1beta1.ClusterConfiguration, out *ClusterConfiguration, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterConfiguration_To_v1alpha1_ClusterConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_ClusterConfigurationList_To_v1beta1_ClusterConfigurationList(in *ClusterConfigurationList, out *v1beta1.ClusterConfigurationList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.ClusterConfiguration)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_ClusterConfigurationList_To_v1beta1_ClusterConfigurationList is an autogenerated conversion function. -func Convert_v1alpha1_ClusterConfigurationList_To_v1beta1_ClusterConfigurationList(in *ClusterConfigurationList, out *v1beta1.ClusterConfigurationList, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterConfigurationList_To_v1beta1_ClusterConfigurationList(in, out, s) -} - -func autoConvert_v1beta1_ClusterConfigurationList_To_v1alpha1_ClusterConfigurationList(in *v1beta1.ClusterConfigurationList, out *ClusterConfigurationList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]ClusterConfiguration)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_ClusterConfigurationList_To_v1alpha1_ClusterConfigurationList is an autogenerated conversion function. -func Convert_v1beta1_ClusterConfigurationList_To_v1alpha1_ClusterConfigurationList(in *v1beta1.ClusterConfigurationList, out *ClusterConfigurationList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterConfigurationList_To_v1alpha1_ClusterConfigurationList(in, out, s) -} - -func autoConvert_v1alpha1_ClusterConfigurationStatus_To_v1beta1_ClusterConfigurationStatus(in *ClusterConfigurationStatus, out *v1beta1.ClusterConfigurationStatus, s conversion.Scope) error { - out.ClusterProfileResources = *(*[]v1beta1.ClusterProfileResource)(unsafe.Pointer(&in.ClusterProfileResources)) - out.ProfileResources = *(*[]v1beta1.ProfileResource)(unsafe.Pointer(&in.ProfileResources)) - return nil -} - -// Convert_v1alpha1_ClusterConfigurationStatus_To_v1beta1_ClusterConfigurationStatus is an autogenerated conversion function. -func Convert_v1alpha1_ClusterConfigurationStatus_To_v1beta1_ClusterConfigurationStatus(in *ClusterConfigurationStatus, out *v1beta1.ClusterConfigurationStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterConfigurationStatus_To_v1beta1_ClusterConfigurationStatus(in, out, s) -} - -func autoConvert_v1beta1_ClusterConfigurationStatus_To_v1alpha1_ClusterConfigurationStatus(in *v1beta1.ClusterConfigurationStatus, out *ClusterConfigurationStatus, s conversion.Scope) error { - out.ClusterProfileResources = *(*[]ClusterProfileResource)(unsafe.Pointer(&in.ClusterProfileResources)) - out.ProfileResources = *(*[]ProfileResource)(unsafe.Pointer(&in.ProfileResources)) - return nil -} - -// Convert_v1beta1_ClusterConfigurationStatus_To_v1alpha1_ClusterConfigurationStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterConfigurationStatus_To_v1alpha1_ClusterConfigurationStatus(in *v1beta1.ClusterConfigurationStatus, out *ClusterConfigurationStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterConfigurationStatus_To_v1alpha1_ClusterConfigurationStatus(in, out, s) -} - -func autoConvert_v1alpha1_ClusterProfile_To_v1beta1_ClusterProfile(in *ClusterProfile, out *v1beta1.ClusterProfile, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_Spec_To_v1beta1_Spec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_Status_To_v1beta1_Status(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_ClusterProfile_To_v1beta1_ClusterProfile is an autogenerated conversion function. -func Convert_v1alpha1_ClusterProfile_To_v1beta1_ClusterProfile(in *ClusterProfile, out *v1beta1.ClusterProfile, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterProfile_To_v1beta1_ClusterProfile(in, out, s) -} - -func autoConvert_v1beta1_ClusterProfile_To_v1alpha1_ClusterProfile(in *v1beta1.ClusterProfile, out *ClusterProfile, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_Spec_To_v1alpha1_Spec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_Status_To_v1alpha1_Status(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ClusterProfile_To_v1alpha1_ClusterProfile is an autogenerated conversion function. -func Convert_v1beta1_ClusterProfile_To_v1alpha1_ClusterProfile(in *v1beta1.ClusterProfile, out *ClusterProfile, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterProfile_To_v1alpha1_ClusterProfile(in, out, s) -} - -func autoConvert_v1alpha1_ClusterProfileList_To_v1beta1_ClusterProfileList(in *ClusterProfileList, out *v1beta1.ClusterProfileList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.ClusterProfile, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_ClusterProfile_To_v1beta1_ClusterProfile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha1_ClusterProfileList_To_v1beta1_ClusterProfileList is an autogenerated conversion function. -func Convert_v1alpha1_ClusterProfileList_To_v1beta1_ClusterProfileList(in *ClusterProfileList, out *v1beta1.ClusterProfileList, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterProfileList_To_v1beta1_ClusterProfileList(in, out, s) -} - -func autoConvert_v1beta1_ClusterProfileList_To_v1alpha1_ClusterProfileList(in *v1beta1.ClusterProfileList, out *ClusterProfileList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterProfile, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ClusterProfile_To_v1alpha1_ClusterProfile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_ClusterProfileList_To_v1alpha1_ClusterProfileList is an autogenerated conversion function. -func Convert_v1beta1_ClusterProfileList_To_v1alpha1_ClusterProfileList(in *v1beta1.ClusterProfileList, out *ClusterProfileList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterProfileList_To_v1alpha1_ClusterProfileList(in, out, s) -} - -func autoConvert_v1alpha1_ClusterProfileResource_To_v1beta1_ClusterProfileResource(in *ClusterProfileResource, out *v1beta1.ClusterProfileResource, s conversion.Scope) error { - out.ClusterProfileName = in.ClusterProfileName - out.Features = *(*[]v1beta1.Feature)(unsafe.Pointer(&in.Features)) - return nil -} - -// Convert_v1alpha1_ClusterProfileResource_To_v1beta1_ClusterProfileResource is an autogenerated conversion function. -func Convert_v1alpha1_ClusterProfileResource_To_v1beta1_ClusterProfileResource(in *ClusterProfileResource, out *v1beta1.ClusterProfileResource, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterProfileResource_To_v1beta1_ClusterProfileResource(in, out, s) -} - -func autoConvert_v1beta1_ClusterProfileResource_To_v1alpha1_ClusterProfileResource(in *v1beta1.ClusterProfileResource, out *ClusterProfileResource, s conversion.Scope) error { - out.ClusterProfileName = in.ClusterProfileName - out.Features = *(*[]Feature)(unsafe.Pointer(&in.Features)) - return nil -} - -// Convert_v1beta1_ClusterProfileResource_To_v1alpha1_ClusterProfileResource is an autogenerated conversion function. -func Convert_v1beta1_ClusterProfileResource_To_v1alpha1_ClusterProfileResource(in *v1beta1.ClusterProfileResource, out *ClusterProfileResource, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterProfileResource_To_v1alpha1_ClusterProfileResource(in, out, s) -} - -func autoConvert_v1alpha1_ClusterReport_To_v1beta1_ClusterReport(in *ClusterReport, out *v1beta1.ClusterReport, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_ClusterReportSpec_To_v1beta1_ClusterReportSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_ClusterReportStatus_To_v1beta1_ClusterReportStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_ClusterReport_To_v1beta1_ClusterReport is an autogenerated conversion function. -func Convert_v1alpha1_ClusterReport_To_v1beta1_ClusterReport(in *ClusterReport, out *v1beta1.ClusterReport, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterReport_To_v1beta1_ClusterReport(in, out, s) -} - -func autoConvert_v1beta1_ClusterReport_To_v1alpha1_ClusterReport(in *v1beta1.ClusterReport, out *ClusterReport, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterReportSpec_To_v1alpha1_ClusterReportSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ClusterReportStatus_To_v1alpha1_ClusterReportStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ClusterReport_To_v1alpha1_ClusterReport is an autogenerated conversion function. -func Convert_v1beta1_ClusterReport_To_v1alpha1_ClusterReport(in *v1beta1.ClusterReport, out *ClusterReport, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterReport_To_v1alpha1_ClusterReport(in, out, s) -} - -func autoConvert_v1alpha1_ClusterReportList_To_v1beta1_ClusterReportList(in *ClusterReportList, out *v1beta1.ClusterReportList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.ClusterReport)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_ClusterReportList_To_v1beta1_ClusterReportList is an autogenerated conversion function. -func Convert_v1alpha1_ClusterReportList_To_v1beta1_ClusterReportList(in *ClusterReportList, out *v1beta1.ClusterReportList, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterReportList_To_v1beta1_ClusterReportList(in, out, s) -} - -func autoConvert_v1beta1_ClusterReportList_To_v1alpha1_ClusterReportList(in *v1beta1.ClusterReportList, out *ClusterReportList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]ClusterReport)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_ClusterReportList_To_v1alpha1_ClusterReportList is an autogenerated conversion function. -func Convert_v1beta1_ClusterReportList_To_v1alpha1_ClusterReportList(in *v1beta1.ClusterReportList, out *ClusterReportList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterReportList_To_v1alpha1_ClusterReportList(in, out, s) -} - -func autoConvert_v1alpha1_ClusterReportSpec_To_v1beta1_ClusterReportSpec(in *ClusterReportSpec, out *v1beta1.ClusterReportSpec, s conversion.Scope) error { - out.ClusterNamespace = in.ClusterNamespace - out.ClusterName = in.ClusterName - return nil -} - -// Convert_v1alpha1_ClusterReportSpec_To_v1beta1_ClusterReportSpec is an autogenerated conversion function. -func Convert_v1alpha1_ClusterReportSpec_To_v1beta1_ClusterReportSpec(in *ClusterReportSpec, out *v1beta1.ClusterReportSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterReportSpec_To_v1beta1_ClusterReportSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterReportSpec_To_v1alpha1_ClusterReportSpec(in *v1beta1.ClusterReportSpec, out *ClusterReportSpec, s conversion.Scope) error { - out.ClusterNamespace = in.ClusterNamespace - out.ClusterName = in.ClusterName - return nil -} - -// Convert_v1beta1_ClusterReportSpec_To_v1alpha1_ClusterReportSpec is an autogenerated conversion function. -func Convert_v1beta1_ClusterReportSpec_To_v1alpha1_ClusterReportSpec(in *v1beta1.ClusterReportSpec, out *ClusterReportSpec, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterReportSpec_To_v1alpha1_ClusterReportSpec(in, out, s) -} - -func autoConvert_v1alpha1_ClusterReportStatus_To_v1beta1_ClusterReportStatus(in *ClusterReportStatus, out *v1beta1.ClusterReportStatus, s conversion.Scope) error { - out.ReleaseReports = *(*[]v1beta1.ReleaseReport)(unsafe.Pointer(&in.ReleaseReports)) - out.ResourceReports = *(*[]v1beta1.ResourceReport)(unsafe.Pointer(&in.ResourceReports)) - out.KustomizeResourceReports = *(*[]v1beta1.ResourceReport)(unsafe.Pointer(&in.KustomizeResourceReports)) - return nil -} - -// Convert_v1alpha1_ClusterReportStatus_To_v1beta1_ClusterReportStatus is an autogenerated conversion function. -func Convert_v1alpha1_ClusterReportStatus_To_v1beta1_ClusterReportStatus(in *ClusterReportStatus, out *v1beta1.ClusterReportStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterReportStatus_To_v1beta1_ClusterReportStatus(in, out, s) -} - -func autoConvert_v1beta1_ClusterReportStatus_To_v1alpha1_ClusterReportStatus(in *v1beta1.ClusterReportStatus, out *ClusterReportStatus, s conversion.Scope) error { - out.ReleaseReports = *(*[]ReleaseReport)(unsafe.Pointer(&in.ReleaseReports)) - out.ResourceReports = *(*[]ResourceReport)(unsafe.Pointer(&in.ResourceReports)) - out.KustomizeResourceReports = *(*[]ResourceReport)(unsafe.Pointer(&in.KustomizeResourceReports)) - return nil -} - -// Convert_v1beta1_ClusterReportStatus_To_v1alpha1_ClusterReportStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterReportStatus_To_v1alpha1_ClusterReportStatus(in *v1beta1.ClusterReportStatus, out *ClusterReportStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterReportStatus_To_v1alpha1_ClusterReportStatus(in, out, s) -} - -func autoConvert_v1alpha1_ClusterSummary_To_v1beta1_ClusterSummary(in *ClusterSummary, out *v1beta1.ClusterSummary, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_ClusterSummarySpec_To_v1beta1_ClusterSummarySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_ClusterSummaryStatus_To_v1beta1_ClusterSummaryStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_ClusterSummary_To_v1beta1_ClusterSummary is an autogenerated conversion function. -func Convert_v1alpha1_ClusterSummary_To_v1beta1_ClusterSummary(in *ClusterSummary, out *v1beta1.ClusterSummary, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterSummary_To_v1beta1_ClusterSummary(in, out, s) -} - -func autoConvert_v1beta1_ClusterSummary_To_v1alpha1_ClusterSummary(in *v1beta1.ClusterSummary, out *ClusterSummary, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterSummarySpec_To_v1alpha1_ClusterSummarySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ClusterSummaryStatus_To_v1alpha1_ClusterSummaryStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ClusterSummary_To_v1alpha1_ClusterSummary is an autogenerated conversion function. -func Convert_v1beta1_ClusterSummary_To_v1alpha1_ClusterSummary(in *v1beta1.ClusterSummary, out *ClusterSummary, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterSummary_To_v1alpha1_ClusterSummary(in, out, s) -} - -func autoConvert_v1alpha1_ClusterSummaryList_To_v1beta1_ClusterSummaryList(in *ClusterSummaryList, out *v1beta1.ClusterSummaryList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.ClusterSummary, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_ClusterSummary_To_v1beta1_ClusterSummary(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha1_ClusterSummaryList_To_v1beta1_ClusterSummaryList is an autogenerated conversion function. -func Convert_v1alpha1_ClusterSummaryList_To_v1beta1_ClusterSummaryList(in *ClusterSummaryList, out *v1beta1.ClusterSummaryList, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterSummaryList_To_v1beta1_ClusterSummaryList(in, out, s) -} - -func autoConvert_v1beta1_ClusterSummaryList_To_v1alpha1_ClusterSummaryList(in *v1beta1.ClusterSummaryList, out *ClusterSummaryList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterSummary, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ClusterSummary_To_v1alpha1_ClusterSummary(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_ClusterSummaryList_To_v1alpha1_ClusterSummaryList is an autogenerated conversion function. -func Convert_v1beta1_ClusterSummaryList_To_v1alpha1_ClusterSummaryList(in *v1beta1.ClusterSummaryList, out *ClusterSummaryList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterSummaryList_To_v1alpha1_ClusterSummaryList(in, out, s) -} - -func autoConvert_v1alpha1_ClusterSummarySpec_To_v1beta1_ClusterSummarySpec(in *ClusterSummarySpec, out *v1beta1.ClusterSummarySpec, s conversion.Scope) error { - out.ClusterNamespace = in.ClusterNamespace - out.ClusterName = in.ClusterName - out.ClusterType = apiv1beta1.ClusterType(in.ClusterType) - if err := Convert_v1alpha1_Spec_To_v1beta1_Spec(&in.ClusterProfileSpec, &out.ClusterProfileSpec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_ClusterSummarySpec_To_v1beta1_ClusterSummarySpec is an autogenerated conversion function. -func Convert_v1alpha1_ClusterSummarySpec_To_v1beta1_ClusterSummarySpec(in *ClusterSummarySpec, out *v1beta1.ClusterSummarySpec, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterSummarySpec_To_v1beta1_ClusterSummarySpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterSummarySpec_To_v1alpha1_ClusterSummarySpec(in *v1beta1.ClusterSummarySpec, out *ClusterSummarySpec, s conversion.Scope) error { - out.ClusterNamespace = in.ClusterNamespace - out.ClusterName = in.ClusterName - out.ClusterType = apiv1beta1.ClusterType(in.ClusterType) - if err := Convert_v1beta1_Spec_To_v1alpha1_Spec(&in.ClusterProfileSpec, &out.ClusterProfileSpec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ClusterSummarySpec_To_v1alpha1_ClusterSummarySpec is an autogenerated conversion function. -func Convert_v1beta1_ClusterSummarySpec_To_v1alpha1_ClusterSummarySpec(in *v1beta1.ClusterSummarySpec, out *ClusterSummarySpec, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterSummarySpec_To_v1alpha1_ClusterSummarySpec(in, out, s) -} - -func autoConvert_v1alpha1_ClusterSummaryStatus_To_v1beta1_ClusterSummaryStatus(in *ClusterSummaryStatus, out *v1beta1.ClusterSummaryStatus, s conversion.Scope) error { - out.Dependencies = (*string)(unsafe.Pointer(in.Dependencies)) - out.FeatureSummaries = *(*[]v1beta1.FeatureSummary)(unsafe.Pointer(&in.FeatureSummaries)) - out.DeployedGVKs = *(*[]v1beta1.FeatureDeploymentInfo)(unsafe.Pointer(&in.DeployedGVKs)) - out.HelmReleaseSummaries = *(*[]v1beta1.HelmChartSummary)(unsafe.Pointer(&in.HelmReleaseSummaries)) - return nil -} - -// Convert_v1alpha1_ClusterSummaryStatus_To_v1beta1_ClusterSummaryStatus is an autogenerated conversion function. -func Convert_v1alpha1_ClusterSummaryStatus_To_v1beta1_ClusterSummaryStatus(in *ClusterSummaryStatus, out *v1beta1.ClusterSummaryStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterSummaryStatus_To_v1beta1_ClusterSummaryStatus(in, out, s) -} - -func autoConvert_v1beta1_ClusterSummaryStatus_To_v1alpha1_ClusterSummaryStatus(in *v1beta1.ClusterSummaryStatus, out *ClusterSummaryStatus, s conversion.Scope) error { - out.Dependencies = (*string)(unsafe.Pointer(in.Dependencies)) - out.FeatureSummaries = *(*[]FeatureSummary)(unsafe.Pointer(&in.FeatureSummaries)) - out.DeployedGVKs = *(*[]FeatureDeploymentInfo)(unsafe.Pointer(&in.DeployedGVKs)) - out.HelmReleaseSummaries = *(*[]HelmChartSummary)(unsafe.Pointer(&in.HelmReleaseSummaries)) - return nil -} - -// Convert_v1beta1_ClusterSummaryStatus_To_v1alpha1_ClusterSummaryStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterSummaryStatus_To_v1alpha1_ClusterSummaryStatus(in *v1beta1.ClusterSummaryStatus, out *ClusterSummaryStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterSummaryStatus_To_v1alpha1_ClusterSummaryStatus(in, out, s) -} - -func autoConvert_v1alpha1_Clusters_To_v1beta1_Clusters(in *Clusters, out *v1beta1.Clusters, s conversion.Scope) error { - out.Hash = *(*[]byte)(unsafe.Pointer(&in.Hash)) - out.Clusters = *(*[]corev1.ObjectReference)(unsafe.Pointer(&in.Clusters)) - return nil -} - -// Convert_v1alpha1_Clusters_To_v1beta1_Clusters is an autogenerated conversion function. -func Convert_v1alpha1_Clusters_To_v1beta1_Clusters(in *Clusters, out *v1beta1.Clusters, s conversion.Scope) error { - return autoConvert_v1alpha1_Clusters_To_v1beta1_Clusters(in, out, s) -} - -func autoConvert_v1beta1_Clusters_To_v1alpha1_Clusters(in *v1beta1.Clusters, out *Clusters, s conversion.Scope) error { - out.Hash = *(*[]byte)(unsafe.Pointer(&in.Hash)) - out.Clusters = *(*[]corev1.ObjectReference)(unsafe.Pointer(&in.Clusters)) - return nil -} - -// Convert_v1beta1_Clusters_To_v1alpha1_Clusters is an autogenerated conversion function. -func Convert_v1beta1_Clusters_To_v1alpha1_Clusters(in *v1beta1.Clusters, out *Clusters, s conversion.Scope) error { - return autoConvert_v1beta1_Clusters_To_v1alpha1_Clusters(in, out, s) -} - -func autoConvert_v1alpha1_DryRunReconciliationError_To_v1beta1_DryRunReconciliationError(in *DryRunReconciliationError, out *v1beta1.DryRunReconciliationError, s conversion.Scope) error { - return nil -} - -// Convert_v1alpha1_DryRunReconciliationError_To_v1beta1_DryRunReconciliationError is an autogenerated conversion function. -func Convert_v1alpha1_DryRunReconciliationError_To_v1beta1_DryRunReconciliationError(in *DryRunReconciliationError, out *v1beta1.DryRunReconciliationError, s conversion.Scope) error { - return autoConvert_v1alpha1_DryRunReconciliationError_To_v1beta1_DryRunReconciliationError(in, out, s) -} - -func autoConvert_v1beta1_DryRunReconciliationError_To_v1alpha1_DryRunReconciliationError(in *v1beta1.DryRunReconciliationError, out *DryRunReconciliationError, s conversion.Scope) error { - return nil -} - -// Convert_v1beta1_DryRunReconciliationError_To_v1alpha1_DryRunReconciliationError is an autogenerated conversion function. -func Convert_v1beta1_DryRunReconciliationError_To_v1alpha1_DryRunReconciliationError(in *v1beta1.DryRunReconciliationError, out *DryRunReconciliationError, s conversion.Scope) error { - return autoConvert_v1beta1_DryRunReconciliationError_To_v1alpha1_DryRunReconciliationError(in, out, s) -} - -func autoConvert_v1alpha1_Feature_To_v1beta1_Feature(in *Feature, out *v1beta1.Feature, s conversion.Scope) error { - out.FeatureID = v1beta1.FeatureID(in.FeatureID) - out.Resources = *(*[]v1beta1.Resource)(unsafe.Pointer(&in.Resources)) - out.Charts = *(*[]v1beta1.Chart)(unsafe.Pointer(&in.Charts)) - return nil -} - -// Convert_v1alpha1_Feature_To_v1beta1_Feature is an autogenerated conversion function. -func Convert_v1alpha1_Feature_To_v1beta1_Feature(in *Feature, out *v1beta1.Feature, s conversion.Scope) error { - return autoConvert_v1alpha1_Feature_To_v1beta1_Feature(in, out, s) -} - -func autoConvert_v1beta1_Feature_To_v1alpha1_Feature(in *v1beta1.Feature, out *Feature, s conversion.Scope) error { - out.FeatureID = FeatureID(in.FeatureID) - out.Resources = *(*[]Resource)(unsafe.Pointer(&in.Resources)) - out.Charts = *(*[]Chart)(unsafe.Pointer(&in.Charts)) - return nil -} - -// Convert_v1beta1_Feature_To_v1alpha1_Feature is an autogenerated conversion function. -func Convert_v1beta1_Feature_To_v1alpha1_Feature(in *v1beta1.Feature, out *Feature, s conversion.Scope) error { - return autoConvert_v1beta1_Feature_To_v1alpha1_Feature(in, out, s) -} - -func autoConvert_v1alpha1_FeatureDeploymentInfo_To_v1beta1_FeatureDeploymentInfo(in *FeatureDeploymentInfo, out *v1beta1.FeatureDeploymentInfo, s conversion.Scope) error { - out.FeatureID = v1beta1.FeatureID(in.FeatureID) - out.DeployedGroupVersionKind = *(*[]string)(unsafe.Pointer(&in.DeployedGroupVersionKind)) - return nil -} - -// Convert_v1alpha1_FeatureDeploymentInfo_To_v1beta1_FeatureDeploymentInfo is an autogenerated conversion function. -func Convert_v1alpha1_FeatureDeploymentInfo_To_v1beta1_FeatureDeploymentInfo(in *FeatureDeploymentInfo, out *v1beta1.FeatureDeploymentInfo, s conversion.Scope) error { - return autoConvert_v1alpha1_FeatureDeploymentInfo_To_v1beta1_FeatureDeploymentInfo(in, out, s) -} - -func autoConvert_v1beta1_FeatureDeploymentInfo_To_v1alpha1_FeatureDeploymentInfo(in *v1beta1.FeatureDeploymentInfo, out *FeatureDeploymentInfo, s conversion.Scope) error { - out.FeatureID = FeatureID(in.FeatureID) - out.DeployedGroupVersionKind = *(*[]string)(unsafe.Pointer(&in.DeployedGroupVersionKind)) - return nil -} - -// Convert_v1beta1_FeatureDeploymentInfo_To_v1alpha1_FeatureDeploymentInfo is an autogenerated conversion function. -func Convert_v1beta1_FeatureDeploymentInfo_To_v1alpha1_FeatureDeploymentInfo(in *v1beta1.FeatureDeploymentInfo, out *FeatureDeploymentInfo, s conversion.Scope) error { - return autoConvert_v1beta1_FeatureDeploymentInfo_To_v1alpha1_FeatureDeploymentInfo(in, out, s) -} - -func autoConvert_v1alpha1_FeatureSummary_To_v1beta1_FeatureSummary(in *FeatureSummary, out *v1beta1.FeatureSummary, s conversion.Scope) error { - out.FeatureID = v1beta1.FeatureID(in.FeatureID) - out.Hash = *(*[]byte)(unsafe.Pointer(&in.Hash)) - out.Status = v1beta1.FeatureStatus(in.Status) - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.DeployedGroupVersionKind = *(*[]string)(unsafe.Pointer(&in.DeployedGroupVersionKind)) - out.LastAppliedTime = (*v1.Time)(unsafe.Pointer(in.LastAppliedTime)) - return nil -} - -// Convert_v1alpha1_FeatureSummary_To_v1beta1_FeatureSummary is an autogenerated conversion function. -func Convert_v1alpha1_FeatureSummary_To_v1beta1_FeatureSummary(in *FeatureSummary, out *v1beta1.FeatureSummary, s conversion.Scope) error { - return autoConvert_v1alpha1_FeatureSummary_To_v1beta1_FeatureSummary(in, out, s) -} - -func autoConvert_v1beta1_FeatureSummary_To_v1alpha1_FeatureSummary(in *v1beta1.FeatureSummary, out *FeatureSummary, s conversion.Scope) error { - out.FeatureID = FeatureID(in.FeatureID) - out.Hash = *(*[]byte)(unsafe.Pointer(&in.Hash)) - out.Status = FeatureStatus(in.Status) - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.DeployedGroupVersionKind = *(*[]string)(unsafe.Pointer(&in.DeployedGroupVersionKind)) - out.LastAppliedTime = (*v1.Time)(unsafe.Pointer(in.LastAppliedTime)) - return nil -} - -// Convert_v1beta1_FeatureSummary_To_v1alpha1_FeatureSummary is an autogenerated conversion function. -func Convert_v1beta1_FeatureSummary_To_v1alpha1_FeatureSummary(in *v1beta1.FeatureSummary, out *FeatureSummary, s conversion.Scope) error { - return autoConvert_v1beta1_FeatureSummary_To_v1alpha1_FeatureSummary(in, out, s) -} - -func autoConvert_v1alpha1_HelmChart_To_v1beta1_HelmChart(in *HelmChart, out *v1beta1.HelmChart, s conversion.Scope) error { - out.RepositoryURL = in.RepositoryURL - out.RepositoryName = in.RepositoryName - out.ChartName = in.ChartName - out.ChartVersion = in.ChartVersion - out.ReleaseName = in.ReleaseName - out.ReleaseNamespace = in.ReleaseNamespace - out.Values = in.Values - out.ValuesFrom = *(*[]v1beta1.ValueFrom)(unsafe.Pointer(&in.ValuesFrom)) - out.HelmChartAction = v1beta1.HelmChartAction(in.HelmChartAction) - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = new(v1beta1.HelmOptions) - if err := Convert_v1alpha1_HelmOptions_To_v1beta1_HelmOptions(*in, *out, s); err != nil { - return err - } - } else { - out.Options = nil - } - return nil -} - -// Convert_v1alpha1_HelmChart_To_v1beta1_HelmChart is an autogenerated conversion function. -func Convert_v1alpha1_HelmChart_To_v1beta1_HelmChart(in *HelmChart, out *v1beta1.HelmChart, s conversion.Scope) error { - return autoConvert_v1alpha1_HelmChart_To_v1beta1_HelmChart(in, out, s) -} - -func autoConvert_v1beta1_HelmChart_To_v1alpha1_HelmChart(in *v1beta1.HelmChart, out *HelmChart, s conversion.Scope) error { - out.RepositoryURL = in.RepositoryURL - out.RepositoryName = in.RepositoryName - out.ChartName = in.ChartName - out.ChartVersion = in.ChartVersion - out.ReleaseName = in.ReleaseName - out.ReleaseNamespace = in.ReleaseNamespace - out.Values = in.Values - out.ValuesFrom = *(*[]ValueFrom)(unsafe.Pointer(&in.ValuesFrom)) - out.HelmChartAction = HelmChartAction(in.HelmChartAction) - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = new(HelmOptions) - if err := Convert_v1beta1_HelmOptions_To_v1alpha1_HelmOptions(*in, *out, s); err != nil { - return err - } - } else { - out.Options = nil - } - // WARNING: in.RegistryCredentialsConfig requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha1_HelmChartSummary_To_v1beta1_HelmChartSummary(in *HelmChartSummary, out *v1beta1.HelmChartSummary, s conversion.Scope) error { - out.ReleaseName = in.ReleaseName - out.ReleaseNamespace = in.ReleaseNamespace - out.Status = v1beta1.HelmChartStatus(in.Status) - out.ValuesHash = *(*[]byte)(unsafe.Pointer(&in.ValuesHash)) - out.ConflictMessage = in.ConflictMessage - return nil -} - -// Convert_v1alpha1_HelmChartSummary_To_v1beta1_HelmChartSummary is an autogenerated conversion function. -func Convert_v1alpha1_HelmChartSummary_To_v1beta1_HelmChartSummary(in *HelmChartSummary, out *v1beta1.HelmChartSummary, s conversion.Scope) error { - return autoConvert_v1alpha1_HelmChartSummary_To_v1beta1_HelmChartSummary(in, out, s) -} - -func autoConvert_v1beta1_HelmChartSummary_To_v1alpha1_HelmChartSummary(in *v1beta1.HelmChartSummary, out *HelmChartSummary, s conversion.Scope) error { - out.ReleaseName = in.ReleaseName - out.ReleaseNamespace = in.ReleaseNamespace - out.Status = HelmChartStatus(in.Status) - out.ValuesHash = *(*[]byte)(unsafe.Pointer(&in.ValuesHash)) - out.ConflictMessage = in.ConflictMessage - return nil -} - -// Convert_v1beta1_HelmChartSummary_To_v1alpha1_HelmChartSummary is an autogenerated conversion function. -func Convert_v1beta1_HelmChartSummary_To_v1alpha1_HelmChartSummary(in *v1beta1.HelmChartSummary, out *HelmChartSummary, s conversion.Scope) error { - return autoConvert_v1beta1_HelmChartSummary_To_v1alpha1_HelmChartSummary(in, out, s) -} - -func autoConvert_v1alpha1_HelmInstallOptions_To_v1beta1_HelmInstallOptions(in *HelmInstallOptions, out *v1beta1.HelmInstallOptions, s conversion.Scope) error { - out.CreateNamespace = in.CreateNamespace - out.Replace = in.Replace - return nil -} - -// Convert_v1alpha1_HelmInstallOptions_To_v1beta1_HelmInstallOptions is an autogenerated conversion function. -func Convert_v1alpha1_HelmInstallOptions_To_v1beta1_HelmInstallOptions(in *HelmInstallOptions, out *v1beta1.HelmInstallOptions, s conversion.Scope) error { - return autoConvert_v1alpha1_HelmInstallOptions_To_v1beta1_HelmInstallOptions(in, out, s) -} - -func autoConvert_v1beta1_HelmInstallOptions_To_v1alpha1_HelmInstallOptions(in *v1beta1.HelmInstallOptions, out *HelmInstallOptions, s conversion.Scope) error { - out.CreateNamespace = in.CreateNamespace - out.Replace = in.Replace - // WARNING: in.DisableHooks requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha1_HelmOptions_To_v1beta1_HelmOptions(in *HelmOptions, out *v1beta1.HelmOptions, s conversion.Scope) error { - out.SkipCRDs = in.SkipCRDs - out.SkipSchemaValidation = in.SkipSchemaValidation - out.Wait = in.Wait - out.WaitForJobs = in.WaitForJobs - out.Timeout = (*v1.Duration)(unsafe.Pointer(in.Timeout)) - out.DisableHooks = in.DisableHooks - out.DisableOpenAPIValidation = in.DisableOpenAPIValidation - out.Atomic = in.Atomic - out.DependencyUpdate = in.DependencyUpdate - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.EnableClientCache = in.EnableClientCache - out.Description = in.Description - if err := Convert_v1alpha1_HelmInstallOptions_To_v1beta1_HelmInstallOptions(&in.InstallOptions, &out.InstallOptions, s); err != nil { - return err - } - if err := Convert_v1alpha1_HelmUpgradeOptions_To_v1beta1_HelmUpgradeOptions(&in.UpgradeOptions, &out.UpgradeOptions, s); err != nil { - return err - } - if err := Convert_v1alpha1_HelmUninstallOptions_To_v1beta1_HelmUninstallOptions(&in.UninstallOptions, &out.UninstallOptions, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_HelmOptions_To_v1beta1_HelmOptions is an autogenerated conversion function. -func Convert_v1alpha1_HelmOptions_To_v1beta1_HelmOptions(in *HelmOptions, out *v1beta1.HelmOptions, s conversion.Scope) error { - return autoConvert_v1alpha1_HelmOptions_To_v1beta1_HelmOptions(in, out, s) -} - -func autoConvert_v1beta1_HelmOptions_To_v1alpha1_HelmOptions(in *v1beta1.HelmOptions, out *HelmOptions, s conversion.Scope) error { - out.SkipCRDs = in.SkipCRDs - out.SkipSchemaValidation = in.SkipSchemaValidation - out.Wait = in.Wait - out.WaitForJobs = in.WaitForJobs - out.Timeout = (*v1.Duration)(unsafe.Pointer(in.Timeout)) - out.DisableHooks = in.DisableHooks - out.DisableOpenAPIValidation = in.DisableOpenAPIValidation - out.Atomic = in.Atomic - out.DependencyUpdate = in.DependencyUpdate - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.EnableClientCache = in.EnableClientCache - out.Description = in.Description - if err := Convert_v1beta1_HelmInstallOptions_To_v1alpha1_HelmInstallOptions(&in.InstallOptions, &out.InstallOptions, s); err != nil { - return err - } - if err := Convert_v1beta1_HelmUpgradeOptions_To_v1alpha1_HelmUpgradeOptions(&in.UpgradeOptions, &out.UpgradeOptions, s); err != nil { - return err - } - if err := Convert_v1beta1_HelmUninstallOptions_To_v1alpha1_HelmUninstallOptions(&in.UninstallOptions, &out.UninstallOptions, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_HelmOptions_To_v1alpha1_HelmOptions is an autogenerated conversion function. -func Convert_v1beta1_HelmOptions_To_v1alpha1_HelmOptions(in *v1beta1.HelmOptions, out *HelmOptions, s conversion.Scope) error { - return autoConvert_v1beta1_HelmOptions_To_v1alpha1_HelmOptions(in, out, s) -} - -func autoConvert_v1alpha1_HelmUninstallOptions_To_v1beta1_HelmUninstallOptions(in *HelmUninstallOptions, out *v1beta1.HelmUninstallOptions, s conversion.Scope) error { - out.KeepHistory = in.KeepHistory - out.DeletionPropagation = in.DeletionPropagation - return nil -} - -// Convert_v1alpha1_HelmUninstallOptions_To_v1beta1_HelmUninstallOptions is an autogenerated conversion function. -func Convert_v1alpha1_HelmUninstallOptions_To_v1beta1_HelmUninstallOptions(in *HelmUninstallOptions, out *v1beta1.HelmUninstallOptions, s conversion.Scope) error { - return autoConvert_v1alpha1_HelmUninstallOptions_To_v1beta1_HelmUninstallOptions(in, out, s) -} - -func autoConvert_v1beta1_HelmUninstallOptions_To_v1alpha1_HelmUninstallOptions(in *v1beta1.HelmUninstallOptions, out *HelmUninstallOptions, s conversion.Scope) error { - out.KeepHistory = in.KeepHistory - out.DeletionPropagation = in.DeletionPropagation - // WARNING: in.DisableHooks requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha1_HelmUpgradeOptions_To_v1beta1_HelmUpgradeOptions(in *HelmUpgradeOptions, out *v1beta1.HelmUpgradeOptions, s conversion.Scope) error { - out.Force = in.Force - out.ResetValues = in.ResetValues - out.ReuseValues = in.ReuseValues - out.ResetThenReuseValues = in.ResetThenReuseValues - out.Recreate = in.Recreate - out.MaxHistory = in.MaxHistory - out.CleanupOnFail = in.CleanupOnFail - out.SubNotes = in.SubNotes - out.UpgradeCRDs = in.UpgradeCRDs - return nil -} - -// Convert_v1alpha1_HelmUpgradeOptions_To_v1beta1_HelmUpgradeOptions is an autogenerated conversion function. -func Convert_v1alpha1_HelmUpgradeOptions_To_v1beta1_HelmUpgradeOptions(in *HelmUpgradeOptions, out *v1beta1.HelmUpgradeOptions, s conversion.Scope) error { - return autoConvert_v1alpha1_HelmUpgradeOptions_To_v1beta1_HelmUpgradeOptions(in, out, s) -} - -func autoConvert_v1beta1_HelmUpgradeOptions_To_v1alpha1_HelmUpgradeOptions(in *v1beta1.HelmUpgradeOptions, out *HelmUpgradeOptions, s conversion.Scope) error { - out.Force = in.Force - out.ResetValues = in.ResetValues - out.ReuseValues = in.ReuseValues - out.ResetThenReuseValues = in.ResetThenReuseValues - out.Recreate = in.Recreate - out.MaxHistory = in.MaxHistory - out.CleanupOnFail = in.CleanupOnFail - out.SubNotes = in.SubNotes - out.UpgradeCRDs = in.UpgradeCRDs - // WARNING: in.DisableHooks requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha1_KustomizationRef_To_v1beta1_KustomizationRef(in *KustomizationRef, out *v1beta1.KustomizationRef, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.Kind = in.Kind - out.Path = in.Path - out.TargetNamespace = in.TargetNamespace - out.DeploymentType = v1beta1.DeploymentType(in.DeploymentType) - out.Values = *(*map[string]string)(unsafe.Pointer(&in.Values)) - out.ValuesFrom = *(*[]v1beta1.ValueFrom)(unsafe.Pointer(&in.ValuesFrom)) - return nil -} - -// Convert_v1alpha1_KustomizationRef_To_v1beta1_KustomizationRef is an autogenerated conversion function. -func Convert_v1alpha1_KustomizationRef_To_v1beta1_KustomizationRef(in *KustomizationRef, out *v1beta1.KustomizationRef, s conversion.Scope) error { - return autoConvert_v1alpha1_KustomizationRef_To_v1beta1_KustomizationRef(in, out, s) -} - -func autoConvert_v1beta1_KustomizationRef_To_v1alpha1_KustomizationRef(in *v1beta1.KustomizationRef, out *KustomizationRef, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.Kind = in.Kind - out.Path = in.Path - out.TargetNamespace = in.TargetNamespace - out.DeploymentType = DeploymentType(in.DeploymentType) - out.Values = *(*map[string]string)(unsafe.Pointer(&in.Values)) - out.ValuesFrom = *(*[]ValueFrom)(unsafe.Pointer(&in.ValuesFrom)) - return nil -} - -// Convert_v1beta1_KustomizationRef_To_v1alpha1_KustomizationRef is an autogenerated conversion function. -func Convert_v1beta1_KustomizationRef_To_v1alpha1_KustomizationRef(in *v1beta1.KustomizationRef, out *KustomizationRef, s conversion.Scope) error { - return autoConvert_v1beta1_KustomizationRef_To_v1alpha1_KustomizationRef(in, out, s) -} - -func autoConvert_v1alpha1_PolicyRef_To_v1beta1_PolicyRef(in *PolicyRef, out *v1beta1.PolicyRef, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.Kind = in.Kind - out.Path = in.Path - out.DeploymentType = v1beta1.DeploymentType(in.DeploymentType) - return nil -} - -// Convert_v1alpha1_PolicyRef_To_v1beta1_PolicyRef is an autogenerated conversion function. -func Convert_v1alpha1_PolicyRef_To_v1beta1_PolicyRef(in *PolicyRef, out *v1beta1.PolicyRef, s conversion.Scope) error { - return autoConvert_v1alpha1_PolicyRef_To_v1beta1_PolicyRef(in, out, s) -} - -func autoConvert_v1beta1_PolicyRef_To_v1alpha1_PolicyRef(in *v1beta1.PolicyRef, out *PolicyRef, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.Kind = in.Kind - out.Path = in.Path - out.DeploymentType = DeploymentType(in.DeploymentType) - return nil -} - -// Convert_v1beta1_PolicyRef_To_v1alpha1_PolicyRef is an autogenerated conversion function. -func Convert_v1beta1_PolicyRef_To_v1alpha1_PolicyRef(in *v1beta1.PolicyRef, out *PolicyRef, s conversion.Scope) error { - return autoConvert_v1beta1_PolicyRef_To_v1alpha1_PolicyRef(in, out, s) -} - -func autoConvert_v1alpha1_Profile_To_v1beta1_Profile(in *Profile, out *v1beta1.Profile, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_Spec_To_v1beta1_Spec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_Status_To_v1beta1_Status(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_Profile_To_v1beta1_Profile is an autogenerated conversion function. -func Convert_v1alpha1_Profile_To_v1beta1_Profile(in *Profile, out *v1beta1.Profile, s conversion.Scope) error { - return autoConvert_v1alpha1_Profile_To_v1beta1_Profile(in, out, s) -} - -func autoConvert_v1beta1_Profile_To_v1alpha1_Profile(in *v1beta1.Profile, out *Profile, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_Spec_To_v1alpha1_Spec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_Status_To_v1alpha1_Status(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Profile_To_v1alpha1_Profile is an autogenerated conversion function. -func Convert_v1beta1_Profile_To_v1alpha1_Profile(in *v1beta1.Profile, out *Profile, s conversion.Scope) error { - return autoConvert_v1beta1_Profile_To_v1alpha1_Profile(in, out, s) -} - -func autoConvert_v1alpha1_ProfileList_To_v1beta1_ProfileList(in *ProfileList, out *v1beta1.ProfileList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.Profile, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_Profile_To_v1beta1_Profile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha1_ProfileList_To_v1beta1_ProfileList is an autogenerated conversion function. -func Convert_v1alpha1_ProfileList_To_v1beta1_ProfileList(in *ProfileList, out *v1beta1.ProfileList, s conversion.Scope) error { - return autoConvert_v1alpha1_ProfileList_To_v1beta1_ProfileList(in, out, s) -} - -func autoConvert_v1beta1_ProfileList_To_v1alpha1_ProfileList(in *v1beta1.ProfileList, out *ProfileList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Profile, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Profile_To_v1alpha1_Profile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_ProfileList_To_v1alpha1_ProfileList is an autogenerated conversion function. -func Convert_v1beta1_ProfileList_To_v1alpha1_ProfileList(in *v1beta1.ProfileList, out *ProfileList, s conversion.Scope) error { - return autoConvert_v1beta1_ProfileList_To_v1alpha1_ProfileList(in, out, s) -} - -func autoConvert_v1alpha1_ProfileResource_To_v1beta1_ProfileResource(in *ProfileResource, out *v1beta1.ProfileResource, s conversion.Scope) error { - out.ProfileName = in.ProfileName - out.Features = *(*[]v1beta1.Feature)(unsafe.Pointer(&in.Features)) - return nil -} - -// Convert_v1alpha1_ProfileResource_To_v1beta1_ProfileResource is an autogenerated conversion function. -func Convert_v1alpha1_ProfileResource_To_v1beta1_ProfileResource(in *ProfileResource, out *v1beta1.ProfileResource, s conversion.Scope) error { - return autoConvert_v1alpha1_ProfileResource_To_v1beta1_ProfileResource(in, out, s) -} - -func autoConvert_v1beta1_ProfileResource_To_v1alpha1_ProfileResource(in *v1beta1.ProfileResource, out *ProfileResource, s conversion.Scope) error { - out.ProfileName = in.ProfileName - out.Features = *(*[]Feature)(unsafe.Pointer(&in.Features)) - return nil -} - -// Convert_v1beta1_ProfileResource_To_v1alpha1_ProfileResource is an autogenerated conversion function. -func Convert_v1beta1_ProfileResource_To_v1alpha1_ProfileResource(in *v1beta1.ProfileResource, out *ProfileResource, s conversion.Scope) error { - return autoConvert_v1beta1_ProfileResource_To_v1alpha1_ProfileResource(in, out, s) -} - -func autoConvert_v1alpha1_ReleaseReport_To_v1beta1_ReleaseReport(in *ReleaseReport, out *v1beta1.ReleaseReport, s conversion.Scope) error { - out.ReleaseName = in.ReleaseName - out.ReleaseNamespace = in.ReleaseNamespace - out.ChartVersion = in.ChartVersion - out.Action = in.Action - out.Message = in.Message - return nil -} - -// Convert_v1alpha1_ReleaseReport_To_v1beta1_ReleaseReport is an autogenerated conversion function. -func Convert_v1alpha1_ReleaseReport_To_v1beta1_ReleaseReport(in *ReleaseReport, out *v1beta1.ReleaseReport, s conversion.Scope) error { - return autoConvert_v1alpha1_ReleaseReport_To_v1beta1_ReleaseReport(in, out, s) -} - -func autoConvert_v1beta1_ReleaseReport_To_v1alpha1_ReleaseReport(in *v1beta1.ReleaseReport, out *ReleaseReport, s conversion.Scope) error { - out.ReleaseName = in.ReleaseName - out.ReleaseNamespace = in.ReleaseNamespace - out.ChartVersion = in.ChartVersion - out.Action = in.Action - out.Message = in.Message - return nil -} - -// Convert_v1beta1_ReleaseReport_To_v1alpha1_ReleaseReport is an autogenerated conversion function. -func Convert_v1beta1_ReleaseReport_To_v1alpha1_ReleaseReport(in *v1beta1.ReleaseReport, out *ReleaseReport, s conversion.Scope) error { - return autoConvert_v1beta1_ReleaseReport_To_v1alpha1_ReleaseReport(in, out, s) -} - -func autoConvert_v1alpha1_Resource_To_v1beta1_Resource(in *Resource, out *v1beta1.Resource, s conversion.Scope) error { - out.Name = in.Name - out.Namespace = in.Namespace - out.Group = in.Group - out.Kind = in.Kind - out.Version = in.Version - out.LastAppliedTime = (*v1.Time)(unsafe.Pointer(in.LastAppliedTime)) - out.Owner = in.Owner - out.IgnoreForConfigurationDrift = in.IgnoreForConfigurationDrift - return nil -} - -// Convert_v1alpha1_Resource_To_v1beta1_Resource is an autogenerated conversion function. -func Convert_v1alpha1_Resource_To_v1beta1_Resource(in *Resource, out *v1beta1.Resource, s conversion.Scope) error { - return autoConvert_v1alpha1_Resource_To_v1beta1_Resource(in, out, s) -} - -func autoConvert_v1beta1_Resource_To_v1alpha1_Resource(in *v1beta1.Resource, out *Resource, s conversion.Scope) error { - out.Name = in.Name - out.Namespace = in.Namespace - out.Group = in.Group - out.Kind = in.Kind - out.Version = in.Version - out.LastAppliedTime = (*v1.Time)(unsafe.Pointer(in.LastAppliedTime)) - out.Owner = in.Owner - out.IgnoreForConfigurationDrift = in.IgnoreForConfigurationDrift - return nil -} - -// Convert_v1beta1_Resource_To_v1alpha1_Resource is an autogenerated conversion function. -func Convert_v1beta1_Resource_To_v1alpha1_Resource(in *v1beta1.Resource, out *Resource, s conversion.Scope) error { - return autoConvert_v1beta1_Resource_To_v1alpha1_Resource(in, out, s) -} - -func autoConvert_v1alpha1_ResourceReport_To_v1beta1_ResourceReport(in *ResourceReport, out *v1beta1.ResourceReport, s conversion.Scope) error { - if err := Convert_v1alpha1_Resource_To_v1beta1_Resource(&in.Resource, &out.Resource, s); err != nil { - return err - } - out.Action = in.Action - out.Message = in.Message - return nil -} - -// Convert_v1alpha1_ResourceReport_To_v1beta1_ResourceReport is an autogenerated conversion function. -func Convert_v1alpha1_ResourceReport_To_v1beta1_ResourceReport(in *ResourceReport, out *v1beta1.ResourceReport, s conversion.Scope) error { - return autoConvert_v1alpha1_ResourceReport_To_v1beta1_ResourceReport(in, out, s) -} - -func autoConvert_v1beta1_ResourceReport_To_v1alpha1_ResourceReport(in *v1beta1.ResourceReport, out *ResourceReport, s conversion.Scope) error { - if err := Convert_v1beta1_Resource_To_v1alpha1_Resource(&in.Resource, &out.Resource, s); err != nil { - return err - } - out.Action = in.Action - out.Message = in.Message - return nil -} - -// Convert_v1beta1_ResourceReport_To_v1alpha1_ResourceReport is an autogenerated conversion function. -func Convert_v1beta1_ResourceReport_To_v1alpha1_ResourceReport(in *v1beta1.ResourceReport, out *ResourceReport, s conversion.Scope) error { - return autoConvert_v1beta1_ResourceReport_To_v1alpha1_ResourceReport(in, out, s) -} - -func autoConvert_v1alpha1_Spec_To_v1beta1_Spec(in *Spec, out *v1beta1.Spec, s conversion.Scope) error { - // WARNING: in.ClusterSelector requires manual conversion: inconvertible types (github.com/projectsveltos/libsveltos/api/v1alpha1.Selector vs github.com/projectsveltos/libsveltos/api/v1beta1.Selector) - out.ClusterRefs = *(*[]corev1.ObjectReference)(unsafe.Pointer(&in.ClusterRefs)) - out.SetRefs = *(*[]string)(unsafe.Pointer(&in.SetRefs)) - out.SyncMode = v1beta1.SyncMode(in.SyncMode) - out.Tier = in.Tier - out.ContinueOnConflict = in.ContinueOnConflict - out.MaxUpdate = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUpdate)) - out.StopMatchingBehavior = v1beta1.StopMatchingBehavior(in.StopMatchingBehavior) - out.Reloader = in.Reloader - out.TemplateResourceRefs = *(*[]v1beta1.TemplateResourceRef)(unsafe.Pointer(&in.TemplateResourceRefs)) - out.DependsOn = *(*[]string)(unsafe.Pointer(&in.DependsOn)) - out.PolicyRefs = *(*[]v1beta1.PolicyRef)(unsafe.Pointer(&in.PolicyRefs)) - if in.HelmCharts != nil { - in, out := &in.HelmCharts, &out.HelmCharts - *out = make([]v1beta1.HelmChart, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_HelmChart_To_v1beta1_HelmChart(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.HelmCharts = nil - } - out.KustomizationRefs = *(*[]v1beta1.KustomizationRef)(unsafe.Pointer(&in.KustomizationRefs)) - out.ValidateHealths = *(*[]v1beta1.ValidateHealth)(unsafe.Pointer(&in.ValidateHealths)) - out.ExtraLabels = *(*map[string]string)(unsafe.Pointer(&in.ExtraLabels)) - out.ExtraAnnotations = *(*map[string]string)(unsafe.Pointer(&in.ExtraAnnotations)) - return nil -} - -func autoConvert_v1beta1_Spec_To_v1alpha1_Spec(in *v1beta1.Spec, out *Spec, s conversion.Scope) error { - // WARNING: in.ClusterSelector requires manual conversion: inconvertible types (github.com/projectsveltos/libsveltos/api/v1beta1.Selector vs github.com/projectsveltos/libsveltos/api/v1alpha1.Selector) - out.ClusterRefs = *(*[]corev1.ObjectReference)(unsafe.Pointer(&in.ClusterRefs)) - out.SetRefs = *(*[]string)(unsafe.Pointer(&in.SetRefs)) - out.SyncMode = SyncMode(in.SyncMode) - out.Tier = in.Tier - out.ContinueOnConflict = in.ContinueOnConflict - // WARNING: in.ContinueOnError requires manual conversion: does not exist in peer-type - out.MaxUpdate = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUpdate)) - out.StopMatchingBehavior = StopMatchingBehavior(in.StopMatchingBehavior) - out.Reloader = in.Reloader - out.TemplateResourceRefs = *(*[]TemplateResourceRef)(unsafe.Pointer(&in.TemplateResourceRefs)) - out.DependsOn = *(*[]string)(unsafe.Pointer(&in.DependsOn)) - out.PolicyRefs = *(*[]PolicyRef)(unsafe.Pointer(&in.PolicyRefs)) - if in.HelmCharts != nil { - in, out := &in.HelmCharts, &out.HelmCharts - *out = make([]HelmChart, len(*in)) - for i := range *in { - if err := Convert_v1beta1_HelmChart_To_v1alpha1_HelmChart(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.HelmCharts = nil - } - out.KustomizationRefs = *(*[]KustomizationRef)(unsafe.Pointer(&in.KustomizationRefs)) - out.ValidateHealths = *(*[]ValidateHealth)(unsafe.Pointer(&in.ValidateHealths)) - // WARNING: in.Patches requires manual conversion: does not exist in peer-type - // WARNING: in.DriftExclusions requires manual conversion: does not exist in peer-type - // WARNING: in.MaxConsecutiveFailures requires manual conversion: does not exist in peer-type - out.ExtraLabels = *(*map[string]string)(unsafe.Pointer(&in.ExtraLabels)) - out.ExtraAnnotations = *(*map[string]string)(unsafe.Pointer(&in.ExtraAnnotations)) - return nil -} - -func autoConvert_v1alpha1_Status_To_v1beta1_Status(in *Status, out *v1beta1.Status, s conversion.Scope) error { - out.MatchingClusterRefs = *(*[]corev1.ObjectReference)(unsafe.Pointer(&in.MatchingClusterRefs)) - if err := Convert_v1alpha1_Clusters_To_v1beta1_Clusters(&in.UpdatingClusters, &out.UpdatingClusters, s); err != nil { - return err - } - if err := Convert_v1alpha1_Clusters_To_v1beta1_Clusters(&in.UpdatedClusters, &out.UpdatedClusters, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_Status_To_v1beta1_Status is an autogenerated conversion function. -func Convert_v1alpha1_Status_To_v1beta1_Status(in *Status, out *v1beta1.Status, s conversion.Scope) error { - return autoConvert_v1alpha1_Status_To_v1beta1_Status(in, out, s) -} - -func autoConvert_v1beta1_Status_To_v1alpha1_Status(in *v1beta1.Status, out *Status, s conversion.Scope) error { - out.MatchingClusterRefs = *(*[]corev1.ObjectReference)(unsafe.Pointer(&in.MatchingClusterRefs)) - if err := Convert_v1beta1_Clusters_To_v1alpha1_Clusters(&in.UpdatingClusters, &out.UpdatingClusters, s); err != nil { - return err - } - if err := Convert_v1beta1_Clusters_To_v1alpha1_Clusters(&in.UpdatedClusters, &out.UpdatedClusters, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Status_To_v1alpha1_Status is an autogenerated conversion function. -func Convert_v1beta1_Status_To_v1alpha1_Status(in *v1beta1.Status, out *Status, s conversion.Scope) error { - return autoConvert_v1beta1_Status_To_v1alpha1_Status(in, out, s) -} - -func autoConvert_v1alpha1_TemplateResourceRef_To_v1beta1_TemplateResourceRef(in *TemplateResourceRef, out *v1beta1.TemplateResourceRef, s conversion.Scope) error { - out.Resource = in.Resource - out.Identifier = in.Identifier - return nil -} - -// Convert_v1alpha1_TemplateResourceRef_To_v1beta1_TemplateResourceRef is an autogenerated conversion function. -func Convert_v1alpha1_TemplateResourceRef_To_v1beta1_TemplateResourceRef(in *TemplateResourceRef, out *v1beta1.TemplateResourceRef, s conversion.Scope) error { - return autoConvert_v1alpha1_TemplateResourceRef_To_v1beta1_TemplateResourceRef(in, out, s) -} - -func autoConvert_v1beta1_TemplateResourceRef_To_v1alpha1_TemplateResourceRef(in *v1beta1.TemplateResourceRef, out *TemplateResourceRef, s conversion.Scope) error { - out.Resource = in.Resource - out.Identifier = in.Identifier - return nil -} - -// Convert_v1beta1_TemplateResourceRef_To_v1alpha1_TemplateResourceRef is an autogenerated conversion function. -func Convert_v1beta1_TemplateResourceRef_To_v1alpha1_TemplateResourceRef(in *v1beta1.TemplateResourceRef, out *TemplateResourceRef, s conversion.Scope) error { - return autoConvert_v1beta1_TemplateResourceRef_To_v1alpha1_TemplateResourceRef(in, out, s) -} - -func autoConvert_v1alpha1_ValidateHealth_To_v1beta1_ValidateHealth(in *ValidateHealth, out *v1beta1.ValidateHealth, s conversion.Scope) error { - out.Name = in.Name - out.FeatureID = v1beta1.FeatureID(in.FeatureID) - out.Group = in.Group - out.Version = in.Version - out.Kind = in.Kind - out.LabelFilters = *(*[]apiv1beta1.LabelFilter)(unsafe.Pointer(&in.LabelFilters)) - out.Namespace = in.Namespace - out.Script = in.Script - return nil -} - -// Convert_v1alpha1_ValidateHealth_To_v1beta1_ValidateHealth is an autogenerated conversion function. -func Convert_v1alpha1_ValidateHealth_To_v1beta1_ValidateHealth(in *ValidateHealth, out *v1beta1.ValidateHealth, s conversion.Scope) error { - return autoConvert_v1alpha1_ValidateHealth_To_v1beta1_ValidateHealth(in, out, s) -} - -func autoConvert_v1beta1_ValidateHealth_To_v1alpha1_ValidateHealth(in *v1beta1.ValidateHealth, out *ValidateHealth, s conversion.Scope) error { - out.Name = in.Name - out.FeatureID = FeatureID(in.FeatureID) - out.Group = in.Group - out.Version = in.Version - out.Kind = in.Kind - out.LabelFilters = *(*[]apiv1alpha1.LabelFilter)(unsafe.Pointer(&in.LabelFilters)) - out.Namespace = in.Namespace - out.Script = in.Script - return nil -} - -// Convert_v1beta1_ValidateHealth_To_v1alpha1_ValidateHealth is an autogenerated conversion function. -func Convert_v1beta1_ValidateHealth_To_v1alpha1_ValidateHealth(in *v1beta1.ValidateHealth, out *ValidateHealth, s conversion.Scope) error { - return autoConvert_v1beta1_ValidateHealth_To_v1alpha1_ValidateHealth(in, out, s) -} - -func autoConvert_v1alpha1_ValueFrom_To_v1beta1_ValueFrom(in *ValueFrom, out *v1beta1.ValueFrom, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.Kind = in.Kind - return nil -} - -// Convert_v1alpha1_ValueFrom_To_v1beta1_ValueFrom is an autogenerated conversion function. -func Convert_v1alpha1_ValueFrom_To_v1beta1_ValueFrom(in *ValueFrom, out *v1beta1.ValueFrom, s conversion.Scope) error { - return autoConvert_v1alpha1_ValueFrom_To_v1beta1_ValueFrom(in, out, s) -} - -func autoConvert_v1beta1_ValueFrom_To_v1alpha1_ValueFrom(in *v1beta1.ValueFrom, out *ValueFrom, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.Kind = in.Kind - return nil -} - -// Convert_v1beta1_ValueFrom_To_v1alpha1_ValueFrom is an autogenerated conversion function. -func Convert_v1beta1_ValueFrom_To_v1alpha1_ValueFrom(in *v1beta1.ValueFrom, out *ValueFrom, s conversion.Scope) error { - return autoConvert_v1beta1_ValueFrom_To_v1alpha1_ValueFrom(in, out, s) -} diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index efa4ed5d..00000000 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,1016 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright 2024. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/intstr" - - apiv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Chart) DeepCopyInto(out *Chart) { - *out = *in - if in.LastAppliedTime != nil { - in, out := &in.LastAppliedTime, &out.LastAppliedTime - *out = (*in).DeepCopy() - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Chart. -func (in *Chart) DeepCopy() *Chart { - if in == nil { - return nil - } - out := new(Chart) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterConfiguration) DeepCopyInto(out *ClusterConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfiguration. -func (in *ClusterConfiguration) DeepCopy() *ClusterConfiguration { - if in == nil { - return nil - } - out := new(ClusterConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterConfiguration) 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 *ClusterConfigurationList) DeepCopyInto(out *ClusterConfigurationList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterConfiguration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigurationList. -func (in *ClusterConfigurationList) DeepCopy() *ClusterConfigurationList { - if in == nil { - return nil - } - out := new(ClusterConfigurationList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterConfigurationList) 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 *ClusterConfigurationStatus) DeepCopyInto(out *ClusterConfigurationStatus) { - *out = *in - if in.ClusterProfileResources != nil { - in, out := &in.ClusterProfileResources, &out.ClusterProfileResources - *out = make([]ClusterProfileResource, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ProfileResources != nil { - in, out := &in.ProfileResources, &out.ProfileResources - *out = make([]ProfileResource, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigurationStatus. -func (in *ClusterConfigurationStatus) DeepCopy() *ClusterConfigurationStatus { - if in == nil { - return nil - } - out := new(ClusterConfigurationStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterProfile) DeepCopyInto(out *ClusterProfile) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfile. -func (in *ClusterProfile) DeepCopy() *ClusterProfile { - if in == nil { - return nil - } - out := new(ClusterProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterProfile) 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 *ClusterProfileList) DeepCopyInto(out *ClusterProfileList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterProfile, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfileList. -func (in *ClusterProfileList) DeepCopy() *ClusterProfileList { - if in == nil { - return nil - } - out := new(ClusterProfileList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterProfileList) 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 *ClusterProfileResource) DeepCopyInto(out *ClusterProfileResource) { - *out = *in - if in.Features != nil { - in, out := &in.Features, &out.Features - *out = make([]Feature, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfileResource. -func (in *ClusterProfileResource) DeepCopy() *ClusterProfileResource { - if in == nil { - return nil - } - out := new(ClusterProfileResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterReport) DeepCopyInto(out *ClusterReport) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterReport. -func (in *ClusterReport) DeepCopy() *ClusterReport { - if in == nil { - return nil - } - out := new(ClusterReport) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterReport) 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 *ClusterReportList) DeepCopyInto(out *ClusterReportList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterReport, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterReportList. -func (in *ClusterReportList) DeepCopy() *ClusterReportList { - if in == nil { - return nil - } - out := new(ClusterReportList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterReportList) 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 *ClusterReportSpec) DeepCopyInto(out *ClusterReportSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterReportSpec. -func (in *ClusterReportSpec) DeepCopy() *ClusterReportSpec { - if in == nil { - return nil - } - out := new(ClusterReportSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterReportStatus) DeepCopyInto(out *ClusterReportStatus) { - *out = *in - if in.ReleaseReports != nil { - in, out := &in.ReleaseReports, &out.ReleaseReports - *out = make([]ReleaseReport, len(*in)) - copy(*out, *in) - } - if in.ResourceReports != nil { - in, out := &in.ResourceReports, &out.ResourceReports - *out = make([]ResourceReport, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.KustomizeResourceReports != nil { - in, out := &in.KustomizeResourceReports, &out.KustomizeResourceReports - *out = make([]ResourceReport, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterReportStatus. -func (in *ClusterReportStatus) DeepCopy() *ClusterReportStatus { - if in == nil { - return nil - } - out := new(ClusterReportStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSummary) DeepCopyInto(out *ClusterSummary) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSummary. -func (in *ClusterSummary) DeepCopy() *ClusterSummary { - if in == nil { - return nil - } - out := new(ClusterSummary) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterSummary) 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 *ClusterSummaryList) DeepCopyInto(out *ClusterSummaryList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterSummary, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSummaryList. -func (in *ClusterSummaryList) DeepCopy() *ClusterSummaryList { - if in == nil { - return nil - } - out := new(ClusterSummaryList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterSummaryList) 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 *ClusterSummarySpec) DeepCopyInto(out *ClusterSummarySpec) { - *out = *in - in.ClusterProfileSpec.DeepCopyInto(&out.ClusterProfileSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSummarySpec. -func (in *ClusterSummarySpec) DeepCopy() *ClusterSummarySpec { - if in == nil { - return nil - } - out := new(ClusterSummarySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSummaryStatus) DeepCopyInto(out *ClusterSummaryStatus) { - *out = *in - if in.Dependencies != nil { - in, out := &in.Dependencies, &out.Dependencies - *out = new(string) - **out = **in - } - if in.FeatureSummaries != nil { - in, out := &in.FeatureSummaries, &out.FeatureSummaries - *out = make([]FeatureSummary, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.DeployedGVKs != nil { - in, out := &in.DeployedGVKs, &out.DeployedGVKs - *out = make([]FeatureDeploymentInfo, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.HelmReleaseSummaries != nil { - in, out := &in.HelmReleaseSummaries, &out.HelmReleaseSummaries - *out = make([]HelmChartSummary, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSummaryStatus. -func (in *ClusterSummaryStatus) DeepCopy() *ClusterSummaryStatus { - if in == nil { - return nil - } - out := new(ClusterSummaryStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Clusters) DeepCopyInto(out *Clusters) { - *out = *in - if in.Hash != nil { - in, out := &in.Hash, &out.Hash - *out = make([]byte, len(*in)) - copy(*out, *in) - } - if in.Clusters != nil { - in, out := &in.Clusters, &out.Clusters - *out = make([]corev1.ObjectReference, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Clusters. -func (in *Clusters) DeepCopy() *Clusters { - if in == nil { - return nil - } - out := new(Clusters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DryRunReconciliationError) DeepCopyInto(out *DryRunReconciliationError) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DryRunReconciliationError. -func (in *DryRunReconciliationError) DeepCopy() *DryRunReconciliationError { - if in == nil { - return nil - } - out := new(DryRunReconciliationError) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Feature) DeepCopyInto(out *Feature) { - *out = *in - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]Resource, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Charts != nil { - in, out := &in.Charts, &out.Charts - *out = make([]Chart, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Feature. -func (in *Feature) DeepCopy() *Feature { - if in == nil { - return nil - } - out := new(Feature) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeatureDeploymentInfo) DeepCopyInto(out *FeatureDeploymentInfo) { - *out = *in - if in.DeployedGroupVersionKind != nil { - in, out := &in.DeployedGroupVersionKind, &out.DeployedGroupVersionKind - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureDeploymentInfo. -func (in *FeatureDeploymentInfo) DeepCopy() *FeatureDeploymentInfo { - if in == nil { - return nil - } - out := new(FeatureDeploymentInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeatureSummary) DeepCopyInto(out *FeatureSummary) { - *out = *in - if in.Hash != nil { - in, out := &in.Hash, &out.Hash - *out = make([]byte, len(*in)) - copy(*out, *in) - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(string) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.DeployedGroupVersionKind != nil { - in, out := &in.DeployedGroupVersionKind, &out.DeployedGroupVersionKind - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.LastAppliedTime != nil { - in, out := &in.LastAppliedTime, &out.LastAppliedTime - *out = (*in).DeepCopy() - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureSummary. -func (in *FeatureSummary) DeepCopy() *FeatureSummary { - if in == nil { - return nil - } - out := new(FeatureSummary) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HelmChart) DeepCopyInto(out *HelmChart) { - *out = *in - if in.ValuesFrom != nil { - in, out := &in.ValuesFrom, &out.ValuesFrom - *out = make([]ValueFrom, len(*in)) - copy(*out, *in) - } - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = new(HelmOptions) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChart. -func (in *HelmChart) DeepCopy() *HelmChart { - if in == nil { - return nil - } - out := new(HelmChart) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HelmChartSummary) DeepCopyInto(out *HelmChartSummary) { - *out = *in - if in.ValuesHash != nil { - in, out := &in.ValuesHash, &out.ValuesHash - *out = make([]byte, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartSummary. -func (in *HelmChartSummary) DeepCopy() *HelmChartSummary { - if in == nil { - return nil - } - out := new(HelmChartSummary) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HelmInstallOptions) DeepCopyInto(out *HelmInstallOptions) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmInstallOptions. -func (in *HelmInstallOptions) DeepCopy() *HelmInstallOptions { - if in == nil { - return nil - } - out := new(HelmInstallOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HelmOptions) DeepCopyInto(out *HelmOptions) { - *out = *in - if in.Timeout != nil { - in, out := &in.Timeout, &out.Timeout - *out = new(v1.Duration) - **out = **in - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - out.InstallOptions = in.InstallOptions - out.UpgradeOptions = in.UpgradeOptions - out.UninstallOptions = in.UninstallOptions -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmOptions. -func (in *HelmOptions) DeepCopy() *HelmOptions { - if in == nil { - return nil - } - out := new(HelmOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HelmUninstallOptions) DeepCopyInto(out *HelmUninstallOptions) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmUninstallOptions. -func (in *HelmUninstallOptions) DeepCopy() *HelmUninstallOptions { - if in == nil { - return nil - } - out := new(HelmUninstallOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HelmUpgradeOptions) DeepCopyInto(out *HelmUpgradeOptions) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmUpgradeOptions. -func (in *HelmUpgradeOptions) DeepCopy() *HelmUpgradeOptions { - if in == nil { - return nil - } - out := new(HelmUpgradeOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KustomizationRef) DeepCopyInto(out *KustomizationRef) { - *out = *in - if in.Values != nil { - in, out := &in.Values, &out.Values - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ValuesFrom != nil { - in, out := &in.ValuesFrom, &out.ValuesFrom - *out = make([]ValueFrom, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizationRef. -func (in *KustomizationRef) DeepCopy() *KustomizationRef { - if in == nil { - return nil - } - out := new(KustomizationRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PolicyRef) DeepCopyInto(out *PolicyRef) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyRef. -func (in *PolicyRef) DeepCopy() *PolicyRef { - if in == nil { - return nil - } - out := new(PolicyRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Profile) DeepCopyInto(out *Profile) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Profile. -func (in *Profile) DeepCopy() *Profile { - if in == nil { - return nil - } - out := new(Profile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Profile) 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 *ProfileList) DeepCopyInto(out *ProfileList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Profile, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProfileList. -func (in *ProfileList) DeepCopy() *ProfileList { - if in == nil { - return nil - } - out := new(ProfileList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProfileList) 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 *ProfileResource) DeepCopyInto(out *ProfileResource) { - *out = *in - if in.Features != nil { - in, out := &in.Features, &out.Features - *out = make([]Feature, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProfileResource. -func (in *ProfileResource) DeepCopy() *ProfileResource { - if in == nil { - return nil - } - out := new(ProfileResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReleaseReport) DeepCopyInto(out *ReleaseReport) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseReport. -func (in *ReleaseReport) DeepCopy() *ReleaseReport { - if in == nil { - return nil - } - out := new(ReleaseReport) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Resource) DeepCopyInto(out *Resource) { - *out = *in - if in.LastAppliedTime != nil { - in, out := &in.LastAppliedTime, &out.LastAppliedTime - *out = (*in).DeepCopy() - } - out.Owner = in.Owner -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resource. -func (in *Resource) DeepCopy() *Resource { - if in == nil { - return nil - } - out := new(Resource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceReport) DeepCopyInto(out *ResourceReport) { - *out = *in - in.Resource.DeepCopyInto(&out.Resource) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReport. -func (in *ResourceReport) DeepCopy() *ResourceReport { - if in == nil { - return nil - } - out := new(ResourceReport) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Spec) DeepCopyInto(out *Spec) { - *out = *in - if in.ClusterRefs != nil { - in, out := &in.ClusterRefs, &out.ClusterRefs - *out = make([]corev1.ObjectReference, len(*in)) - copy(*out, *in) - } - if in.SetRefs != nil { - in, out := &in.SetRefs, &out.SetRefs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.MaxUpdate != nil { - in, out := &in.MaxUpdate, &out.MaxUpdate - *out = new(intstr.IntOrString) - **out = **in - } - if in.TemplateResourceRefs != nil { - in, out := &in.TemplateResourceRefs, &out.TemplateResourceRefs - *out = make([]TemplateResourceRef, len(*in)) - copy(*out, *in) - } - if in.DependsOn != nil { - in, out := &in.DependsOn, &out.DependsOn - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PolicyRefs != nil { - in, out := &in.PolicyRefs, &out.PolicyRefs - *out = make([]PolicyRef, len(*in)) - copy(*out, *in) - } - if in.HelmCharts != nil { - in, out := &in.HelmCharts, &out.HelmCharts - *out = make([]HelmChart, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.KustomizationRefs != nil { - in, out := &in.KustomizationRefs, &out.KustomizationRefs - *out = make([]KustomizationRef, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ValidateHealths != nil { - in, out := &in.ValidateHealths, &out.ValidateHealths - *out = make([]ValidateHealth, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ExtraLabels != nil { - in, out := &in.ExtraLabels, &out.ExtraLabels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ExtraAnnotations != nil { - in, out := &in.ExtraAnnotations, &out.ExtraAnnotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Spec. -func (in *Spec) DeepCopy() *Spec { - if in == nil { - return nil - } - out := new(Spec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Status) DeepCopyInto(out *Status) { - *out = *in - if in.MatchingClusterRefs != nil { - in, out := &in.MatchingClusterRefs, &out.MatchingClusterRefs - *out = make([]corev1.ObjectReference, len(*in)) - copy(*out, *in) - } - in.UpdatingClusters.DeepCopyInto(&out.UpdatingClusters) - in.UpdatedClusters.DeepCopyInto(&out.UpdatedClusters) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status. -func (in *Status) DeepCopy() *Status { - if in == nil { - return nil - } - out := new(Status) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TemplateResourceRef) DeepCopyInto(out *TemplateResourceRef) { - *out = *in - out.Resource = in.Resource -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateResourceRef. -func (in *TemplateResourceRef) DeepCopy() *TemplateResourceRef { - if in == nil { - return nil - } - out := new(TemplateResourceRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ValidateHealth) DeepCopyInto(out *ValidateHealth) { - *out = *in - if in.LabelFilters != nil { - in, out := &in.LabelFilters, &out.LabelFilters - *out = make([]apiv1alpha1.LabelFilter, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidateHealth. -func (in *ValidateHealth) DeepCopy() *ValidateHealth { - if in == nil { - return nil - } - out := new(ValidateHealth) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ValueFrom) DeepCopyInto(out *ValueFrom) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueFrom. -func (in *ValueFrom) DeepCopy() *ValueFrom { - if in == nil { - return nil - } - out := new(ValueFrom) - in.DeepCopyInto(out) - return out -} diff --git a/config/crd/bases/config.projectsveltos.io_clusterconfigurations.yaml b/config/crd/bases/config.projectsveltos.io_clusterconfigurations.yaml index f50590af..1c3b4a76 100644 --- a/config/crd/bases/config.projectsveltos.io_clusterconfigurations.yaml +++ b/config/crd/bases/config.projectsveltos.io_clusterconfigurations.yaml @@ -14,381 +14,6 @@ spec: singular: clusterconfiguration scope: Namespaced versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ClusterConfiguration is the Schema for the clusterconfigurations - API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - status: - description: ClusterConfigurationStatus defines the observed state of - ClusterConfiguration - properties: - clusterProfileResources: - description: |- - ClusterProfileResources is the list of resources currently deployed in a Cluster due - to ClusterProfiles - items: - description: |- - ClusterProfileResource keeps info on all of the resources deployed in this Cluster - due to a given ClusterProfile - properties: - Features: - description: |- - Features contains the list of policies deployed in the Cluster because - of a given feature - items: - properties: - charts: - description: Charts is a list of helm charts deployed - in the Cluster. - items: - properties: - appVersion: - description: AppVersion is the version of the app - deployed in the Cluster. - type: string - chartVersion: - description: ChartVersion is the version of the - helm chart deployed in the Cluster. - type: string - icon: - description: The URL to an icon file. - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this - resource was last applied to the cluster. - format: date-time - type: string - namespace: - description: Namespace where chart is deployed in - the Cluster. - type: string - releaseName: - description: ReleaseName name of the release deployed - in the Cluster. - minLength: 1 - type: string - repoURL: - description: |- - RepoURL URL of the repo containing the helm chart deployed - in the Cluster. - minLength: 1 - type: string - required: - - chartVersion - - lastAppliedTime - - releaseName - - repoURL - type: object - type: array - featureID: - description: FeatureID is an indentifier of the feature - whose status is reported - enum: - - Resources - - Helm - - Kustomize - type: string - resources: - description: Resources is a list of resources deployed - in the Cluster. - items: - properties: - group: - description: Group of the resource deployed in the - Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the - Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this - resource was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the - Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret - containing this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in - the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - type: array - required: - - featureID - type: object - type: array - clusterProfileName: - description: ProfileName is the name of the ClusterProfile matching - the Cluster. - type: string - required: - - clusterProfileName - type: object - type: array - profileResources: - description: |- - ProfileResources is the list of resources currently deployed in a Cluster due - to Profiles - items: - description: |- - ProfileResource keeps info on all of the resources deployed in this Cluster - due to a given Profile - properties: - Features: - description: |- - Features contains the list of policies deployed in the Cluster because - of a given feature - items: - properties: - charts: - description: Charts is a list of helm charts deployed - in the Cluster. - items: - properties: - appVersion: - description: AppVersion is the version of the app - deployed in the Cluster. - type: string - chartVersion: - description: ChartVersion is the version of the - helm chart deployed in the Cluster. - type: string - icon: - description: The URL to an icon file. - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this - resource was last applied to the cluster. - format: date-time - type: string - namespace: - description: Namespace where chart is deployed in - the Cluster. - type: string - releaseName: - description: ReleaseName name of the release deployed - in the Cluster. - minLength: 1 - type: string - repoURL: - description: |- - RepoURL URL of the repo containing the helm chart deployed - in the Cluster. - minLength: 1 - type: string - required: - - chartVersion - - lastAppliedTime - - releaseName - - repoURL - type: object - type: array - featureID: - description: FeatureID is an indentifier of the feature - whose status is reported - enum: - - Resources - - Helm - - Kustomize - type: string - resources: - description: Resources is a list of resources deployed - in the Cluster. - items: - properties: - group: - description: Group of the resource deployed in the - Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the - Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this - resource was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the - Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret - containing this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in - the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - type: array - required: - - featureID - type: object - type: array - profileName: - description: ProfileName is the name of the Profile matching - the Cluster. - type: string - required: - - profileName - type: object - type: array - type: object - type: object - served: true - storage: false - subresources: - status: {} - name: v1beta1 schema: openAPIV3Schema: diff --git a/config/crd/bases/config.projectsveltos.io_clusterprofiles.yaml b/config/crd/bases/config.projectsveltos.io_clusterprofiles.yaml index 4e855e92..272cb408 100644 --- a/config/crd/bases/config.projectsveltos.io_clusterprofiles.yaml +++ b/config/crd/bases/config.projectsveltos.io_clusterprofiles.yaml @@ -14,943 +14,6 @@ spec: singular: clusterprofile scope: Cluster versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ClusterProfile is the Schema for the clusterprofiles API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - properties: - clusterRefs: - description: ClusterRefs identifies clusters to associate to. - items: - description: ObjectReference contains enough information to let - you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - clusterSelector: - description: ClusterSelector identifies clusters to associate to. - type: string - continueOnConflict: - default: false - description: |- - By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after - encountering the first conflict (e.g., another ClusterProfile already deployed the resource). - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if conflicts are detected for previous resources. - type: boolean - dependsOn: - description: |- - DependsOn specifies a list of other ClusterProfiles that this instance depends on. - In any managed cluster that matches this ClusterProfile, the add-ons and applications - defined in this instance will not be deployed until all add-ons and applications in the - ClusterProfiles listed as dependencies are deployed. - items: - type: string - type: array - extraAnnotations: - additionalProperties: - type: string - description: |- - ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources - deployed in a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a annotation with a key present in - `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. - type: object - extraLabels: - additionalProperties: - type: string - description: |- - ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in - a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a label with a key present in - `ExtraLabels`, the value from `ExtraLabels` will override the existing value. - type: object - helmCharts: - description: Helm charts is a list of helm charts that need to be - deployed - items: - properties: - chartName: - description: ChartName is the chart name - minLength: 1 - type: string - chartVersion: - description: ChartVersion is the chart version - minLength: 1 - type: string - helmChartAction: - default: Install - description: HelmChartAction is the action that will be taken - on the helm chart - enum: - - Install - - Uninstall - type: string - options: - description: Options allows to set flags which are used during - installation. - properties: - atomic: - default: false - description: |- - if set, the installation process deletes the installation/upgrades on failure. - The --wait flag will be set automatically if --atomic is used - Default to false - type: boolean - dependencyUpdate: - default: false - description: |- - update dependencies if they are missing before installing the chart - Default to false - type: boolean - description: - description: Description is the description of an helm operation - type: string - disableHooks: - default: false - description: |- - prevent hooks from running during install/upgrade/uninstall - Default to false - type: boolean - disableOpenAPIValidation: - default: false - description: |- - if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema - Default to false - type: boolean - enableClientCache: - default: false - description: EnableClientCache is a flag to enable Helm - client cache. If it is not specified, it will be set to - false. - type: boolean - installOptions: - description: HelmInstallOptions are options specific to - helm install - properties: - createNamespace: - default: true - description: Create the release namespace if not present. - Defaults to true - type: boolean - replace: - default: true - description: Replaces if set indicates to replace an - older release with this one - type: boolean - type: object - labels: - additionalProperties: - type: string - description: Labels that would be added to release metadata. - type: object - skipCRDs: - default: false - description: |- - SkipCRDs controls whether CRDs should be installed during install/upgrade operation. - By default, CRDs are installed if not already present. - type: boolean - skipSchemaValidation: - default: false - description: SkipSchemaValidation determines if JSON schema - validation is disabled. - type: boolean - timeout: - description: time to wait for any individual Kubernetes - operation (like Jobs for hooks) (default 5m0s) - type: string - uninstallOptions: - description: HelmUninstallOptions are options specific to - helm uninstall - properties: - deletionPropagation: - description: DeletionPropagation - enum: - - orphan - - foreground - - background - type: string - keepHistory: - description: |- - When uninstall a chart with this flag, Helm removes the resources associated with the chart, - but it keeps the release information. This allows to see details about the uninstalled release - using the helm history command. - type: boolean - type: object - upgradeOptions: - description: HelmUpgradeOptions are options specific to - helm upgrade - properties: - cleanupOnFail: - default: false - description: CleanupOnFail will, if true, cause the - upgrade to delete newly-created resources on a failed - update. - type: boolean - force: - default: false - description: |- - Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway. - This should be used with caution. - type: boolean - maxHistory: - default: 2 - description: |- - MaxHistory limits the maximum number of revisions saved per release - Default to 2 - type: integer - recreate: - default: false - description: Recreate will (if true) recreate pods after - a rollback. - type: boolean - resetThenReuseValues: - default: false - description: ResetThenReuseValues will reset the values - to the chart's built-ins then merge with user's last - supplied values. - type: boolean - resetValues: - default: false - description: ResetValues will reset the values to the - chart's built-ins rather than merging with existing. - type: boolean - reuseValues: - default: false - description: |- - ReuseValues copies values from the current release to a new release if the - new release does not have any values. If the request already has values, - or if there are no values in the current release, this does nothing. - This is skipped if the ResetValues flag is set, in which case the - request values are not altered. - type: boolean - subNotes: - default: false - description: SubNotes determines whether sub-notes are - rendered in the chart. - type: boolean - upgradeCRDs: - default: false - description: |- - UpgradeCRDs upgrade CRDs from the Helm Chart's crds directory - By default, CRDs are not applied during Helm upgrade action by Helm - https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ - type: boolean - type: object - wait: - default: false - description: |- - if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet - are in a ready state before marking the release as successful. It will wait for as long as --timeout - Default to false - type: boolean - waitForJobs: - default: false - description: |- - if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. - It will wait for as long as --timeout - Default to false - type: boolean - type: object - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - repositoryName: - description: RepositoryName is the name helm chart repository - minLength: 1 - type: string - repositoryURL: - description: RepositoryURL is the URL helm chart repository - minLength: 1 - type: string - values: - description: |- - Values field allows to define configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - type: string - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to store configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - chartName - - chartVersion - - releaseName - - releaseNamespace - - repositoryName - - repositoryURL - type: object - type: array - kustomizationRefs: - description: |- - Kustomization refs is a list of kustomization paths. Kustomization will - be run on those paths and the outcome will be deployed. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - flux GitRepository;OCIRepository;Bucket - - ConfigMap/Secret - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the kustomization.yaml file, or the - set of plain YAMLs a kustomization.yaml should be generated for. - Defaults to 'None', which translates to the root path of the SourceRef. - type: string - targetNamespace: - description: |- - TargetNamespace sets or overrides the namespace in the - kustomization.yaml file. - maxLength: 63 - minLength: 1 - type: string - values: - additionalProperties: - type: string - description: |- - Values is a map[string]string type that allows to define a set of key-value pairs. - These key-value pairs can optionally leverage Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - type: object - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to define key-value pairs. These key-value pairs can optionally leverage - Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - kind - - name - - namespace - type: object - type: array - maxUpdate: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of clusters that can be updated concurrently. - Value can be an absolute number (ex: 5) or a percentage of desired cluster (ex: 10%). - Defaults to 100%. - Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile - changes, only 30% of matching clusters will be updated in parallel. Only when updates - in those cluster succeed, other matching clusters are updated. - pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ - x-kubernetes-int-or-string: true - policyRefs: - description: |- - PolicyRefs references all the ConfigMaps/Secrets containing kubernetes resources - that need to be deployed in the matching CAPI clusters. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - - flux GitRepository;OCIRepository;Bucket - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the YAML files. - Defaults to 'None', which translates to the root path of the SourceRef. - Used only for GitRepository;OCIRepository;Bucket - type: string - required: - - kind - - name - type: object - type: array - reloader: - default: false - description: |- - Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed - by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade - when a ConfigMap/Secret instance mounted as volume is modified. - When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically - starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it. - type: boolean - setRefs: - description: |- - SetRefs identifies referenced (cluster)Sets. - - ClusterProfile can reference ClusterSet; - - Profile can reference Set; - items: - type: string - type: array - stopMatchingBehavior: - default: WithdrawPolicies - description: |- - StopMatchingBehavior indicates what behavior should be when a Cluster stop matching - the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will - be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead - leave ClusterProfile deployed policies in the Cluster. - enum: - - WithdrawPolicies - - LeavePolicies - type: string - syncMode: - default: Continuous - description: |- - SyncMode specifies how features are synced in a matching workload cluster. - - OneTime means, first time a workload cluster matches the ClusterProfile, - features will be deployed in such cluster. Any subsequent feature configuration - change won't be applied into the matching workload clusters; - - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile, - the specified features are deployed. Subsequent changes to the feature configuration are also - automatically applied to all matching workload clusters. - _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors - matching managed clusters for configuration drift. If drift is detected, a reconciliation is - triggered to ensure the managed cluster's configuration aligns with the ClusterProfile. - - DryRun means no change will be propagated to any matching cluster. A report - instead will be generated summarizing what would happen in any matching cluster - because of the changes made to ClusterProfile while in DryRun mode. - enum: - - OneTime - - Continuous - - ContinuousWithDriftDetection - - DryRun - type: string - templateResourceRefs: - description: |- - TemplateResourceRefs is a list of resource to collect from the management cluster. - Those resources' values will be used to instantiate templates contained in referenced - PolicyRefs and Helm charts - items: - properties: - identifier: - description: |- - Identifier is how the resource will be referred to in the - template - type: string - resource: - description: |- - Resource references a Kubernetes instance in the management - cluster to fetch and use during template instantiation. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - required: - - identifier - - resource - type: object - type: array - x-kubernetes-list-map-keys: - - identifier - x-kubernetes-list-type: map - tier: - default: 100 - description: |- - Tier controls the order of deployment for ClusterProfile or Profile resources targeting - the same cluster resources. - Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes - resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it. - Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest** - Tier value takes priority and deploys the resource. - Higher Tier values represent lower priority. The default Tier value is 100. - Using Tiers provides finer control over resource deployment within your cluster, particularly useful - when multiple configurations manage the same resources. - format: int32 - minimum: 1 - type: integer - validateHealths: - description: |- - ValidateHealths is a slice of Lua functions to run against - the managed cluster to validate the state of those add-ons/applications - is healthy - items: - properties: - featureID: - description: |- - FeatureID is an indentifier of the feature (Helm/Kustomize/Resources) - This field indicates when to run this check. - For instance: - - if set to Helm this check will be run after all helm - charts specified in the ClusterProfile are deployed. - - if set to Resources this check will be run after the content - of all the ConfigMaps/Secrets referenced by ClusterProfile in the - PolicyRef sections is deployed - enum: - - Resources - - Helm - - Kustomize - type: string - group: - description: Group of the resource to fetch in the managed Cluster. - type: string - kind: - description: Kind of the resource to fetch in the managed Cluster. - minLength: 1 - type: string - labelFilters: - description: LabelFilters allows to filter resources based on - current labels. - items: - properties: - key: - description: Key is the label key - type: string - operation: - description: Operation is the comparison operation - enum: - - Equal - - Different - type: string - value: - description: Value is the label value - type: string - required: - - key - - operation - - value - type: object - type: array - name: - description: Name is the name of this check - type: string - namespace: - description: |- - Namespace of the resource to fetch in the managed Cluster. - Empty for resources scoped at cluster level. - type: string - script: - description: |- - Script is a text containing a lua script. - Must return struct with field "health" - representing whether object is a match (true or false) - type: string - version: - description: Version of the resource to fetch in the managed - Cluster. - type: string - required: - - featureID - - group - - kind - - name - - version - type: object - type: array - type: object - status: - description: Status defines the observed state of ClusterProfile/Profile - properties: - matchingClusters: - description: |- - MatchingClusterRefs reference all the clusters currently matching - ClusterProfile ClusterSelector - items: - description: ObjectReference contains enough information to let - you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - updatedClusters: - description: |- - UpdatedClusters contains information all the cluster currently matching - ClusterProfile ClusterSelector and already updated to latest ClusterProfile - Spec - properties: - clusters: - description: |- - Clusters reference all the clusters currently matching - ClusterProfile ClusterSelector and already updated/being updated - to ClusterProfile Spec - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - hash: - description: |- - Hash represents of a unique value for ClusterProfile Spec at - a fixed point in time - format: byte - type: string - type: object - updatingClusters: - description: |- - UpdatingClusters reference all the cluster currently matching - ClusterProfile ClusterSelector and being updated - properties: - clusters: - description: |- - Clusters reference all the clusters currently matching - ClusterProfile ClusterSelector and already updated/being updated - to ClusterProfile Spec - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - hash: - description: |- - Hash represents of a unique value for ClusterProfile Spec at - a fixed point in time - format: byte - type: string - type: object - type: object - type: object - served: true - storage: false - subresources: - status: {} - name: v1beta1 schema: openAPIV3Schema: diff --git a/config/crd/bases/config.projectsveltos.io_clusterreports.yaml b/config/crd/bases/config.projectsveltos.io_clusterreports.yaml index a04b3b1b..4431ce9b 100644 --- a/config/crd/bases/config.projectsveltos.io_clusterreports.yaml +++ b/config/crd/bases/config.projectsveltos.io_clusterreports.yaml @@ -14,318 +14,6 @@ spec: singular: clusterreport scope: Namespaced versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ClusterReport is the Schema for the clusterreports API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: ClusterReportSpec defines the desired state of ClusterReport - properties: - clusterName: - description: |- - ClusterName is the name of the CAPI Cluster this ClusterReport - is for. - type: string - clusterNamespace: - description: |- - ClusterNamespace is the namespace of the CAPI Cluster this - ClusterReport is for. - type: string - required: - - clusterName - - clusterNamespace - type: object - status: - description: ClusterReportStatus defines the observed state of ClusterReport - properties: - kustomizeResourceReports: - description: |- - KustomizeResourceReports contains report on Kubernetes resources - deployed because of KustomizationRefs - items: - properties: - action: - description: Action represent the type of operation on the Kubernetes - resource. - enum: - - No Action - - Create - - Update - - Delete - - Conflict - type: string - message: - description: |- - Message is for any message that needs to added to better - explain the action. - type: string - resource: - description: Resource contains information about Kubernetes - Resource - properties: - group: - description: Group of the resource deployed in the Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this resource - was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret containing - this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - required: - - resource - type: object - type: array - releaseReports: - description: ReleaseReports contains report on helm releases - items: - properties: - action: - description: Action represent the type of operation on the Helm - Chart - enum: - - No Action - - Install - - Upgrade - - Delete - - Conflict - type: string - chartName: - description: ReleaseName of the release deployed in the CAPI - Cluster. - minLength: 1 - type: string - chartVersion: - description: |- - ChartVersion is the version of the helm chart deployed - in the CAPI Cluster. - type: string - message: - description: |- - Message is for any message that needs to added to better - explain the action. - type: string - releaseNamespace: - description: Namespace where release is deployed in the CAPI - Cluster. - minLength: 1 - type: string - required: - - chartName - - chartVersion - - releaseNamespace - type: object - type: array - resourceReports: - description: |- - ResourceReports contains report on Kubernetes resources - deployed because of PolicyRefs - items: - properties: - action: - description: Action represent the type of operation on the Kubernetes - resource. - enum: - - No Action - - Create - - Update - - Delete - - Conflict - type: string - message: - description: |- - Message is for any message that needs to added to better - explain the action. - type: string - resource: - description: Resource contains information about Kubernetes - Resource - properties: - group: - description: Group of the resource deployed in the Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this resource - was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret containing - this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - required: - - resource - type: object - type: array - type: object - type: object - served: true - storage: false - subresources: - status: {} - name: v1beta1 schema: openAPIV3Schema: diff --git a/config/crd/bases/config.projectsveltos.io_clustersummaries.yaml b/config/crd/bases/config.projectsveltos.io_clustersummaries.yaml index 3f22201b..33bb8973 100644 --- a/config/crd/bases/config.projectsveltos.io_clustersummaries.yaml +++ b/config/crd/bases/config.projectsveltos.io_clustersummaries.yaml @@ -14,933 +14,6 @@ spec: singular: clustersummary scope: Namespaced versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ClusterSummary is the Schema for the clustersummaries API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: ClusterSummarySpec defines the desired state of ClusterSummary - properties: - clusterName: - description: ClusterName is the name of the workload Cluster this - ClusterSummary is for. - type: string - clusterNamespace: - description: |- - ClusterNamespace is the namespace of the workload Cluster this - ClusterSummary is for. - type: string - clusterProfileSpec: - description: |- - ClusterProfileSpec represent the configuration that will be applied to - the workload cluster. - properties: - clusterRefs: - description: ClusterRefs identifies clusters to associate to. - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - clusterSelector: - description: ClusterSelector identifies clusters to associate - to. - type: string - continueOnConflict: - default: false - description: |- - By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after - encountering the first conflict (e.g., another ClusterProfile already deployed the resource). - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if conflicts are detected for previous resources. - type: boolean - dependsOn: - description: |- - DependsOn specifies a list of other ClusterProfiles that this instance depends on. - In any managed cluster that matches this ClusterProfile, the add-ons and applications - defined in this instance will not be deployed until all add-ons and applications in the - ClusterProfiles listed as dependencies are deployed. - items: - type: string - type: array - extraAnnotations: - additionalProperties: - type: string - description: |- - ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources - deployed in a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a annotation with a key present in - `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. - type: object - extraLabels: - additionalProperties: - type: string - description: |- - ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in - a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a label with a key present in - `ExtraLabels`, the value from `ExtraLabels` will override the existing value. - type: object - helmCharts: - description: Helm charts is a list of helm charts that need to - be deployed - items: - properties: - chartName: - description: ChartName is the chart name - minLength: 1 - type: string - chartVersion: - description: ChartVersion is the chart version - minLength: 1 - type: string - helmChartAction: - default: Install - description: HelmChartAction is the action that will be - taken on the helm chart - enum: - - Install - - Uninstall - type: string - options: - description: Options allows to set flags which are used - during installation. - properties: - atomic: - default: false - description: |- - if set, the installation process deletes the installation/upgrades on failure. - The --wait flag will be set automatically if --atomic is used - Default to false - type: boolean - dependencyUpdate: - default: false - description: |- - update dependencies if they are missing before installing the chart - Default to false - type: boolean - description: - description: Description is the description of an helm - operation - type: string - disableHooks: - default: false - description: |- - prevent hooks from running during install/upgrade/uninstall - Default to false - type: boolean - disableOpenAPIValidation: - default: false - description: |- - if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema - Default to false - type: boolean - enableClientCache: - default: false - description: EnableClientCache is a flag to enable Helm - client cache. If it is not specified, it will be set - to false. - type: boolean - installOptions: - description: HelmInstallOptions are options specific - to helm install - properties: - createNamespace: - default: true - description: Create the release namespace if not - present. Defaults to true - type: boolean - replace: - default: true - description: Replaces if set indicates to replace - an older release with this one - type: boolean - type: object - labels: - additionalProperties: - type: string - description: Labels that would be added to release metadata. - type: object - skipCRDs: - default: false - description: |- - SkipCRDs controls whether CRDs should be installed during install/upgrade operation. - By default, CRDs are installed if not already present. - type: boolean - skipSchemaValidation: - default: false - description: SkipSchemaValidation determines if JSON - schema validation is disabled. - type: boolean - timeout: - description: time to wait for any individual Kubernetes - operation (like Jobs for hooks) (default 5m0s) - type: string - uninstallOptions: - description: HelmUninstallOptions are options specific - to helm uninstall - properties: - deletionPropagation: - description: DeletionPropagation - enum: - - orphan - - foreground - - background - type: string - keepHistory: - description: |- - When uninstall a chart with this flag, Helm removes the resources associated with the chart, - but it keeps the release information. This allows to see details about the uninstalled release - using the helm history command. - type: boolean - type: object - upgradeOptions: - description: HelmUpgradeOptions are options specific - to helm upgrade - properties: - cleanupOnFail: - default: false - description: CleanupOnFail will, if true, cause - the upgrade to delete newly-created resources - on a failed update. - type: boolean - force: - default: false - description: |- - Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway. - This should be used with caution. - type: boolean - maxHistory: - default: 2 - description: |- - MaxHistory limits the maximum number of revisions saved per release - Default to 2 - type: integer - recreate: - default: false - description: Recreate will (if true) recreate pods - after a rollback. - type: boolean - resetThenReuseValues: - default: false - description: ResetThenReuseValues will reset the - values to the chart's built-ins then merge with - user's last supplied values. - type: boolean - resetValues: - default: false - description: ResetValues will reset the values to - the chart's built-ins rather than merging with - existing. - type: boolean - reuseValues: - default: false - description: |- - ReuseValues copies values from the current release to a new release if the - new release does not have any values. If the request already has values, - or if there are no values in the current release, this does nothing. - This is skipped if the ResetValues flag is set, in which case the - request values are not altered. - type: boolean - subNotes: - default: false - description: SubNotes determines whether sub-notes - are rendered in the chart. - type: boolean - upgradeCRDs: - default: false - description: |- - UpgradeCRDs upgrade CRDs from the Helm Chart's crds directory - By default, CRDs are not applied during Helm upgrade action by Helm - https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ - type: boolean - type: object - wait: - default: false - description: |- - if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet - are in a ready state before marking the release as successful. It will wait for as long as --timeout - Default to false - type: boolean - waitForJobs: - default: false - description: |- - if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. - It will wait for as long as --timeout - Default to false - type: boolean - type: object - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - repositoryName: - description: RepositoryName is the name helm chart repository - minLength: 1 - type: string - repositoryURL: - description: RepositoryURL is the URL helm chart repository - minLength: 1 - type: string - values: - description: |- - Values field allows to define configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - type: string - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to store configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - chartName - - chartVersion - - releaseName - - releaseNamespace - - repositoryName - - repositoryURL - type: object - type: array - kustomizationRefs: - description: |- - Kustomization refs is a list of kustomization paths. Kustomization will - be run on those paths and the outcome will be deployed. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - flux GitRepository;OCIRepository;Bucket - - ConfigMap/Secret - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the kustomization.yaml file, or the - set of plain YAMLs a kustomization.yaml should be generated for. - Defaults to 'None', which translates to the root path of the SourceRef. - type: string - targetNamespace: - description: |- - TargetNamespace sets or overrides the namespace in the - kustomization.yaml file. - maxLength: 63 - minLength: 1 - type: string - values: - additionalProperties: - type: string - description: |- - Values is a map[string]string type that allows to define a set of key-value pairs. - These key-value pairs can optionally leverage Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - type: object - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to define key-value pairs. These key-value pairs can optionally leverage - Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - kind - - name - - namespace - type: object - type: array - maxUpdate: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of clusters that can be updated concurrently. - Value can be an absolute number (ex: 5) or a percentage of desired cluster (ex: 10%). - Defaults to 100%. - Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile - changes, only 30% of matching clusters will be updated in parallel. Only when updates - in those cluster succeed, other matching clusters are updated. - pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ - x-kubernetes-int-or-string: true - policyRefs: - description: |- - PolicyRefs references all the ConfigMaps/Secrets containing kubernetes resources - that need to be deployed in the matching CAPI clusters. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - - flux GitRepository;OCIRepository;Bucket - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the YAML files. - Defaults to 'None', which translates to the root path of the SourceRef. - Used only for GitRepository;OCIRepository;Bucket - type: string - required: - - kind - - name - type: object - type: array - reloader: - default: false - description: |- - Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed - by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade - when a ConfigMap/Secret instance mounted as volume is modified. - When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically - starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it. - type: boolean - setRefs: - description: |- - SetRefs identifies referenced (cluster)Sets. - - ClusterProfile can reference ClusterSet; - - Profile can reference Set; - items: - type: string - type: array - stopMatchingBehavior: - default: WithdrawPolicies - description: |- - StopMatchingBehavior indicates what behavior should be when a Cluster stop matching - the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will - be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead - leave ClusterProfile deployed policies in the Cluster. - enum: - - WithdrawPolicies - - LeavePolicies - type: string - syncMode: - default: Continuous - description: |- - SyncMode specifies how features are synced in a matching workload cluster. - - OneTime means, first time a workload cluster matches the ClusterProfile, - features will be deployed in such cluster. Any subsequent feature configuration - change won't be applied into the matching workload clusters; - - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile, - the specified features are deployed. Subsequent changes to the feature configuration are also - automatically applied to all matching workload clusters. - _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors - matching managed clusters for configuration drift. If drift is detected, a reconciliation is - triggered to ensure the managed cluster's configuration aligns with the ClusterProfile. - - DryRun means no change will be propagated to any matching cluster. A report - instead will be generated summarizing what would happen in any matching cluster - because of the changes made to ClusterProfile while in DryRun mode. - enum: - - OneTime - - Continuous - - ContinuousWithDriftDetection - - DryRun - type: string - templateResourceRefs: - description: |- - TemplateResourceRefs is a list of resource to collect from the management cluster. - Those resources' values will be used to instantiate templates contained in referenced - PolicyRefs and Helm charts - items: - properties: - identifier: - description: |- - Identifier is how the resource will be referred to in the - template - type: string - resource: - description: |- - Resource references a Kubernetes instance in the management - cluster to fetch and use during template instantiation. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - required: - - identifier - - resource - type: object - type: array - x-kubernetes-list-map-keys: - - identifier - x-kubernetes-list-type: map - tier: - default: 100 - description: |- - Tier controls the order of deployment for ClusterProfile or Profile resources targeting - the same cluster resources. - Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes - resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it. - Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest** - Tier value takes priority and deploys the resource. - Higher Tier values represent lower priority. The default Tier value is 100. - Using Tiers provides finer control over resource deployment within your cluster, particularly useful - when multiple configurations manage the same resources. - format: int32 - minimum: 1 - type: integer - validateHealths: - description: |- - ValidateHealths is a slice of Lua functions to run against - the managed cluster to validate the state of those add-ons/applications - is healthy - items: - properties: - featureID: - description: |- - FeatureID is an indentifier of the feature (Helm/Kustomize/Resources) - This field indicates when to run this check. - For instance: - - if set to Helm this check will be run after all helm - charts specified in the ClusterProfile are deployed. - - if set to Resources this check will be run after the content - of all the ConfigMaps/Secrets referenced by ClusterProfile in the - PolicyRef sections is deployed - enum: - - Resources - - Helm - - Kustomize - type: string - group: - description: Group of the resource to fetch in the managed - Cluster. - type: string - kind: - description: Kind of the resource to fetch in the managed - Cluster. - minLength: 1 - type: string - labelFilters: - description: LabelFilters allows to filter resources based - on current labels. - items: - properties: - key: - description: Key is the label key - type: string - operation: - description: Operation is the comparison operation - enum: - - Equal - - Different - type: string - value: - description: Value is the label value - type: string - required: - - key - - operation - - value - type: object - type: array - name: - description: Name is the name of this check - type: string - namespace: - description: |- - Namespace of the resource to fetch in the managed Cluster. - Empty for resources scoped at cluster level. - type: string - script: - description: |- - Script is a text containing a lua script. - Must return struct with field "health" - representing whether object is a match (true or false) - type: string - version: - description: Version of the resource to fetch in the managed - Cluster. - type: string - required: - - featureID - - group - - kind - - name - - version - type: object - type: array - type: object - clusterType: - description: ClusterType is the type of Cluster - type: string - required: - - clusterName - - clusterNamespace - - clusterType - type: object - status: - description: ClusterSummaryStatus defines the observed state of ClusterSummary - properties: - dependencies: - description: |- - Dependencies is a summary reporting the status of the dependencies - for the associated ClusterProfile - type: string - deployedGVKs: - description: |- - DeployedGVKs reports the list of GVKs deployed by ClusterSummary - in a managed cluster - items: - properties: - deployedGroupVersionKind: - description: |- - DeployedGroupVersionKind contains all GroupVersionKinds deployed in either - the workload cluster or the management cluster because of this feature. - Each element has format kind.version.group - items: - type: string - type: array - featureID: - description: FeatureID is an indentifier of the feature whose - status is reported - enum: - - Resources - - Helm - - Kustomize - type: string - required: - - featureID - type: object - type: array - x-kubernetes-list-map-keys: - - featureID - x-kubernetes-list-type: map - featureSummaries: - description: |- - FeatureSummaries reports the status of each workload cluster feature - directly managed by ClusterProfile. - items: - description: |- - FeatureSummary contains a summary of the state of a workload - cluster feature. - properties: - deployedGroupVersionKind: - description: |- - DeployedGroupVersionKind contains all GroupVersionKinds deployed in either - the workload cluster or the management cluster because of this feature. - Each element has format kind.version.group - Deprecated: Replaced by FeatureDeploymentInfo field instead - items: - type: string - type: array - failureMessage: - description: FailureMessage provides more information about - the error. - type: string - failureReason: - description: FailureReason indicates the type of error that - occurred. - type: string - featureID: - description: FeatureID is an indentifier of the feature whose - status is reported - enum: - - Resources - - Helm - - Kustomize - type: string - hash: - description: |- - Hash represents of a unique value for a feature at a fixed point in - time - format: byte - type: string - lastAppliedTime: - description: LastAppliedTime is the time feature was last reconciled - format: date-time - type: string - status: - description: Status represents the state of the feature in the - workload cluster - enum: - - Provisioning - - Provisioned - - Failed - - FailedNonRetriable - - Removing - - Removed - type: string - required: - - featureID - type: object - type: array - x-kubernetes-list-map-keys: - - featureID - x-kubernetes-list-type: map - helmReleaseSummaries: - description: |- - HelmReleaseSummaries reports the status of each helm chart - directly managed by ClusterProfile. - items: - properties: - conflictMessage: - description: |- - Status indicates whether ClusterSummary can manage the helm - chart or there is a conflict - type: string - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - status: - description: |- - Status indicates whether ClusterSummary can manage the helm - chart or there is a conflict - enum: - - Managing - - Conflict - type: string - valuesHash: - description: ValuesHash represents of a unique value for the - values section - format: byte - type: string - required: - - releaseName - - releaseNamespace - - status - type: object - type: array - x-kubernetes-list-type: atomic - type: object - type: object - served: true - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Time duration since creation of ClusterSummary jsonPath: .metadata.creationTimestamp diff --git a/config/crd/bases/config.projectsveltos.io_profiles.yaml b/config/crd/bases/config.projectsveltos.io_profiles.yaml index 8b349937..f81c559b 100644 --- a/config/crd/bases/config.projectsveltos.io_profiles.yaml +++ b/config/crd/bases/config.projectsveltos.io_profiles.yaml @@ -14,943 +14,6 @@ spec: singular: profile scope: Namespaced versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: Profile is the Schema for the profiles API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - properties: - clusterRefs: - description: ClusterRefs identifies clusters to associate to. - items: - description: ObjectReference contains enough information to let - you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - clusterSelector: - description: ClusterSelector identifies clusters to associate to. - type: string - continueOnConflict: - default: false - description: |- - By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after - encountering the first conflict (e.g., another ClusterProfile already deployed the resource). - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if conflicts are detected for previous resources. - type: boolean - dependsOn: - description: |- - DependsOn specifies a list of other ClusterProfiles that this instance depends on. - In any managed cluster that matches this ClusterProfile, the add-ons and applications - defined in this instance will not be deployed until all add-ons and applications in the - ClusterProfiles listed as dependencies are deployed. - items: - type: string - type: array - extraAnnotations: - additionalProperties: - type: string - description: |- - ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources - deployed in a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a annotation with a key present in - `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. - type: object - extraLabels: - additionalProperties: - type: string - description: |- - ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in - a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a label with a key present in - `ExtraLabels`, the value from `ExtraLabels` will override the existing value. - type: object - helmCharts: - description: Helm charts is a list of helm charts that need to be - deployed - items: - properties: - chartName: - description: ChartName is the chart name - minLength: 1 - type: string - chartVersion: - description: ChartVersion is the chart version - minLength: 1 - type: string - helmChartAction: - default: Install - description: HelmChartAction is the action that will be taken - on the helm chart - enum: - - Install - - Uninstall - type: string - options: - description: Options allows to set flags which are used during - installation. - properties: - atomic: - default: false - description: |- - if set, the installation process deletes the installation/upgrades on failure. - The --wait flag will be set automatically if --atomic is used - Default to false - type: boolean - dependencyUpdate: - default: false - description: |- - update dependencies if they are missing before installing the chart - Default to false - type: boolean - description: - description: Description is the description of an helm operation - type: string - disableHooks: - default: false - description: |- - prevent hooks from running during install/upgrade/uninstall - Default to false - type: boolean - disableOpenAPIValidation: - default: false - description: |- - if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema - Default to false - type: boolean - enableClientCache: - default: false - description: EnableClientCache is a flag to enable Helm - client cache. If it is not specified, it will be set to - false. - type: boolean - installOptions: - description: HelmInstallOptions are options specific to - helm install - properties: - createNamespace: - default: true - description: Create the release namespace if not present. - Defaults to true - type: boolean - replace: - default: true - description: Replaces if set indicates to replace an - older release with this one - type: boolean - type: object - labels: - additionalProperties: - type: string - description: Labels that would be added to release metadata. - type: object - skipCRDs: - default: false - description: |- - SkipCRDs controls whether CRDs should be installed during install/upgrade operation. - By default, CRDs are installed if not already present. - type: boolean - skipSchemaValidation: - default: false - description: SkipSchemaValidation determines if JSON schema - validation is disabled. - type: boolean - timeout: - description: time to wait for any individual Kubernetes - operation (like Jobs for hooks) (default 5m0s) - type: string - uninstallOptions: - description: HelmUninstallOptions are options specific to - helm uninstall - properties: - deletionPropagation: - description: DeletionPropagation - enum: - - orphan - - foreground - - background - type: string - keepHistory: - description: |- - When uninstall a chart with this flag, Helm removes the resources associated with the chart, - but it keeps the release information. This allows to see details about the uninstalled release - using the helm history command. - type: boolean - type: object - upgradeOptions: - description: HelmUpgradeOptions are options specific to - helm upgrade - properties: - cleanupOnFail: - default: false - description: CleanupOnFail will, if true, cause the - upgrade to delete newly-created resources on a failed - update. - type: boolean - force: - default: false - description: |- - Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway. - This should be used with caution. - type: boolean - maxHistory: - default: 2 - description: |- - MaxHistory limits the maximum number of revisions saved per release - Default to 2 - type: integer - recreate: - default: false - description: Recreate will (if true) recreate pods after - a rollback. - type: boolean - resetThenReuseValues: - default: false - description: ResetThenReuseValues will reset the values - to the chart's built-ins then merge with user's last - supplied values. - type: boolean - resetValues: - default: false - description: ResetValues will reset the values to the - chart's built-ins rather than merging with existing. - type: boolean - reuseValues: - default: false - description: |- - ReuseValues copies values from the current release to a new release if the - new release does not have any values. If the request already has values, - or if there are no values in the current release, this does nothing. - This is skipped if the ResetValues flag is set, in which case the - request values are not altered. - type: boolean - subNotes: - default: false - description: SubNotes determines whether sub-notes are - rendered in the chart. - type: boolean - upgradeCRDs: - default: false - description: |- - UpgradeCRDs upgrade CRDs from the Helm Chart's crds directory - By default, CRDs are not applied during Helm upgrade action by Helm - https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ - type: boolean - type: object - wait: - default: false - description: |- - if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet - are in a ready state before marking the release as successful. It will wait for as long as --timeout - Default to false - type: boolean - waitForJobs: - default: false - description: |- - if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. - It will wait for as long as --timeout - Default to false - type: boolean - type: object - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - repositoryName: - description: RepositoryName is the name helm chart repository - minLength: 1 - type: string - repositoryURL: - description: RepositoryURL is the URL helm chart repository - minLength: 1 - type: string - values: - description: |- - Values field allows to define configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - type: string - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to store configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - chartName - - chartVersion - - releaseName - - releaseNamespace - - repositoryName - - repositoryURL - type: object - type: array - kustomizationRefs: - description: |- - Kustomization refs is a list of kustomization paths. Kustomization will - be run on those paths and the outcome will be deployed. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - flux GitRepository;OCIRepository;Bucket - - ConfigMap/Secret - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the kustomization.yaml file, or the - set of plain YAMLs a kustomization.yaml should be generated for. - Defaults to 'None', which translates to the root path of the SourceRef. - type: string - targetNamespace: - description: |- - TargetNamespace sets or overrides the namespace in the - kustomization.yaml file. - maxLength: 63 - minLength: 1 - type: string - values: - additionalProperties: - type: string - description: |- - Values is a map[string]string type that allows to define a set of key-value pairs. - These key-value pairs can optionally leverage Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - type: object - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to define key-value pairs. These key-value pairs can optionally leverage - Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - kind - - name - - namespace - type: object - type: array - maxUpdate: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of clusters that can be updated concurrently. - Value can be an absolute number (ex: 5) or a percentage of desired cluster (ex: 10%). - Defaults to 100%. - Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile - changes, only 30% of matching clusters will be updated in parallel. Only when updates - in those cluster succeed, other matching clusters are updated. - pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ - x-kubernetes-int-or-string: true - policyRefs: - description: |- - PolicyRefs references all the ConfigMaps/Secrets containing kubernetes resources - that need to be deployed in the matching CAPI clusters. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - - flux GitRepository;OCIRepository;Bucket - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the YAML files. - Defaults to 'None', which translates to the root path of the SourceRef. - Used only for GitRepository;OCIRepository;Bucket - type: string - required: - - kind - - name - type: object - type: array - reloader: - default: false - description: |- - Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed - by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade - when a ConfigMap/Secret instance mounted as volume is modified. - When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically - starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it. - type: boolean - setRefs: - description: |- - SetRefs identifies referenced (cluster)Sets. - - ClusterProfile can reference ClusterSet; - - Profile can reference Set; - items: - type: string - type: array - stopMatchingBehavior: - default: WithdrawPolicies - description: |- - StopMatchingBehavior indicates what behavior should be when a Cluster stop matching - the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will - be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead - leave ClusterProfile deployed policies in the Cluster. - enum: - - WithdrawPolicies - - LeavePolicies - type: string - syncMode: - default: Continuous - description: |- - SyncMode specifies how features are synced in a matching workload cluster. - - OneTime means, first time a workload cluster matches the ClusterProfile, - features will be deployed in such cluster. Any subsequent feature configuration - change won't be applied into the matching workload clusters; - - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile, - the specified features are deployed. Subsequent changes to the feature configuration are also - automatically applied to all matching workload clusters. - _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors - matching managed clusters for configuration drift. If drift is detected, a reconciliation is - triggered to ensure the managed cluster's configuration aligns with the ClusterProfile. - - DryRun means no change will be propagated to any matching cluster. A report - instead will be generated summarizing what would happen in any matching cluster - because of the changes made to ClusterProfile while in DryRun mode. - enum: - - OneTime - - Continuous - - ContinuousWithDriftDetection - - DryRun - type: string - templateResourceRefs: - description: |- - TemplateResourceRefs is a list of resource to collect from the management cluster. - Those resources' values will be used to instantiate templates contained in referenced - PolicyRefs and Helm charts - items: - properties: - identifier: - description: |- - Identifier is how the resource will be referred to in the - template - type: string - resource: - description: |- - Resource references a Kubernetes instance in the management - cluster to fetch and use during template instantiation. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - required: - - identifier - - resource - type: object - type: array - x-kubernetes-list-map-keys: - - identifier - x-kubernetes-list-type: map - tier: - default: 100 - description: |- - Tier controls the order of deployment for ClusterProfile or Profile resources targeting - the same cluster resources. - Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes - resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it. - Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest** - Tier value takes priority and deploys the resource. - Higher Tier values represent lower priority. The default Tier value is 100. - Using Tiers provides finer control over resource deployment within your cluster, particularly useful - when multiple configurations manage the same resources. - format: int32 - minimum: 1 - type: integer - validateHealths: - description: |- - ValidateHealths is a slice of Lua functions to run against - the managed cluster to validate the state of those add-ons/applications - is healthy - items: - properties: - featureID: - description: |- - FeatureID is an indentifier of the feature (Helm/Kustomize/Resources) - This field indicates when to run this check. - For instance: - - if set to Helm this check will be run after all helm - charts specified in the ClusterProfile are deployed. - - if set to Resources this check will be run after the content - of all the ConfigMaps/Secrets referenced by ClusterProfile in the - PolicyRef sections is deployed - enum: - - Resources - - Helm - - Kustomize - type: string - group: - description: Group of the resource to fetch in the managed Cluster. - type: string - kind: - description: Kind of the resource to fetch in the managed Cluster. - minLength: 1 - type: string - labelFilters: - description: LabelFilters allows to filter resources based on - current labels. - items: - properties: - key: - description: Key is the label key - type: string - operation: - description: Operation is the comparison operation - enum: - - Equal - - Different - type: string - value: - description: Value is the label value - type: string - required: - - key - - operation - - value - type: object - type: array - name: - description: Name is the name of this check - type: string - namespace: - description: |- - Namespace of the resource to fetch in the managed Cluster. - Empty for resources scoped at cluster level. - type: string - script: - description: |- - Script is a text containing a lua script. - Must return struct with field "health" - representing whether object is a match (true or false) - type: string - version: - description: Version of the resource to fetch in the managed - Cluster. - type: string - required: - - featureID - - group - - kind - - name - - version - type: object - type: array - type: object - status: - description: Status defines the observed state of ClusterProfile/Profile - properties: - matchingClusters: - description: |- - MatchingClusterRefs reference all the clusters currently matching - ClusterProfile ClusterSelector - items: - description: ObjectReference contains enough information to let - you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - updatedClusters: - description: |- - UpdatedClusters contains information all the cluster currently matching - ClusterProfile ClusterSelector and already updated to latest ClusterProfile - Spec - properties: - clusters: - description: |- - Clusters reference all the clusters currently matching - ClusterProfile ClusterSelector and already updated/being updated - to ClusterProfile Spec - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - hash: - description: |- - Hash represents of a unique value for ClusterProfile Spec at - a fixed point in time - format: byte - type: string - type: object - updatingClusters: - description: |- - UpdatingClusters reference all the cluster currently matching - ClusterProfile ClusterSelector and being updated - properties: - clusters: - description: |- - Clusters reference all the clusters currently matching - ClusterProfile ClusterSelector and already updated/being updated - to ClusterProfile Spec - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - hash: - description: |- - Hash represents of a unique value for ClusterProfile Spec at - a fixed point in time - format: byte - type: string - type: object - type: object - type: object - served: true - storage: false - subresources: - status: {} - name: v1beta1 schema: openAPIV3Schema: diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 5d5b1afc..6768a774 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -12,20 +12,20 @@ resources: patches: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. # patches here are for enabling the conversion webhook for each CRD -- path: patches/webhook_in_clusterprofiles.yaml -- path: patches/webhook_in_clustersummaries.yaml +#- path: patches/webhook_in_clusterprofiles.yaml +#- path: patches/webhook_in_clustersummaries.yaml #- path: patches/webhook_in_clusterconfigurations.yaml #- path: patches/webhook_in_clusterreports.yaml -- path: patches/webhook_in_profiles.yaml +#- path: patches/webhook_in_profiles.yaml #+kubebuilder:scaffold:crdkustomizewebhookpatch # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. # patches here are for enabling the CA injection for each CRD -- path: patches/cainjection_in_clusterprofiles.yaml -- path: patches/cainjection_in_clustersummaries.yaml +#- path: patches/cainjection_in_clusterprofiles.yaml +#- path: patches/cainjection_in_clustersummaries.yaml #- path: patches/cainjection_in_clusterreports.yaml #- path: patches/cainjection_in_clusterconfigurations.yaml -- path: patches/cainjection_in_profiles.yaml +#- path: patches/cainjection_in_profiles.yaml #+kubebuilder:scaffold:crdkustomizecainjectionpatch # the following config is for teaching kustomize how to do kustomization for CRDs. diff --git a/config/crd/patches/cainjection_in_clusterconfigurations.yaml b/config/crd/patches/cainjection_in_clusterconfigurations.yaml index bc3c53e6..3247ca9b 100644 --- a/config/crd/patches/cainjection_in_clusterconfigurations.yaml +++ b/config/crd/patches/cainjection_in_clusterconfigurations.yaml @@ -1,7 +1,7 @@ # The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: clusterconfigurations.config.projectsveltos.io +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# annotations: +# cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) +# name: clusterconfigurations.config.projectsveltos.io diff --git a/config/crd/patches/cainjection_in_clusterprofiles.yaml b/config/crd/patches/cainjection_in_clusterprofiles.yaml index 6ae8b035..7521de0a 100644 --- a/config/crd/patches/cainjection_in_clusterprofiles.yaml +++ b/config/crd/patches/cainjection_in_clusterprofiles.yaml @@ -1,7 +1,7 @@ # The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert # this is hardcoded with conversion-webhook repo - name: clusterprofiles.config.projectsveltos.io +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# annotations: +# cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert # this is hardcoded with conversion-webhook repo +# name: clusterprofiles.config.projectsveltos.io diff --git a/config/crd/patches/cainjection_in_clusterreports.yaml b/config/crd/patches/cainjection_in_clusterreports.yaml index 018c1665..3d2878d2 100644 --- a/config/crd/patches/cainjection_in_clusterreports.yaml +++ b/config/crd/patches/cainjection_in_clusterreports.yaml @@ -1,7 +1,7 @@ # The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: clusterreports.config.projectsveltos.io +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# annotations: +# cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) +# name: clusterreports.config.projectsveltos.io diff --git a/config/crd/patches/cainjection_in_clustersummaries.yaml b/config/crd/patches/cainjection_in_clustersummaries.yaml index 4478b0f4..52f9a792 100644 --- a/config/crd/patches/cainjection_in_clustersummaries.yaml +++ b/config/crd/patches/cainjection_in_clustersummaries.yaml @@ -1,7 +1,7 @@ # The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert # this is hardcoded with conversion-webhook repo - name: clustersummaries.config.projectsveltos.io +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# annotations: +# cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert # this is hardcoded with conversion-webhook repo +# name: clustersummaries.config.projectsveltos.io diff --git a/config/crd/patches/cainjection_in_profiles.yaml b/config/crd/patches/cainjection_in_profiles.yaml index e1669875..820577a4 100644 --- a/config/crd/patches/cainjection_in_profiles.yaml +++ b/config/crd/patches/cainjection_in_profiles.yaml @@ -1,7 +1,7 @@ # The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert # this is hardcoded with conversion-webhook repo - name: profiles.config.projectsveltos.io +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# annotations: +# cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert # this is hardcoded with conversion-webhook repo +# name: profiles.config.projectsveltos.io diff --git a/config/crd/patches/webhook_in_clusterconfigurations.yaml b/config/crd/patches/webhook_in_clusterconfigurations.yaml index 9ca00b07..d14a800d 100644 --- a/config/crd/patches/webhook_in_clusterconfigurations.yaml +++ b/config/crd/patches/webhook_in_clusterconfigurations.yaml @@ -1,16 +1,16 @@ # The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: clusterconfigurations.config.projectsveltos.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: projectsveltos - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# name: clusterconfigurations.config.projectsveltos.io +#spec: +# conversion: +# strategy: Webhook +# webhook: +# clientConfig: +# service: +# namespace: projectsveltos +# name: webhook-service +# path: /convert +# conversionReviewVersions: +# - v1 diff --git a/config/crd/patches/webhook_in_clusterprofiles.yaml b/config/crd/patches/webhook_in_clusterprofiles.yaml index 66b37e42..7af49da8 100644 --- a/config/crd/patches/webhook_in_clusterprofiles.yaml +++ b/config/crd/patches/webhook_in_clusterprofiles.yaml @@ -1,16 +1,16 @@ # The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: clusterprofiles.config.projectsveltos.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: projectsveltos - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# name: clusterprofiles.config.projectsveltos.io +#spec: +# conversion: +# strategy: Webhook +# webhook: +# clientConfig: +# service: +# namespace: projectsveltos +# name: webhook-service +# path: /convert +# conversionReviewVersions: +# - v1 diff --git a/config/crd/patches/webhook_in_clusterreports.yaml b/config/crd/patches/webhook_in_clusterreports.yaml index 640cb050..0bd2df00 100644 --- a/config/crd/patches/webhook_in_clusterreports.yaml +++ b/config/crd/patches/webhook_in_clusterreports.yaml @@ -1,16 +1,16 @@ # The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: clusterreports.config.projectsveltos.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: projectsveltos - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# name: clusterreports.config.projectsveltos.io +#spec: +# conversion: +# strategy: Webhook +# webhook: +# clientConfig: +# service: +# namespace: projectsveltos +# name: webhook-service +# path: /convert +# conversionReviewVersions: +# - v1 diff --git a/config/crd/patches/webhook_in_clustersummaries.yaml b/config/crd/patches/webhook_in_clustersummaries.yaml index a611b20a..7c119070 100644 --- a/config/crd/patches/webhook_in_clustersummaries.yaml +++ b/config/crd/patches/webhook_in_clustersummaries.yaml @@ -1,16 +1,16 @@ # The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: clustersummaries.config.projectsveltos.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: projectsveltos - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# name: clustersummaries.config.projectsveltos.io +#spec: +# conversion: +# strategy: Webhook +# webhook: +# clientConfig: +# service: +# namespace: projectsveltos +# name: webhook-service +# path: /convert +# conversionReviewVersions: +# - v1 diff --git a/config/crd/patches/webhook_in_profiles.yaml b/config/crd/patches/webhook_in_profiles.yaml index c3bb1fd6..727abfc3 100644 --- a/config/crd/patches/webhook_in_profiles.yaml +++ b/config/crd/patches/webhook_in_profiles.yaml @@ -1,16 +1,16 @@ # The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: profiles.config.projectsveltos.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: projectsveltos - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 +#apiVersion: apiextensions.k8s.io/v1 +#kind: CustomResourceDefinition +#metadata: +# name: profiles.config.projectsveltos.io +#spec: +# conversion: +# strategy: Webhook +# webhook: +# clientConfig: +# service: +# namespace: projectsveltos +# name: webhook-service +# path: /convert +# conversionReviewVersions: +# - v1 diff --git a/go.mod b/go.mod index 78ffc3fb..1e9bbded 100644 --- a/go.mod +++ b/go.mod @@ -12,12 +12,11 @@ require ( github.com/fluxcd/source-controller/api v1.5.0 github.com/gdexlab/go-render v1.0.1 github.com/go-logr/logr v1.4.2 - github.com/google/gofuzz v1.2.0 github.com/hexops/gotextdiff v1.0.3 github.com/onsi/ginkgo/v2 v2.22.2 github.com/onsi/gomega v1.36.2 github.com/pkg/errors v0.9.1 - github.com/projectsveltos/libsveltos v0.48.2-0.20250223075846-d9184ce7344f + github.com/projectsveltos/libsveltos v0.48.2-0.20250224110739-f8a50667ac1f github.com/prometheus/client_golang v1.21.0 github.com/spf13/pflag v1.0.6 github.com/yuin/gopher-lua v1.1.1 @@ -92,6 +91,7 @@ require ( github.com/google/cel-go v0.22.1 // indirect github.com/google/gnostic-models v0.6.9 // indirect github.com/google/go-cmp v0.6.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.6.0 // indirect diff --git a/go.sum b/go.sum index aca94fec..a0e5916c 100644 --- a/go.sum +++ b/go.sum @@ -327,8 +327,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg= -github.com/projectsveltos/libsveltos v0.48.2-0.20250223075846-d9184ce7344f h1:QyRB2GW8b2D4d9a5fT8spSSW5NzDzOdz/cQsg7toehs= -github.com/projectsveltos/libsveltos v0.48.2-0.20250223075846-d9184ce7344f/go.mod h1:9z2AUhSE2qzi+m5tqeQUMm+c4whMtbKH6oYOYY+0tbw= +github.com/projectsveltos/libsveltos v0.48.2-0.20250224110739-f8a50667ac1f h1:jwtX2RoBwqnqwcnO5KvnMlqbJlJzeb6dLQmzcBpA1+M= +github.com/projectsveltos/libsveltos v0.48.2-0.20250224110739-f8a50667ac1f/go.mod h1:uc/2nGMXfx8rJveOrmNN7yU2oJ+Qc7Wg8Z1VH9AreOg= github.com/projectsveltos/lua-utils/glua-json v0.0.0-20250215155204-2e8364e9ce73 h1:Sgh71mZil6CXZXcRPrzfl7XuetK+CyvruWOajU95qhs= github.com/projectsveltos/lua-utils/glua-json v0.0.0-20250215155204-2e8364e9ce73/go.mod h1:AIzg+JWbfrFWazyM5Ka2fX69r9aFr3+o2Mvn9SfKDYU= github.com/projectsveltos/lua-utils/glua-runes v0.0.0-20250215155204-2e8364e9ce73 h1:VdjrXW3hU6JPP9kUtUC6K8ulW82uAjPyiMKf4iJGIXg= diff --git a/manifest/manifest.yaml b/manifest/manifest.yaml index 35e00573..24bac0cb 100644 --- a/manifest/manifest.yaml +++ b/manifest/manifest.yaml @@ -18,7 +18,7 @@ spec: singular: clusterconfiguration scope: Namespaced versions: - - name: v1alpha1 + - name: v1beta1 schema: openAPIV3Schema: description: ClusterConfiguration is the Schema for the clusterconfigurations @@ -390,14 +390,29 @@ spec: type: object type: object served: true - storage: false + storage: true subresources: status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.17.2 + name: clusterprofiles.config.projectsveltos.io +spec: + group: config.projectsveltos.io + names: + kind: ClusterProfile + listKind: ClusterProfileList + plural: clusterprofiles + singular: clusterprofile + scope: Cluster + versions: - name: v1beta1 schema: openAPIV3Schema: - description: ClusterConfiguration is the Schema for the clusterconfigurations - API + description: ClusterProfile is the Schema for the clusterprofiles API properties: apiVersion: description: |- @@ -416,475 +431,184 @@ spec: type: string metadata: type: object - status: - description: ClusterConfigurationStatus defines the observed state of - ClusterConfiguration + spec: properties: - clusterProfileResources: - description: |- - ClusterProfileResources is the list of resources currently deployed in a Cluster due - to ClusterProfiles + clusterRefs: + description: ClusterRefs identifies clusters to associate to. items: - description: |- - ClusterProfileResource keeps info on all of the resources deployed in this Cluster - due to a given ClusterProfile + description: ObjectReference contains enough information to let + you inspect or modify the referred object. properties: - Features: + apiVersion: + description: API version of the referent. + type: string + fieldPath: description: |- - Features contains the list of policies deployed in the Cluster because - of a given feature - items: - properties: - charts: - description: Charts is a list of helm charts deployed - in the Cluster. - items: - properties: - appVersion: - description: AppVersion is the version of the app - deployed in the Cluster. - type: string - chartVersion: - description: ChartVersion is the version of the - helm chart deployed in the Cluster. - type: string - icon: - description: The URL to an icon file. - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this - resource was last applied to the cluster. - format: date-time - type: string - namespace: - description: Namespace where chart is deployed in - the Cluster. - type: string - releaseName: - description: ReleaseName name of the release deployed - in the Cluster. - minLength: 1 - type: string - repoURL: - description: |- - RepoURL URL of the repo containing the helm chart deployed - in the Cluster. - minLength: 1 - type: string - required: - - chartVersion - - lastAppliedTime - - releaseName - - repoURL - type: object - type: array - featureID: - description: FeatureID is an indentifier of the feature - whose status is reported - enum: - - Resources - - Helm - - Kustomize - type: string - resources: - description: Resources is a list of resources deployed - in the Cluster. - items: - properties: - group: - description: Group of the resource deployed in the - Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the - Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this - resource was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the - Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret - containing this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in - the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - type: array - required: - - featureID - type: object - type: array - clusterProfileName: - description: ProfileName is the name of the ClusterProfile matching - the Cluster. + If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would take on a value like: + "spec.containers{name}" (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined way of + referencing a part of an object. + type: string + kind: + description: |- + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + namespace: + description: |- + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + type: string + resourceVersion: + description: |- + Specific resourceVersion to which this reference is made, if any. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + type: string + uid: + description: |- + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids type: string - required: - - clusterProfileName type: object + x-kubernetes-map-type: atomic type: array - profileResources: - description: |- - ProfileResources is the list of resources currently deployed in a Cluster due - to Profiles - items: - description: |- - ProfileResource keeps info on all of the resources deployed in this Cluster - due to a given Profile - properties: - Features: + clusterSelector: + description: ClusterSelector identifies clusters to associate to. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: description: |- - Features contains the list of policies deployed in the Cluster because - of a given feature - items: - properties: - charts: - description: Charts is a list of helm charts deployed - in the Cluster. - items: - properties: - appVersion: - description: AppVersion is the version of the app - deployed in the Cluster. - type: string - chartVersion: - description: ChartVersion is the version of the - helm chart deployed in the Cluster. - type: string - icon: - description: The URL to an icon file. - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this - resource was last applied to the cluster. - format: date-time - type: string - namespace: - description: Namespace where chart is deployed in - the Cluster. - type: string - releaseName: - description: ReleaseName name of the release deployed - in the Cluster. - minLength: 1 - type: string - repoURL: - description: |- - RepoURL URL of the repo containing the helm chart deployed - in the Cluster. - minLength: 1 - type: string - required: - - chartVersion - - lastAppliedTime - - releaseName - - repoURL - type: object - type: array - featureID: - description: FeatureID is an indentifier of the feature - whose status is reported - enum: - - Resources - - Helm - - Kustomize + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: type: string - resources: - description: Resources is a list of resources deployed - in the Cluster. - items: - properties: - group: - description: Group of the resource deployed in the - Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the - Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this - resource was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the - Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret - containing this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in - the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - type: array - required: - - featureID - type: object - type: array - profileName: - description: ProfileName is the name of the Profile matching - the Cluster. + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: type: string - required: - - profileName - type: object - type: array - type: object - type: object - served: true - storage: true - subresources: - status: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.17.2 - name: clusterprofiles.config.projectsveltos.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - name: webhook-service - namespace: projectsveltos - path: /convert - conversionReviewVersions: - - v1 - group: config.projectsveltos.io - names: - kind: ClusterProfile - listKind: ClusterProfileList - plural: clusterprofiles - singular: clusterprofile - scope: Cluster - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ClusterProfile is the Schema for the clusterprofiles API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - properties: - clusterRefs: - description: ClusterRefs identifies clusters to associate to. + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + continueOnConflict: + default: false + description: |- + By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after + encountering the first conflict (e.g., another ClusterProfile already deployed the resource). + If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even + if conflicts are detected for previous resources. + type: boolean + continueOnError: + default: false + description: |- + By default (when ContinueOnError is unset or set to false), Sveltos stops deployment after + encountering the first error. + If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even + if errors are detected for previous resources. + type: boolean + dependsOn: + description: |- + DependsOn specifies a list of other ClusterProfiles that this instance depends on. + In any managed cluster that matches this ClusterProfile, the add-ons and applications + defined in this instance will not be deployed until all add-ons and applications in the + ClusterProfiles listed as dependencies are deployed. items: - description: ObjectReference contains enough information to let - you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic + type: string type: array - clusterSelector: - description: ClusterSelector identifies clusters to associate to. - type: string - continueOnConflict: - default: false - description: |- - By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after - encountering the first conflict (e.g., another ClusterProfile already deployed the resource). - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if conflicts are detected for previous resources. - type: boolean - dependsOn: + driftExclusions: description: |- - DependsOn specifies a list of other ClusterProfiles that this instance depends on. - In any managed cluster that matches this ClusterProfile, the add-ons and applications - defined in this instance will not be deployed until all add-ons and applications in the - ClusterProfiles listed as dependencies are deployed. + DriftExclusions is a list of configuration drift exclusions to be applied when syncMode is + set to ContinuousWithDriftDetection. Each exclusion specifies JSON6902 paths to ignore + when evaluating drift, optionally targeting specific resources and features. items: - type: string + properties: + paths: + description: Paths is a slice of JSON6902 paths to exclude from + configuration drift evaluation. + items: + type: string + type: array + target: + description: Target points to the resources that the paths refers + to. + properties: + annotationSelector: + description: |- + AnnotationSelector is a string that follows the label selection expression + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api + It matches with the resource annotations. + type: string + group: + description: |- + Group is the API group to select resources from. + Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + kind: + description: |- + Kind of the API Group to select resources from. + Together with Group and Version it is capable of unambiguously + identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + labelSelector: + description: |- + LabelSelector is a string that follows the label selection expression + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api + It matches with the resource labels. + type: string + name: + description: Name to match resources with. + type: string + namespace: + description: Namespace to select resources from. + type: string + version: + description: |- + Version of the API Group to select resources from. + Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + type: object + required: + - paths + type: object type: array extraAnnotations: additionalProperties: @@ -894,6 +618,7 @@ spec: deployed in a managed cluster based on this ClusterProfile/Profile instance. **Important:** If a resource deployed by Sveltos already has a annotation with a key present in `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. + (Deprecated use Patches instead) type: object extraLabels: additionalProperties: @@ -903,6 +628,7 @@ spec: a managed cluster based on this ClusterProfile/Profile instance. **Important:** If a resource deployed by Sveltos already has a label with a key present in `ExtraLabels`, the value from `ExtraLabels` will override the existing value. + (Deprecated use Patches instead) type: object helmCharts: description: Helm charts is a list of helm charts that need to be @@ -972,6 +698,14 @@ spec: description: Create the release namespace if not present. Defaults to true type: boolean + disableHooks: + default: false + description: |- + prevent hooks from running during install. If set to true, overrides + DisableHooks in HelmOptions. Use this one when you want to selective + disable hooks on install + Default to false + type: boolean replace: default: true description: Replaces if set indicates to replace an @@ -1009,6 +743,14 @@ spec: - foreground - background type: string + disableHooks: + default: false + description: |- + prevent hooks from running during install. If set to true, overrides + DisableHooks in HelmOptions. Use this one when you want to selective + disable hooks on uninstall + Default to false + type: boolean keepHistory: description: |- When uninstall a chart with this flag, Helm removes the resources associated with the chart, @@ -1026,6 +768,14 @@ spec: upgrade to delete newly-created resources on a failed update. type: boolean + disableHooks: + default: false + description: |- + prevent hooks from running during install. If set to true, overrides + DisableHooks in HelmOptions. Use this one when you want to selective + disable hooks on upgrade + Default to false + type: boolean force: default: false description: |- @@ -1091,6 +841,58 @@ spec: Default to false type: boolean type: object + registryCredentialsConfig: + description: |- + RegistryCredentialsConfig is an optional configuration for credentials, + including information to connect to private registries. + properties: + ca: + description: |- + CASecretRef references a secret containing the TLS CA certificate + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + key: ca.crt + properties: + name: + description: name is unique within a namespace to reference + a secret resource. + type: string + namespace: + description: namespace defines the space within which + the secret name must be unique. + type: string + type: object + x-kubernetes-map-type: atomic + credentials: + description: |- + CredentialsSecretRef references a secret containing credentials + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + properties: + name: + description: name is unique within a namespace to reference + a secret resource. + type: string + namespace: + description: namespace defines the space within which + the secret name must be unique. + type: string + type: object + x-kubernetes-map-type: atomic + insecureSkipTLSVerify: + description: InsecureSkipTLSVerify controls server certificate + verification. + type: boolean + key: + description: |- + Key specifies the key within the CredentialsSecretRef containing the data + If not specified, it defaults to the only key in the secret if there's just one. + type: string + plainHTTP: + description: PlainHTTP indicates to use insecure HTTP connections + for the chart download + type: boolean + type: object releaseName: description: ReleaseName is the chart release minLength: 1 @@ -1113,7 +915,7 @@ spec: Values field allows to define configuration for the Helm release. These values can be static or leverage Go templates for dynamic customization. When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. + resources within the management cluster before deployment (Cluster and TemplateResourceRefs) type: string valuesFrom: description: |- @@ -1121,7 +923,7 @@ spec: it is possible to store configuration for the Helm release. These values can be static or leverage Go templates for dynamic customization. When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. + resources within the management cluster before deployment (Cluster and TemplateResourceRefs) items: properties: kind: @@ -1133,7 +935,12 @@ spec: - Secret type: string name: - description: Name of the referenced resource. + description: |- + Name of the referenced resource. + Name can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind minLength: 1 type: string namespace: @@ -1146,7 +953,6 @@ spec: required: - kind - name - - namespace type: object type: array required: @@ -1186,7 +992,12 @@ spec: - Secret type: string name: - description: Name of the referenced resource. + description: |- + Name of the referenced resource. + Name can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind minLength: 1 type: string namespace: @@ -1201,6 +1012,9 @@ spec: Path to the directory containing the kustomization.yaml file, or the set of plain YAMLs a kustomization.yaml should be generated for. Defaults to 'None', which translates to the root path of the SourceRef. + These values can be static or leverage Go templates for dynamic customization. + When expressed as templates, the values are filled in using information from + resources within the management cluster before deployment (Cluster) type: string targetNamespace: description: |- @@ -1256,7 +1070,12 @@ spec: - Secret type: string name: - description: Name of the referenced resource. + description: |- + Name of the referenced resource. + Name can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind minLength: 1 type: string namespace: @@ -1269,7 +1088,6 @@ spec: required: - kind - name - - namespace type: object type: array required: @@ -1278,6 +1096,13 @@ spec: - namespace type: object type: array + maxConsecutiveFailures: + description: |- + The maximum number of consecutive deployment failures that Sveltos will permit. + After this many consecutive failures, the deployment will be considered failed, and Sveltos will stop retrying. + This setting applies only to feature deployments, not resource removal. + This field is optional. If not set, Sveltos default behavior is to keep retrying. + type: integer maxUpdate: anyOf: - type: integer @@ -1291,35 +1116,106 @@ spec: in those cluster succeed, other matching clusters are updated. pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ x-kubernetes-int-or-string: true - policyRefs: + patches: description: |- - PolicyRefs references all the ConfigMaps/Secrets containing kubernetes resources - that need to be deployed in the matching CAPI clusters. + Define additional Kustomize inline Patches applied for all resources on this profile + Within the Patch Spec you can use templating items: + description: |- + Patch contains an inline StrategicMerge or JSON6902 patch, and the target the patch should + be applied to. properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: + patch: description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - - flux GitRepository;OCIRepository;Bucket - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret + Patch contains an inline StrategicMerge patch or an inline JSON6902 patch with + an array of operation objects. + These values can be static or leverage Go templates for dynamic customization. + When expressed as templates, the values are filled in using information from + resources within the management cluster before deployment (Cluster and TemplateResourceRefs) + type: string + target: + description: Target points to the resources that the patch document + should be applied to. + properties: + annotationSelector: + description: |- + AnnotationSelector is a string that follows the label selection expression + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api + It matches with the resource annotations. + type: string + group: + description: |- + Group is the API group to select resources from. + Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + kind: + description: |- + Kind of the API Group to select resources from. + Together with Group and Version it is capable of unambiguously + identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + labelSelector: + description: |- + LabelSelector is a string that follows the label selection expression + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api + It matches with the resource labels. + type: string + name: + description: Name to match resources with. + type: string + namespace: + description: Namespace to select resources from. + type: string + version: + description: |- + Version of the API Group to select resources from. + Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + type: object + required: + - patch + type: object + type: array + policyRefs: + description: |- + PolicyRefs references all the ConfigMaps/Secrets/Flux Sources containing kubernetes resources + that need to be deployed in the matching managed clusters. + The values contained in those resources can be static or leverage Go templates for dynamic customization. + When expressed as templates, the values are filled in using information from + resources within the management cluster before deployment (Cluster and TemplateResourceRefs) + items: + properties: + deploymentType: + default: Remote + description: |- + DeploymentType indicates whether resources need to be deployed + into the management cluster (local) or the managed cluster (remote) + enum: + - Local + - Remote + type: string + kind: + description: |- + Kind of the resource. Supported kinds are: + - ConfigMap/Secret + - flux GitRepository;OCIRepository;Bucket + enum: + - GitRepository + - OCIRepository + - Bucket + - ConfigMap + - Secret type: string name: - description: Name of the referenced resource. + description: |- + Name of the referenced resource. + Name can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind minLength: 1 type: string namespace: @@ -1393,8 +1289,7 @@ spec: templateResourceRefs: description: |- TemplateResourceRefs is a list of resource to collect from the management cluster. - Those resources' values will be used to instantiate templates contained in referenced - PolicyRefs and Helm charts + Those resources' values will be used to instantiate templates items: properties: identifier: @@ -1406,6 +1301,12 @@ spec: description: |- Resource references a Kubernetes instance in the management cluster to fetch and use during template instantiation. + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + Name and namespace can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind properties: apiVersion: description: API version of the referent. @@ -1729,13 +1630,29 @@ spec: type: object type: object served: true - storage: false + storage: true subresources: status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.17.2 + name: clusterreports.config.projectsveltos.io +spec: + group: config.projectsveltos.io + names: + kind: ClusterReport + listKind: ClusterReportList + plural: clusterreports + singular: clusterreport + scope: Namespaced + versions: - name: v1beta1 schema: openAPIV3Schema: - description: ClusterProfile is the Schema for the clusterprofiles API + description: ClusterReport is the Schema for the clusterreports API properties: apiVersion: description: |- @@ -1755,5003 +1672,1565 @@ spec: metadata: type: object spec: + description: ClusterReportSpec defines the desired state of ClusterReport properties: - clusterRefs: - description: ClusterRefs identifies clusters to associate to. + clusterName: + description: |- + ClusterName is the name of the CAPI Cluster this ClusterReport + is for. + type: string + clusterNamespace: + description: |- + ClusterNamespace is the namespace of the CAPI Cluster this + ClusterReport is for. + type: string + required: + - clusterName + - clusterNamespace + type: object + status: + description: ClusterReportStatus defines the observed state of ClusterReport + properties: + kustomizeResourceReports: + description: |- + KustomizeResourceReports contains report on Kubernetes resources + deployed because of KustomizationRefs items: - description: ObjectReference contains enough information to let - you inspect or modify the referred object. properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + action: + description: Action represent the type of operation on the Kubernetes + resource. + enum: + - No Action + - Create + - Update + - Delete + - Conflict type: string - uid: + message: description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + Message is for any message that needs to added to better + explain the action. type: string - type: object - x-kubernetes-map-type: atomic - type: array - clusterSelector: - description: ClusterSelector identifies clusters to associate to. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. + resource: + description: Resource contains information about Kubernetes + Resource properties: - key: - description: key is the label key that the selector applies - to. + group: + description: Group of the resource deployed in the Cluster. type: string - operator: + ignoreForConfigurationDrift: + default: false description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. + IgnoreForConfigurationDrift indicates to not track resource + for configuration drift detection. + This field has a meaning only when mode is ContinuousWithDriftDetection + type: boolean + kind: + description: Kind of the resource deployed in the Cluster. + minLength: 1 type: string - values: + lastAppliedTime: + description: LastAppliedTime identifies when this resource + was last applied to the cluster. + format: date-time + type: string + name: + description: Name of the resource deployed in the Cluster. + minLength: 1 + type: string + namespace: description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - continueOnConflict: - default: false - description: |- - By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after - encountering the first conflict (e.g., another ClusterProfile already deployed the resource). - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if conflicts are detected for previous resources. - type: boolean - continueOnError: - default: false - description: |- - By default (when ContinueOnError is unset or set to false), Sveltos stops deployment after - encountering the first error. - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if errors are detected for previous resources. - type: boolean - dependsOn: - description: |- - DependsOn specifies a list of other ClusterProfiles that this instance depends on. - In any managed cluster that matches this ClusterProfile, the add-ons and applications - defined in this instance will not be deployed until all add-ons and applications in the - ClusterProfiles listed as dependencies are deployed. - items: - type: string - type: array - driftExclusions: - description: |- - DriftExclusions is a list of configuration drift exclusions to be applied when syncMode is - set to ContinuousWithDriftDetection. Each exclusion specifies JSON6902 paths to ignore - when evaluating drift, optionally targeting specific resources and features. - items: - properties: - paths: - description: Paths is a slice of JSON6902 paths to exclude from - configuration drift evaluation. - items: - type: string - type: array - target: - description: Target points to the resources that the paths refers - to. - properties: - annotationSelector: - description: |- - AnnotationSelector is a string that follows the label selection expression - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api - It matches with the resource annotations. - type: string - group: - description: |- - Group is the API group to select resources from. - Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - kind: - description: |- - Kind of the API Group to select resources from. - Together with Group and Version it is capable of unambiguously - identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - labelSelector: - description: |- - LabelSelector is a string that follows the label selection expression - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api - It matches with the resource labels. - type: string - name: - description: Name to match resources with. - type: string - namespace: - description: Namespace to select resources from. + Namespace of the resource deployed in the Cluster. + Empty for resources scoped at cluster level. type: string + owner: + description: Owner is the list of ConfigMap/Secret containing + this resource. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: |- + If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would take on a value like: + "spec.containers{name}" (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined way of + referencing a part of an object. + type: string + kind: + description: |- + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + namespace: + description: |- + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + type: string + resourceVersion: + description: |- + Specific resourceVersion to which this reference is made, if any. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + type: string + uid: + description: |- + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + type: string + type: object + x-kubernetes-map-type: atomic version: - description: |- - Version of the API Group to select resources from. - Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + description: Version of the resource deployed in the Cluster. + minLength: 1 type: string + required: + - group + - kind + - name + - owner + - version type: object required: - - paths + - resource type: object type: array - extraAnnotations: - additionalProperties: - type: string - description: |- - ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources - deployed in a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a annotation with a key present in - `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. - (Deprecated use Patches instead) - type: object - extraLabels: - additionalProperties: - type: string - description: |- - ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in - a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a label with a key present in - `ExtraLabels`, the value from `ExtraLabels` will override the existing value. - (Deprecated use Patches instead) - type: object - helmCharts: - description: Helm charts is a list of helm charts that need to be - deployed + releaseReports: + description: ReleaseReports contains report on helm releases items: properties: + action: + description: Action represent the type of operation on the Helm + Chart + enum: + - No Action + - Install + - Upgrade + - Delete + - Conflict + - Update Values + type: string chartName: - description: ChartName is the chart name + description: ReleaseName of the release deployed in the CAPI + Cluster. minLength: 1 type: string chartVersion: - description: ChartVersion is the chart version + description: |- + ChartVersion is the version of the helm chart deployed + in the CAPI Cluster. + type: string + message: + description: |- + Message is for any message that needs to added to better + explain the action. + type: string + releaseNamespace: + description: Namespace where release is deployed in the CAPI + Cluster. minLength: 1 type: string - helmChartAction: - default: Install - description: HelmChartAction is the action that will be taken - on the helm chart + required: + - chartName + - chartVersion + - releaseNamespace + type: object + type: array + resourceReports: + description: |- + ResourceReports contains report on Kubernetes resources + deployed because of PolicyRefs + items: + properties: + action: + description: Action represent the type of operation on the Kubernetes + resource. enum: - - Install - - Uninstall + - No Action + - Create + - Update + - Delete + - Conflict type: string - options: - description: Options allows to set flags which are used during - installation. + message: + description: |- + Message is for any message that needs to added to better + explain the action. + type: string + resource: + description: Resource contains information about Kubernetes + Resource properties: - atomic: - default: false - description: |- - if set, the installation process deletes the installation/upgrades on failure. - The --wait flag will be set automatically if --atomic is used - Default to false - type: boolean - dependencyUpdate: - default: false - description: |- - update dependencies if they are missing before installing the chart - Default to false - type: boolean - description: - description: Description is the description of an helm operation + group: + description: Group of the resource deployed in the Cluster. type: string - disableHooks: + ignoreForConfigurationDrift: default: false description: |- - prevent hooks from running during install/upgrade/uninstall - Default to false + IgnoreForConfigurationDrift indicates to not track resource + for configuration drift detection. + This field has a meaning only when mode is ContinuousWithDriftDetection type: boolean - disableOpenAPIValidation: - default: false + kind: + description: Kind of the resource deployed in the Cluster. + minLength: 1 + type: string + lastAppliedTime: + description: LastAppliedTime identifies when this resource + was last applied to the cluster. + format: date-time + type: string + name: + description: Name of the resource deployed in the Cluster. + minLength: 1 + type: string + namespace: description: |- - if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema - Default to false - type: boolean - enableClientCache: - default: false - description: EnableClientCache is a flag to enable Helm - client cache. If it is not specified, it will be set to - false. - type: boolean - installOptions: - description: HelmInstallOptions are options specific to - helm install - properties: - createNamespace: - default: true - description: Create the release namespace if not present. - Defaults to true - type: boolean - disableHooks: - default: false - description: |- - prevent hooks from running during install. If set to true, overrides - DisableHooks in HelmOptions. Use this one when you want to selective - disable hooks on install - Default to false - type: boolean - replace: - default: true - description: Replaces if set indicates to replace an - older release with this one - type: boolean - type: object - labels: - additionalProperties: - type: string - description: Labels that would be added to release metadata. - type: object - skipCRDs: - default: false - description: |- - SkipCRDs controls whether CRDs should be installed during install/upgrade operation. - By default, CRDs are installed if not already present. - type: boolean - skipSchemaValidation: - default: false - description: SkipSchemaValidation determines if JSON schema - validation is disabled. - type: boolean - timeout: - description: time to wait for any individual Kubernetes - operation (like Jobs for hooks) (default 5m0s) + Namespace of the resource deployed in the Cluster. + Empty for resources scoped at cluster level. type: string - uninstallOptions: - description: HelmUninstallOptions are options specific to - helm uninstall + owner: + description: Owner is the list of ConfigMap/Secret containing + this resource. properties: - deletionPropagation: - description: DeletionPropagation - enum: - - orphan - - foreground - - background + apiVersion: + description: API version of the referent. type: string - disableHooks: - default: false - description: |- - prevent hooks from running during install. If set to true, overrides - DisableHooks in HelmOptions. Use this one when you want to selective - disable hooks on uninstall - Default to false - type: boolean - keepHistory: - description: |- - When uninstall a chart with this flag, Helm removes the resources associated with the chart, - but it keeps the release information. This allows to see details about the uninstalled release - using the helm history command. - type: boolean - type: object - upgradeOptions: - description: HelmUpgradeOptions are options specific to - helm upgrade - properties: - cleanupOnFail: - default: false - description: CleanupOnFail will, if true, cause the - upgrade to delete newly-created resources on a failed - update. - type: boolean - disableHooks: - default: false - description: |- - prevent hooks from running during install. If set to true, overrides - DisableHooks in HelmOptions. Use this one when you want to selective - disable hooks on upgrade - Default to false - type: boolean - force: - default: false - description: |- - Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway. - This should be used with caution. - type: boolean - maxHistory: - default: 2 - description: |- - MaxHistory limits the maximum number of revisions saved per release - Default to 2 - type: integer - recreate: - default: false - description: Recreate will (if true) recreate pods after - a rollback. - type: boolean - resetThenReuseValues: - default: false - description: ResetThenReuseValues will reset the values - to the chart's built-ins then merge with user's last - supplied values. - type: boolean - resetValues: - default: false - description: ResetValues will reset the values to the - chart's built-ins rather than merging with existing. - type: boolean - reuseValues: - default: false + fieldPath: description: |- - ReuseValues copies values from the current release to a new release if the - new release does not have any values. If the request already has values, - or if there are no values in the current release, this does nothing. - This is skipped if the ResetValues flag is set, in which case the - request values are not altered. - type: boolean - subNotes: - default: false - description: SubNotes determines whether sub-notes are - rendered in the chart. - type: boolean - upgradeCRDs: - default: false + If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would take on a value like: + "spec.containers{name}" (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined way of + referencing a part of an object. + type: string + kind: description: |- - UpgradeCRDs upgrade CRDs from the Helm Chart's crds directory - By default, CRDs are not applied during Helm upgrade action by Helm - https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ - type: boolean - type: object - wait: - default: false - description: |- - if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet - are in a ready state before marking the release as successful. It will wait for as long as --timeout - Default to false - type: boolean - waitForJobs: - default: false - description: |- - if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. - It will wait for as long as --timeout - Default to false - type: boolean - type: object - registryCredentialsConfig: - description: |- - RegistryCredentialsConfig is an optional configuration for credentials, - including information to connect to private registries. - properties: - ca: - description: |- - CASecretRef references a secret containing the TLS CA certificate - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - key: ca.crt - properties: + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string name: - description: name is unique within a namespace to reference - a secret resource. + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string namespace: - description: namespace defines the space within which - the secret name must be unique. + description: |- + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ type: string - type: object - x-kubernetes-map-type: atomic - credentials: - description: |- - CredentialsSecretRef references a secret containing credentials - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - properties: - name: - description: name is unique within a namespace to reference - a secret resource. + resourceVersion: + description: |- + Specific resourceVersion to which this reference is made, if any. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency type: string - namespace: - description: namespace defines the space within which - the secret name must be unique. + uid: + description: |- + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids type: string type: object x-kubernetes-map-type: atomic - insecureSkipTLSVerify: - description: InsecureSkipTLSVerify controls server certificate - verification. - type: boolean - key: - description: |- - Key specifies the key within the CredentialsSecretRef containing the data - If not specified, it defaults to the only key in the secret if there's just one. + version: + description: Version of the resource deployed in the Cluster. + minLength: 1 type: string - plainHTTP: - description: PlainHTTP indicates to use insecure HTTP connections - for the chart download - type: boolean + required: + - group + - kind + - name + - owner + - version type: object - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - repositoryName: - description: RepositoryName is the name helm chart repository - minLength: 1 - type: string - repositoryURL: - description: RepositoryURL is the URL helm chart repository - minLength: 1 - type: string - values: - description: |- - Values field allows to define configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster and TemplateResourceRefs) - type: string - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to store configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster and TemplateResourceRefs) - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: |- - Name of the referenced resource. - Name can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - type: object - type: array required: - - chartName - - chartVersion - - releaseName - - releaseNamespace - - repositoryName - - repositoryURL + - resource type: object type: array - kustomizationRefs: + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.17.2 + name: clustersummaries.config.projectsveltos.io +spec: + group: config.projectsveltos.io + names: + kind: ClusterSummary + listKind: ClusterSummaryList + plural: clustersummaries + singular: clustersummary + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Time duration since creation of ClusterSummary + jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Indicates whether HelmCharts are all provisioned + jsonPath: .status.featureSummaries[?(@.featureID=="Helm")].status + name: HelmCharts + priority: 2 + type: string + - description: Indicates whether KustomizeRefs are all provisioned + jsonPath: .status.featureSummaries[?(@.featureID=="Kustomize")].status + name: KustomizeRefs + priority: 2 + type: string + - description: Indicates whether PolicyRefs are all provisioned + jsonPath: .status.featureSummaries[?(@.featureID=="Resources")].status + name: PolicyRefs + priority: 2 + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: ClusterSummary is the Schema for the clustersummaries API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: ClusterSummarySpec defines the desired state of ClusterSummary + properties: + clusterName: + description: ClusterName is the name of the workload Cluster this + ClusterSummary is for. + type: string + clusterNamespace: description: |- - Kustomization refs is a list of kustomization paths. Kustomization will - be run on those paths and the outcome will be deployed. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - flux GitRepository;OCIRepository;Bucket - - ConfigMap/Secret - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: |- - Name of the referenced resource. - Name can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the kustomization.yaml file, or the - set of plain YAMLs a kustomization.yaml should be generated for. - Defaults to 'None', which translates to the root path of the SourceRef. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster) - type: string - targetNamespace: - description: |- - TargetNamespace sets or overrides the namespace in the - kustomization.yaml file. - maxLength: 63 - minLength: 1 - type: string - values: - additionalProperties: - type: string - description: |- - Values is a map[string]string type that allows to define a set of key-value pairs. - These key-value pairs can optionally leverage Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. + ClusterNamespace is the namespace of the workload Cluster this + ClusterSummary is for. + type: string + clusterProfileSpec: + description: |- + ClusterProfileSpec represent the configuration that will be applied to + the workload cluster. + properties: + clusterRefs: + description: ClusterRefs identifies clusters to associate to. + items: + description: ObjectReference contains enough information to + let you inspect or modify the referred object. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: |- + If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would take on a value like: + "spec.containers{name}" (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined way of + referencing a part of an object. + type: string + kind: + description: |- + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + namespace: + description: |- + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + type: string + resourceVersion: + description: |- + Specific resourceVersion to which this reference is made, if any. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + type: string + uid: + description: |- + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + type: string type: object - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to define key-value pairs. These key-value pairs can optionally leverage - Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: |- - Name of the referenced resource. - Name can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name + x-kubernetes-map-type: atomic + type: array + clusterSelector: + description: ClusterSelector identifies clusters to associate + to. + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. type: object - type: array - required: - - kind - - name - - namespace - type: object - type: array - maxConsecutiveFailures: - description: |- - The maximum number of consecutive deployment failures that Sveltos will permit. - After this many consecutive failures, the deployment will be considered failed, and Sveltos will stop retrying. - This setting applies only to feature deployments, not resource removal. - This field is optional. If not set, Sveltos default behavior is to keep retrying. - type: integer - maxUpdate: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of clusters that can be updated concurrently. - Value can be an absolute number (ex: 5) or a percentage of desired cluster (ex: 10%). - Defaults to 100%. - Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile - changes, only 30% of matching clusters will be updated in parallel. Only when updates - in those cluster succeed, other matching clusters are updated. - pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ - x-kubernetes-int-or-string: true - patches: - description: |- - Define additional Kustomize inline Patches applied for all resources on this profile - Within the Patch Spec you can use templating - items: - description: |- - Patch contains an inline StrategicMerge or JSON6902 patch, and the target the patch should - be applied to. - properties: - patch: - description: |- - Patch contains an inline StrategicMerge patch or an inline JSON6902 patch with - an array of operation objects. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster and TemplateResourceRefs) + type: object + x-kubernetes-map-type: atomic + continueOnConflict: + default: false + description: |- + By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after + encountering the first conflict (e.g., another ClusterProfile already deployed the resource). + If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even + if conflicts are detected for previous resources. + type: boolean + continueOnError: + default: false + description: |- + By default (when ContinueOnError is unset or set to false), Sveltos stops deployment after + encountering the first error. + If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even + if errors are detected for previous resources. + type: boolean + dependsOn: + description: |- + DependsOn specifies a list of other ClusterProfiles that this instance depends on. + In any managed cluster that matches this ClusterProfile, the add-ons and applications + defined in this instance will not be deployed until all add-ons and applications in the + ClusterProfiles listed as dependencies are deployed. + items: type: string - target: - description: Target points to the resources that the patch document - should be applied to. + type: array + driftExclusions: + description: |- + DriftExclusions is a list of configuration drift exclusions to be applied when syncMode is + set to ContinuousWithDriftDetection. Each exclusion specifies JSON6902 paths to ignore + when evaluating drift, optionally targeting specific resources and features. + items: properties: - annotationSelector: - description: |- - AnnotationSelector is a string that follows the label selection expression - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api - It matches with the resource annotations. - type: string - group: - description: |- - Group is the API group to select resources from. - Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - kind: - description: |- - Kind of the API Group to select resources from. - Together with Group and Version it is capable of unambiguously - identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - labelSelector: - description: |- - LabelSelector is a string that follows the label selection expression - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api - It matches with the resource labels. - type: string - name: - description: Name to match resources with. - type: string - namespace: - description: Namespace to select resources from. - type: string - version: - description: |- - Version of the API Group to select resources from. - Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string + paths: + description: Paths is a slice of JSON6902 paths to exclude + from configuration drift evaluation. + items: + type: string + type: array + target: + description: Target points to the resources that the paths + refers to. + properties: + annotationSelector: + description: |- + AnnotationSelector is a string that follows the label selection expression + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api + It matches with the resource annotations. + type: string + group: + description: |- + Group is the API group to select resources from. + Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + kind: + description: |- + Kind of the API Group to select resources from. + Together with Group and Version it is capable of unambiguously + identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + labelSelector: + description: |- + LabelSelector is a string that follows the label selection expression + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api + It matches with the resource labels. + type: string + name: + description: Name to match resources with. + type: string + namespace: + description: Namespace to select resources from. + type: string + version: + description: |- + Version of the API Group to select resources from. + Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + type: object + required: + - paths type: object - required: - - patch - type: object - type: array - policyRefs: - description: |- - PolicyRefs references all the ConfigMaps/Secrets/Flux Sources containing kubernetes resources - that need to be deployed in the matching managed clusters. - The values contained in those resources can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster and TemplateResourceRefs) - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - - flux GitRepository;OCIRepository;Bucket - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: |- - Name of the referenced resource. - Name can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the YAML files. - Defaults to 'None', which translates to the root path of the SourceRef. - Used only for GitRepository;OCIRepository;Bucket + type: array + extraAnnotations: + additionalProperties: type: string - required: - - kind - - name - type: object - type: array - reloader: - default: false - description: |- - Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed - by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade - when a ConfigMap/Secret instance mounted as volume is modified. - When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically - starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it. - type: boolean - setRefs: - description: |- - SetRefs identifies referenced (cluster)Sets. - - ClusterProfile can reference ClusterSet; - - Profile can reference Set; - items: - type: string - type: array - stopMatchingBehavior: - default: WithdrawPolicies - description: |- - StopMatchingBehavior indicates what behavior should be when a Cluster stop matching - the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will - be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead - leave ClusterProfile deployed policies in the Cluster. - enum: - - WithdrawPolicies - - LeavePolicies - type: string - syncMode: - default: Continuous - description: |- - SyncMode specifies how features are synced in a matching workload cluster. - - OneTime means, first time a workload cluster matches the ClusterProfile, - features will be deployed in such cluster. Any subsequent feature configuration - change won't be applied into the matching workload clusters; - - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile, - the specified features are deployed. Subsequent changes to the feature configuration are also - automatically applied to all matching workload clusters. - _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors - matching managed clusters for configuration drift. If drift is detected, a reconciliation is - triggered to ensure the managed cluster's configuration aligns with the ClusterProfile. - - DryRun means no change will be propagated to any matching cluster. A report - instead will be generated summarizing what would happen in any matching cluster - because of the changes made to ClusterProfile while in DryRun mode. - enum: - - OneTime - - Continuous - - ContinuousWithDriftDetection - - DryRun - type: string - templateResourceRefs: - description: |- - TemplateResourceRefs is a list of resource to collect from the management cluster. - Those resources' values will be used to instantiate templates - items: - properties: - identifier: - description: |- - Identifier is how the resource will be referred to in the - template + description: |- + ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources + deployed in a managed cluster based on this ClusterProfile/Profile instance. + **Important:** If a resource deployed by Sveltos already has a annotation with a key present in + `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. + (Deprecated use Patches instead) + type: object + extraLabels: + additionalProperties: type: string - resource: - description: |- - Resource references a Kubernetes instance in the management - cluster to fetch and use during template instantiation. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - Name and namespace can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind + description: |- + ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in + a managed cluster based on this ClusterProfile/Profile instance. + **Important:** If a resource deployed by Sveltos already has a label with a key present in + `ExtraLabels`, the value from `ExtraLabels` will override the existing value. + (Deprecated use Patches instead) + type: object + helmCharts: + description: Helm charts is a list of helm charts that need to + be deployed + items: properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + chartName: + description: ChartName is the chart name + minLength: 1 type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + chartVersion: + description: ChartVersion is the chart version + minLength: 1 type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + helmChartAction: + default: Install + description: HelmChartAction is the action that will be + taken on the helm chart + enum: + - Install + - Uninstall type: string - type: object - x-kubernetes-map-type: atomic - required: - - identifier - - resource - type: object - type: array - x-kubernetes-list-map-keys: - - identifier - x-kubernetes-list-type: map - tier: - default: 100 - description: |- - Tier controls the order of deployment for ClusterProfile or Profile resources targeting - the same cluster resources. - Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes - resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it. - Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest** - Tier value takes priority and deploys the resource. - Higher Tier values represent lower priority. The default Tier value is 100. - Using Tiers provides finer control over resource deployment within your cluster, particularly useful - when multiple configurations manage the same resources. - format: int32 - minimum: 1 - type: integer - validateHealths: - description: |- - ValidateHealths is a slice of Lua functions to run against - the managed cluster to validate the state of those add-ons/applications - is healthy - items: - properties: - featureID: - description: |- - FeatureID is an indentifier of the feature (Helm/Kustomize/Resources) - This field indicates when to run this check. - For instance: - - if set to Helm this check will be run after all helm - charts specified in the ClusterProfile are deployed. - - if set to Resources this check will be run after the content - of all the ConfigMaps/Secrets referenced by ClusterProfile in the - PolicyRef sections is deployed - enum: - - Resources - - Helm - - Kustomize - type: string - group: - description: Group of the resource to fetch in the managed Cluster. - type: string - kind: - description: Kind of the resource to fetch in the managed Cluster. - minLength: 1 - type: string - labelFilters: - description: LabelFilters allows to filter resources based on - current labels. - items: - properties: - key: - description: Key is the label key - type: string - operation: - description: Operation is the comparison operation - enum: - - Equal - - Different - type: string - value: - description: Value is the label value - type: string - required: - - key - - operation - - value - type: object - type: array - name: - description: Name is the name of this check - type: string - namespace: - description: |- - Namespace of the resource to fetch in the managed Cluster. - Empty for resources scoped at cluster level. - type: string - script: - description: |- - Script is a text containing a lua script. - Must return struct with field "health" - representing whether object is a match (true or false) - type: string - version: - description: Version of the resource to fetch in the managed - Cluster. - type: string - required: - - featureID - - group - - kind - - name - - version - type: object - type: array - type: object - status: - description: Status defines the observed state of ClusterProfile/Profile - properties: - matchingClusters: - description: |- - MatchingClusterRefs reference all the clusters currently matching - ClusterProfile ClusterSelector - items: - description: ObjectReference contains enough information to let - you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - updatedClusters: - description: |- - UpdatedClusters contains information all the cluster currently matching - ClusterProfile ClusterSelector and already updated to latest ClusterProfile - Spec - properties: - clusters: - description: |- - Clusters reference all the clusters currently matching - ClusterProfile ClusterSelector and already updated/being updated - to ClusterProfile Spec - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - hash: - description: |- - Hash represents of a unique value for ClusterProfile Spec at - a fixed point in time - format: byte - type: string - type: object - updatingClusters: - description: |- - UpdatingClusters reference all the cluster currently matching - ClusterProfile ClusterSelector and being updated - properties: - clusters: - description: |- - Clusters reference all the clusters currently matching - ClusterProfile ClusterSelector and already updated/being updated - to ClusterProfile Spec - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - hash: - description: |- - Hash represents of a unique value for ClusterProfile Spec at - a fixed point in time - format: byte - type: string - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.17.2 - name: clusterreports.config.projectsveltos.io -spec: - group: config.projectsveltos.io - names: - kind: ClusterReport - listKind: ClusterReportList - plural: clusterreports - singular: clusterreport - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ClusterReport is the Schema for the clusterreports API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: ClusterReportSpec defines the desired state of ClusterReport - properties: - clusterName: - description: |- - ClusterName is the name of the CAPI Cluster this ClusterReport - is for. - type: string - clusterNamespace: - description: |- - ClusterNamespace is the namespace of the CAPI Cluster this - ClusterReport is for. - type: string - required: - - clusterName - - clusterNamespace - type: object - status: - description: ClusterReportStatus defines the observed state of ClusterReport - properties: - kustomizeResourceReports: - description: |- - KustomizeResourceReports contains report on Kubernetes resources - deployed because of KustomizationRefs - items: - properties: - action: - description: Action represent the type of operation on the Kubernetes - resource. - enum: - - No Action - - Create - - Update - - Delete - - Conflict - type: string - message: - description: |- - Message is for any message that needs to added to better - explain the action. - type: string - resource: - description: Resource contains information about Kubernetes - Resource - properties: - group: - description: Group of the resource deployed in the Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this resource - was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret containing - this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - required: - - resource - type: object - type: array - releaseReports: - description: ReleaseReports contains report on helm releases - items: - properties: - action: - description: Action represent the type of operation on the Helm - Chart - enum: - - No Action - - Install - - Upgrade - - Delete - - Conflict - type: string - chartName: - description: ReleaseName of the release deployed in the CAPI - Cluster. - minLength: 1 - type: string - chartVersion: - description: |- - ChartVersion is the version of the helm chart deployed - in the CAPI Cluster. - type: string - message: - description: |- - Message is for any message that needs to added to better - explain the action. - type: string - releaseNamespace: - description: Namespace where release is deployed in the CAPI - Cluster. - minLength: 1 - type: string - required: - - chartName - - chartVersion - - releaseNamespace - type: object - type: array - resourceReports: - description: |- - ResourceReports contains report on Kubernetes resources - deployed because of PolicyRefs - items: - properties: - action: - description: Action represent the type of operation on the Kubernetes - resource. - enum: - - No Action - - Create - - Update - - Delete - - Conflict - type: string - message: - description: |- - Message is for any message that needs to added to better - explain the action. - type: string - resource: - description: Resource contains information about Kubernetes - Resource - properties: - group: - description: Group of the resource deployed in the Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this resource - was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret containing - this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - required: - - resource - type: object - type: array - type: object - type: object - served: true - storage: false - subresources: - status: {} - - name: v1beta1 - schema: - openAPIV3Schema: - description: ClusterReport is the Schema for the clusterreports API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: ClusterReportSpec defines the desired state of ClusterReport - properties: - clusterName: - description: |- - ClusterName is the name of the CAPI Cluster this ClusterReport - is for. - type: string - clusterNamespace: - description: |- - ClusterNamespace is the namespace of the CAPI Cluster this - ClusterReport is for. - type: string - required: - - clusterName - - clusterNamespace - type: object - status: - description: ClusterReportStatus defines the observed state of ClusterReport - properties: - kustomizeResourceReports: - description: |- - KustomizeResourceReports contains report on Kubernetes resources - deployed because of KustomizationRefs - items: - properties: - action: - description: Action represent the type of operation on the Kubernetes - resource. - enum: - - No Action - - Create - - Update - - Delete - - Conflict - type: string - message: - description: |- - Message is for any message that needs to added to better - explain the action. - type: string - resource: - description: Resource contains information about Kubernetes - Resource - properties: - group: - description: Group of the resource deployed in the Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this resource - was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret containing - this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - required: - - resource - type: object - type: array - releaseReports: - description: ReleaseReports contains report on helm releases - items: - properties: - action: - description: Action represent the type of operation on the Helm - Chart - enum: - - No Action - - Install - - Upgrade - - Delete - - Conflict - - Update Values - type: string - chartName: - description: ReleaseName of the release deployed in the CAPI - Cluster. - minLength: 1 - type: string - chartVersion: - description: |- - ChartVersion is the version of the helm chart deployed - in the CAPI Cluster. - type: string - message: - description: |- - Message is for any message that needs to added to better - explain the action. - type: string - releaseNamespace: - description: Namespace where release is deployed in the CAPI - Cluster. - minLength: 1 - type: string - required: - - chartName - - chartVersion - - releaseNamespace - type: object - type: array - resourceReports: - description: |- - ResourceReports contains report on Kubernetes resources - deployed because of PolicyRefs - items: - properties: - action: - description: Action represent the type of operation on the Kubernetes - resource. - enum: - - No Action - - Create - - Update - - Delete - - Conflict - type: string - message: - description: |- - Message is for any message that needs to added to better - explain the action. - type: string - resource: - description: Resource contains information about Kubernetes - Resource - properties: - group: - description: Group of the resource deployed in the Cluster. - type: string - ignoreForConfigurationDrift: - default: false - description: |- - IgnoreForConfigurationDrift indicates to not track resource - for configuration drift detection. - This field has a meaning only when mode is ContinuousWithDriftDetection - type: boolean - kind: - description: Kind of the resource deployed in the Cluster. - minLength: 1 - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this resource - was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource deployed in the Cluster. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the resource deployed in the Cluster. - Empty for resources scoped at cluster level. - type: string - owner: - description: Owner is the list of ConfigMap/Secret containing - this resource. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - version: - description: Version of the resource deployed in the Cluster. - minLength: 1 - type: string - required: - - group - - kind - - name - - owner - - version - type: object - required: - - resource - type: object - type: array - type: object - type: object - served: true - storage: true - subresources: - status: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.17.2 - name: clustersummaries.config.projectsveltos.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - name: webhook-service - namespace: projectsveltos - path: /convert - conversionReviewVersions: - - v1 - group: config.projectsveltos.io - names: - kind: ClusterSummary - listKind: ClusterSummaryList - plural: clustersummaries - singular: clustersummary - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ClusterSummary is the Schema for the clustersummaries API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: ClusterSummarySpec defines the desired state of ClusterSummary - properties: - clusterName: - description: ClusterName is the name of the workload Cluster this - ClusterSummary is for. - type: string - clusterNamespace: - description: |- - ClusterNamespace is the namespace of the workload Cluster this - ClusterSummary is for. - type: string - clusterProfileSpec: - description: |- - ClusterProfileSpec represent the configuration that will be applied to - the workload cluster. - properties: - clusterRefs: - description: ClusterRefs identifies clusters to associate to. - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - clusterSelector: - description: ClusterSelector identifies clusters to associate - to. - type: string - continueOnConflict: - default: false - description: |- - By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after - encountering the first conflict (e.g., another ClusterProfile already deployed the resource). - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if conflicts are detected for previous resources. - type: boolean - dependsOn: - description: |- - DependsOn specifies a list of other ClusterProfiles that this instance depends on. - In any managed cluster that matches this ClusterProfile, the add-ons and applications - defined in this instance will not be deployed until all add-ons and applications in the - ClusterProfiles listed as dependencies are deployed. - items: - type: string - type: array - extraAnnotations: - additionalProperties: - type: string - description: |- - ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources - deployed in a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a annotation with a key present in - `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. - type: object - extraLabels: - additionalProperties: - type: string - description: |- - ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in - a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a label with a key present in - `ExtraLabels`, the value from `ExtraLabels` will override the existing value. - type: object - helmCharts: - description: Helm charts is a list of helm charts that need to - be deployed - items: - properties: - chartName: - description: ChartName is the chart name - minLength: 1 - type: string - chartVersion: - description: ChartVersion is the chart version - minLength: 1 - type: string - helmChartAction: - default: Install - description: HelmChartAction is the action that will be - taken on the helm chart - enum: - - Install - - Uninstall - type: string - options: - description: Options allows to set flags which are used - during installation. - properties: - atomic: - default: false - description: |- - if set, the installation process deletes the installation/upgrades on failure. - The --wait flag will be set automatically if --atomic is used - Default to false - type: boolean - dependencyUpdate: - default: false - description: |- - update dependencies if they are missing before installing the chart - Default to false - type: boolean - description: - description: Description is the description of an helm - operation - type: string - disableHooks: - default: false - description: |- - prevent hooks from running during install/upgrade/uninstall - Default to false - type: boolean - disableOpenAPIValidation: - default: false - description: |- - if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema - Default to false - type: boolean - enableClientCache: - default: false - description: EnableClientCache is a flag to enable Helm - client cache. If it is not specified, it will be set - to false. - type: boolean - installOptions: - description: HelmInstallOptions are options specific - to helm install - properties: - createNamespace: - default: true - description: Create the release namespace if not - present. Defaults to true - type: boolean - replace: - default: true - description: Replaces if set indicates to replace - an older release with this one - type: boolean - type: object - labels: - additionalProperties: - type: string - description: Labels that would be added to release metadata. - type: object - skipCRDs: - default: false - description: |- - SkipCRDs controls whether CRDs should be installed during install/upgrade operation. - By default, CRDs are installed if not already present. - type: boolean - skipSchemaValidation: - default: false - description: SkipSchemaValidation determines if JSON - schema validation is disabled. - type: boolean - timeout: - description: time to wait for any individual Kubernetes - operation (like Jobs for hooks) (default 5m0s) - type: string - uninstallOptions: - description: HelmUninstallOptions are options specific - to helm uninstall - properties: - deletionPropagation: - description: DeletionPropagation - enum: - - orphan - - foreground - - background - type: string - keepHistory: - description: |- - When uninstall a chart with this flag, Helm removes the resources associated with the chart, - but it keeps the release information. This allows to see details about the uninstalled release - using the helm history command. - type: boolean - type: object - upgradeOptions: - description: HelmUpgradeOptions are options specific - to helm upgrade - properties: - cleanupOnFail: - default: false - description: CleanupOnFail will, if true, cause - the upgrade to delete newly-created resources - on a failed update. - type: boolean - force: - default: false - description: |- - Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway. - This should be used with caution. - type: boolean - maxHistory: - default: 2 - description: |- - MaxHistory limits the maximum number of revisions saved per release - Default to 2 - type: integer - recreate: - default: false - description: Recreate will (if true) recreate pods - after a rollback. - type: boolean - resetThenReuseValues: - default: false - description: ResetThenReuseValues will reset the - values to the chart's built-ins then merge with - user's last supplied values. - type: boolean - resetValues: - default: false - description: ResetValues will reset the values to - the chart's built-ins rather than merging with - existing. - type: boolean - reuseValues: - default: false - description: |- - ReuseValues copies values from the current release to a new release if the - new release does not have any values. If the request already has values, - or if there are no values in the current release, this does nothing. - This is skipped if the ResetValues flag is set, in which case the - request values are not altered. - type: boolean - subNotes: - default: false - description: SubNotes determines whether sub-notes - are rendered in the chart. - type: boolean - upgradeCRDs: - default: false - description: |- - UpgradeCRDs upgrade CRDs from the Helm Chart's crds directory - By default, CRDs are not applied during Helm upgrade action by Helm - https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ - type: boolean - type: object - wait: - default: false - description: |- - if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet - are in a ready state before marking the release as successful. It will wait for as long as --timeout - Default to false - type: boolean - waitForJobs: - default: false - description: |- - if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. - It will wait for as long as --timeout - Default to false - type: boolean - type: object - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - repositoryName: - description: RepositoryName is the name helm chart repository - minLength: 1 - type: string - repositoryURL: - description: RepositoryURL is the URL helm chart repository - minLength: 1 - type: string - values: - description: |- - Values field allows to define configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - type: string - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to store configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - chartName - - chartVersion - - releaseName - - releaseNamespace - - repositoryName - - repositoryURL - type: object - type: array - kustomizationRefs: - description: |- - Kustomization refs is a list of kustomization paths. Kustomization will - be run on those paths and the outcome will be deployed. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - flux GitRepository;OCIRepository;Bucket - - ConfigMap/Secret - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the kustomization.yaml file, or the - set of plain YAMLs a kustomization.yaml should be generated for. - Defaults to 'None', which translates to the root path of the SourceRef. - type: string - targetNamespace: - description: |- - TargetNamespace sets or overrides the namespace in the - kustomization.yaml file. - maxLength: 63 - minLength: 1 - type: string - values: - additionalProperties: - type: string - description: |- - Values is a map[string]string type that allows to define a set of key-value pairs. - These key-value pairs can optionally leverage Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - type: object - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to define key-value pairs. These key-value pairs can optionally leverage - Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - kind - - name - - namespace - type: object - type: array - maxUpdate: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of clusters that can be updated concurrently. - Value can be an absolute number (ex: 5) or a percentage of desired cluster (ex: 10%). - Defaults to 100%. - Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile - changes, only 30% of matching clusters will be updated in parallel. Only when updates - in those cluster succeed, other matching clusters are updated. - pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ - x-kubernetes-int-or-string: true - policyRefs: - description: |- - PolicyRefs references all the ConfigMaps/Secrets containing kubernetes resources - that need to be deployed in the matching CAPI clusters. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - - flux GitRepository;OCIRepository;Bucket - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the YAML files. - Defaults to 'None', which translates to the root path of the SourceRef. - Used only for GitRepository;OCIRepository;Bucket - type: string - required: - - kind - - name - type: object - type: array - reloader: - default: false - description: |- - Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed - by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade - when a ConfigMap/Secret instance mounted as volume is modified. - When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically - starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it. - type: boolean - setRefs: - description: |- - SetRefs identifies referenced (cluster)Sets. - - ClusterProfile can reference ClusterSet; - - Profile can reference Set; - items: - type: string - type: array - stopMatchingBehavior: - default: WithdrawPolicies - description: |- - StopMatchingBehavior indicates what behavior should be when a Cluster stop matching - the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will - be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead - leave ClusterProfile deployed policies in the Cluster. - enum: - - WithdrawPolicies - - LeavePolicies - type: string - syncMode: - default: Continuous - description: |- - SyncMode specifies how features are synced in a matching workload cluster. - - OneTime means, first time a workload cluster matches the ClusterProfile, - features will be deployed in such cluster. Any subsequent feature configuration - change won't be applied into the matching workload clusters; - - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile, - the specified features are deployed. Subsequent changes to the feature configuration are also - automatically applied to all matching workload clusters. - _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors - matching managed clusters for configuration drift. If drift is detected, a reconciliation is - triggered to ensure the managed cluster's configuration aligns with the ClusterProfile. - - DryRun means no change will be propagated to any matching cluster. A report - instead will be generated summarizing what would happen in any matching cluster - because of the changes made to ClusterProfile while in DryRun mode. - enum: - - OneTime - - Continuous - - ContinuousWithDriftDetection - - DryRun - type: string - templateResourceRefs: - description: |- - TemplateResourceRefs is a list of resource to collect from the management cluster. - Those resources' values will be used to instantiate templates contained in referenced - PolicyRefs and Helm charts - items: - properties: - identifier: - description: |- - Identifier is how the resource will be referred to in the - template - type: string - resource: - description: |- - Resource references a Kubernetes instance in the management - cluster to fetch and use during template instantiation. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - required: - - identifier - - resource - type: object - type: array - x-kubernetes-list-map-keys: - - identifier - x-kubernetes-list-type: map - tier: - default: 100 - description: |- - Tier controls the order of deployment for ClusterProfile or Profile resources targeting - the same cluster resources. - Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes - resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it. - Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest** - Tier value takes priority and deploys the resource. - Higher Tier values represent lower priority. The default Tier value is 100. - Using Tiers provides finer control over resource deployment within your cluster, particularly useful - when multiple configurations manage the same resources. - format: int32 - minimum: 1 - type: integer - validateHealths: - description: |- - ValidateHealths is a slice of Lua functions to run against - the managed cluster to validate the state of those add-ons/applications - is healthy - items: - properties: - featureID: - description: |- - FeatureID is an indentifier of the feature (Helm/Kustomize/Resources) - This field indicates when to run this check. - For instance: - - if set to Helm this check will be run after all helm - charts specified in the ClusterProfile are deployed. - - if set to Resources this check will be run after the content - of all the ConfigMaps/Secrets referenced by ClusterProfile in the - PolicyRef sections is deployed - enum: - - Resources - - Helm - - Kustomize - type: string - group: - description: Group of the resource to fetch in the managed - Cluster. - type: string - kind: - description: Kind of the resource to fetch in the managed - Cluster. - minLength: 1 - type: string - labelFilters: - description: LabelFilters allows to filter resources based - on current labels. - items: - properties: - key: - description: Key is the label key - type: string - operation: - description: Operation is the comparison operation - enum: - - Equal - - Different - type: string - value: - description: Value is the label value - type: string - required: - - key - - operation - - value - type: object - type: array - name: - description: Name is the name of this check - type: string - namespace: - description: |- - Namespace of the resource to fetch in the managed Cluster. - Empty for resources scoped at cluster level. - type: string - script: - description: |- - Script is a text containing a lua script. - Must return struct with field "health" - representing whether object is a match (true or false) - type: string - version: - description: Version of the resource to fetch in the managed - Cluster. - type: string - required: - - featureID - - group - - kind - - name - - version - type: object - type: array - type: object - clusterType: - description: ClusterType is the type of Cluster - type: string - required: - - clusterName - - clusterNamespace - - clusterType - type: object - status: - description: ClusterSummaryStatus defines the observed state of ClusterSummary - properties: - dependencies: - description: |- - Dependencies is a summary reporting the status of the dependencies - for the associated ClusterProfile - type: string - deployedGVKs: - description: |- - DeployedGVKs reports the list of GVKs deployed by ClusterSummary - in a managed cluster - items: - properties: - deployedGroupVersionKind: - description: |- - DeployedGroupVersionKind contains all GroupVersionKinds deployed in either - the workload cluster or the management cluster because of this feature. - Each element has format kind.version.group - items: - type: string - type: array - featureID: - description: FeatureID is an indentifier of the feature whose - status is reported - enum: - - Resources - - Helm - - Kustomize - type: string - required: - - featureID - type: object - type: array - x-kubernetes-list-map-keys: - - featureID - x-kubernetes-list-type: map - featureSummaries: - description: |- - FeatureSummaries reports the status of each workload cluster feature - directly managed by ClusterProfile. - items: - description: |- - FeatureSummary contains a summary of the state of a workload - cluster feature. - properties: - deployedGroupVersionKind: - description: |- - DeployedGroupVersionKind contains all GroupVersionKinds deployed in either - the workload cluster or the management cluster because of this feature. - Each element has format kind.version.group - Deprecated: Replaced by FeatureDeploymentInfo field instead - items: - type: string - type: array - failureMessage: - description: FailureMessage provides more information about - the error. - type: string - failureReason: - description: FailureReason indicates the type of error that - occurred. - type: string - featureID: - description: FeatureID is an indentifier of the feature whose - status is reported - enum: - - Resources - - Helm - - Kustomize - type: string - hash: - description: |- - Hash represents of a unique value for a feature at a fixed point in - time - format: byte - type: string - lastAppliedTime: - description: LastAppliedTime is the time feature was last reconciled - format: date-time - type: string - status: - description: Status represents the state of the feature in the - workload cluster - enum: - - Provisioning - - Provisioned - - Failed - - FailedNonRetriable - - Removing - - Removed - type: string - required: - - featureID - type: object - type: array - x-kubernetes-list-map-keys: - - featureID - x-kubernetes-list-type: map - helmReleaseSummaries: - description: |- - HelmReleaseSummaries reports the status of each helm chart - directly managed by ClusterProfile. - items: - properties: - conflictMessage: - description: |- - Status indicates whether ClusterSummary can manage the helm - chart or there is a conflict - type: string - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - status: - description: |- - Status indicates whether ClusterSummary can manage the helm - chart or there is a conflict - enum: - - Managing - - Conflict - type: string - valuesHash: - description: ValuesHash represents of a unique value for the - values section - format: byte - type: string - required: - - releaseName - - releaseNamespace - - status - type: object - type: array - x-kubernetes-list-type: atomic - type: object - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - description: Time duration since creation of ClusterSummary - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: Indicates whether HelmCharts are all provisioned - jsonPath: .status.featureSummaries[?(@.featureID=="Helm")].status - name: HelmCharts - priority: 2 - type: string - - description: Indicates whether KustomizeRefs are all provisioned - jsonPath: .status.featureSummaries[?(@.featureID=="Kustomize")].status - name: KustomizeRefs - priority: 2 - type: string - - description: Indicates whether PolicyRefs are all provisioned - jsonPath: .status.featureSummaries[?(@.featureID=="Resources")].status - name: PolicyRefs - priority: 2 - type: string - name: v1beta1 - schema: - openAPIV3Schema: - description: ClusterSummary is the Schema for the clustersummaries API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: ClusterSummarySpec defines the desired state of ClusterSummary - properties: - clusterName: - description: ClusterName is the name of the workload Cluster this - ClusterSummary is for. - type: string - clusterNamespace: - description: |- - ClusterNamespace is the namespace of the workload Cluster this - ClusterSummary is for. - type: string - clusterProfileSpec: - description: |- - ClusterProfileSpec represent the configuration that will be applied to - the workload cluster. - properties: - clusterRefs: - description: ClusterRefs identifies clusters to associate to. - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - clusterSelector: - description: ClusterSelector identifies clusters to associate - to. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - continueOnConflict: - default: false - description: |- - By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after - encountering the first conflict (e.g., another ClusterProfile already deployed the resource). - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if conflicts are detected for previous resources. - type: boolean - continueOnError: - default: false - description: |- - By default (when ContinueOnError is unset or set to false), Sveltos stops deployment after - encountering the first error. - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if errors are detected for previous resources. - type: boolean - dependsOn: - description: |- - DependsOn specifies a list of other ClusterProfiles that this instance depends on. - In any managed cluster that matches this ClusterProfile, the add-ons and applications - defined in this instance will not be deployed until all add-ons and applications in the - ClusterProfiles listed as dependencies are deployed. - items: - type: string - type: array - driftExclusions: - description: |- - DriftExclusions is a list of configuration drift exclusions to be applied when syncMode is - set to ContinuousWithDriftDetection. Each exclusion specifies JSON6902 paths to ignore - when evaluating drift, optionally targeting specific resources and features. - items: - properties: - paths: - description: Paths is a slice of JSON6902 paths to exclude - from configuration drift evaluation. - items: - type: string - type: array - target: - description: Target points to the resources that the paths - refers to. - properties: - annotationSelector: - description: |- - AnnotationSelector is a string that follows the label selection expression - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api - It matches with the resource annotations. - type: string - group: - description: |- - Group is the API group to select resources from. - Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - kind: - description: |- - Kind of the API Group to select resources from. - Together with Group and Version it is capable of unambiguously - identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - labelSelector: - description: |- - LabelSelector is a string that follows the label selection expression - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api - It matches with the resource labels. - type: string - name: - description: Name to match resources with. - type: string - namespace: - description: Namespace to select resources from. - type: string - version: - description: |- - Version of the API Group to select resources from. - Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - type: object - required: - - paths - type: object - type: array - extraAnnotations: - additionalProperties: - type: string - description: |- - ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources - deployed in a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a annotation with a key present in - `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. - (Deprecated use Patches instead) - type: object - extraLabels: - additionalProperties: - type: string - description: |- - ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in - a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a label with a key present in - `ExtraLabels`, the value from `ExtraLabels` will override the existing value. - (Deprecated use Patches instead) - type: object - helmCharts: - description: Helm charts is a list of helm charts that need to - be deployed - items: - properties: - chartName: - description: ChartName is the chart name - minLength: 1 - type: string - chartVersion: - description: ChartVersion is the chart version - minLength: 1 - type: string - helmChartAction: - default: Install - description: HelmChartAction is the action that will be - taken on the helm chart - enum: - - Install - - Uninstall - type: string - options: - description: Options allows to set flags which are used - during installation. - properties: - atomic: - default: false - description: |- - if set, the installation process deletes the installation/upgrades on failure. - The --wait flag will be set automatically if --atomic is used - Default to false - type: boolean - dependencyUpdate: - default: false - description: |- - update dependencies if they are missing before installing the chart - Default to false - type: boolean - description: - description: Description is the description of an helm - operation - type: string - disableHooks: - default: false - description: |- - prevent hooks from running during install/upgrade/uninstall - Default to false - type: boolean - disableOpenAPIValidation: - default: false - description: |- - if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema - Default to false - type: boolean - enableClientCache: - default: false - description: EnableClientCache is a flag to enable Helm - client cache. If it is not specified, it will be set - to false. - type: boolean - installOptions: - description: HelmInstallOptions are options specific - to helm install - properties: - createNamespace: - default: true - description: Create the release namespace if not - present. Defaults to true - type: boolean - disableHooks: - default: false - description: |- - prevent hooks from running during install. If set to true, overrides - DisableHooks in HelmOptions. Use this one when you want to selective - disable hooks on install - Default to false - type: boolean - replace: - default: true - description: Replaces if set indicates to replace - an older release with this one - type: boolean - type: object - labels: - additionalProperties: - type: string - description: Labels that would be added to release metadata. - type: object - skipCRDs: - default: false - description: |- - SkipCRDs controls whether CRDs should be installed during install/upgrade operation. - By default, CRDs are installed if not already present. - type: boolean - skipSchemaValidation: - default: false - description: SkipSchemaValidation determines if JSON - schema validation is disabled. - type: boolean - timeout: - description: time to wait for any individual Kubernetes - operation (like Jobs for hooks) (default 5m0s) - type: string - uninstallOptions: - description: HelmUninstallOptions are options specific - to helm uninstall - properties: - deletionPropagation: - description: DeletionPropagation - enum: - - orphan - - foreground - - background - type: string - disableHooks: - default: false - description: |- - prevent hooks from running during install. If set to true, overrides - DisableHooks in HelmOptions. Use this one when you want to selective - disable hooks on uninstall - Default to false - type: boolean - keepHistory: - description: |- - When uninstall a chart with this flag, Helm removes the resources associated with the chart, - but it keeps the release information. This allows to see details about the uninstalled release - using the helm history command. - type: boolean - type: object - upgradeOptions: - description: HelmUpgradeOptions are options specific - to helm upgrade - properties: - cleanupOnFail: - default: false - description: CleanupOnFail will, if true, cause - the upgrade to delete newly-created resources - on a failed update. - type: boolean - disableHooks: - default: false - description: |- - prevent hooks from running during install. If set to true, overrides - DisableHooks in HelmOptions. Use this one when you want to selective - disable hooks on upgrade - Default to false - type: boolean - force: - default: false - description: |- - Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway. - This should be used with caution. - type: boolean - maxHistory: - default: 2 - description: |- - MaxHistory limits the maximum number of revisions saved per release - Default to 2 - type: integer - recreate: - default: false - description: Recreate will (if true) recreate pods - after a rollback. - type: boolean - resetThenReuseValues: - default: false - description: ResetThenReuseValues will reset the - values to the chart's built-ins then merge with - user's last supplied values. - type: boolean - resetValues: - default: false - description: ResetValues will reset the values to - the chart's built-ins rather than merging with - existing. - type: boolean - reuseValues: - default: false - description: |- - ReuseValues copies values from the current release to a new release if the - new release does not have any values. If the request already has values, - or if there are no values in the current release, this does nothing. - This is skipped if the ResetValues flag is set, in which case the - request values are not altered. - type: boolean - subNotes: - default: false - description: SubNotes determines whether sub-notes - are rendered in the chart. - type: boolean - upgradeCRDs: - default: false - description: |- - UpgradeCRDs upgrade CRDs from the Helm Chart's crds directory - By default, CRDs are not applied during Helm upgrade action by Helm - https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ - type: boolean - type: object - wait: - default: false - description: |- - if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet - are in a ready state before marking the release as successful. It will wait for as long as --timeout - Default to false - type: boolean - waitForJobs: - default: false - description: |- - if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. - It will wait for as long as --timeout - Default to false - type: boolean - type: object - registryCredentialsConfig: - description: |- - RegistryCredentialsConfig is an optional configuration for credentials, - including information to connect to private registries. - properties: - ca: - description: |- - CASecretRef references a secret containing the TLS CA certificate - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - key: ca.crt - properties: - name: - description: name is unique within a namespace to - reference a secret resource. - type: string - namespace: - description: namespace defines the space within - which the secret name must be unique. - type: string - type: object - x-kubernetes-map-type: atomic - credentials: - description: |- - CredentialsSecretRef references a secret containing credentials - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - properties: - name: - description: name is unique within a namespace to - reference a secret resource. - type: string - namespace: - description: namespace defines the space within - which the secret name must be unique. - type: string - type: object - x-kubernetes-map-type: atomic - insecureSkipTLSVerify: - description: InsecureSkipTLSVerify controls server certificate - verification. - type: boolean - key: - description: |- - Key specifies the key within the CredentialsSecretRef containing the data - If not specified, it defaults to the only key in the secret if there's just one. - type: string - plainHTTP: - description: PlainHTTP indicates to use insecure HTTP - connections for the chart download - type: boolean - type: object - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - repositoryName: - description: RepositoryName is the name helm chart repository - minLength: 1 - type: string - repositoryURL: - description: RepositoryURL is the URL helm chart repository - minLength: 1 - type: string - values: - description: |- - Values field allows to define configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster and TemplateResourceRefs) - type: string - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to store configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster and TemplateResourceRefs) - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: |- - Name of the referenced resource. - Name can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - type: object - type: array - required: - - chartName - - chartVersion - - releaseName - - releaseNamespace - - repositoryName - - repositoryURL - type: object - type: array - kustomizationRefs: - description: |- - Kustomization refs is a list of kustomization paths. Kustomization will - be run on those paths and the outcome will be deployed. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - flux GitRepository;OCIRepository;Bucket - - ConfigMap/Secret - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: |- - Name of the referenced resource. - Name can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the kustomization.yaml file, or the - set of plain YAMLs a kustomization.yaml should be generated for. - Defaults to 'None', which translates to the root path of the SourceRef. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster) - type: string - targetNamespace: - description: |- - TargetNamespace sets or overrides the namespace in the - kustomization.yaml file. - maxLength: 63 - minLength: 1 - type: string - values: - additionalProperties: - type: string - description: |- - Values is a map[string]string type that allows to define a set of key-value pairs. - These key-value pairs can optionally leverage Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - type: object - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to define key-value pairs. These key-value pairs can optionally leverage - Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: |- - Name of the referenced resource. - Name can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - type: object - type: array - required: - - kind - - name - - namespace - type: object - type: array - maxConsecutiveFailures: - description: |- - The maximum number of consecutive deployment failures that Sveltos will permit. - After this many consecutive failures, the deployment will be considered failed, and Sveltos will stop retrying. - This setting applies only to feature deployments, not resource removal. - This field is optional. If not set, Sveltos default behavior is to keep retrying. - type: integer - maxUpdate: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of clusters that can be updated concurrently. - Value can be an absolute number (ex: 5) or a percentage of desired cluster (ex: 10%). - Defaults to 100%. - Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile - changes, only 30% of matching clusters will be updated in parallel. Only when updates - in those cluster succeed, other matching clusters are updated. - pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ - x-kubernetes-int-or-string: true - patches: - description: |- - Define additional Kustomize inline Patches applied for all resources on this profile - Within the Patch Spec you can use templating - items: - description: |- - Patch contains an inline StrategicMerge or JSON6902 patch, and the target the patch should - be applied to. - properties: - patch: - description: |- - Patch contains an inline StrategicMerge patch or an inline JSON6902 patch with - an array of operation objects. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster and TemplateResourceRefs) - type: string - target: - description: Target points to the resources that the patch - document should be applied to. - properties: - annotationSelector: - description: |- - AnnotationSelector is a string that follows the label selection expression - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api - It matches with the resource annotations. - type: string - group: - description: |- - Group is the API group to select resources from. - Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - kind: - description: |- - Kind of the API Group to select resources from. - Together with Group and Version it is capable of unambiguously - identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - labelSelector: - description: |- - LabelSelector is a string that follows the label selection expression - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api - It matches with the resource labels. - type: string - name: - description: Name to match resources with. - type: string - namespace: - description: Namespace to select resources from. - type: string - version: - description: |- - Version of the API Group to select resources from. - Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources. - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md - type: string - type: object - required: - - patch - type: object - type: array - policyRefs: - description: |- - PolicyRefs references all the ConfigMaps/Secrets/Flux Sources containing kubernetes resources - that need to be deployed in the matching managed clusters. - The values contained in those resources can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment (Cluster and TemplateResourceRefs) - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - - flux GitRepository;OCIRepository;Bucket - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: |- - Name of the referenced resource. - Name can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the YAML files. - Defaults to 'None', which translates to the root path of the SourceRef. - Used only for GitRepository;OCIRepository;Bucket - type: string - required: - - kind - - name - type: object - type: array - reloader: - default: false - description: |- - Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed - by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade - when a ConfigMap/Secret instance mounted as volume is modified. - When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically - starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it. - type: boolean - setRefs: - description: |- - SetRefs identifies referenced (cluster)Sets. - - ClusterProfile can reference ClusterSet; - - Profile can reference Set; - items: - type: string - type: array - stopMatchingBehavior: - default: WithdrawPolicies - description: |- - StopMatchingBehavior indicates what behavior should be when a Cluster stop matching - the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will - be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead - leave ClusterProfile deployed policies in the Cluster. - enum: - - WithdrawPolicies - - LeavePolicies - type: string - syncMode: - default: Continuous - description: |- - SyncMode specifies how features are synced in a matching workload cluster. - - OneTime means, first time a workload cluster matches the ClusterProfile, - features will be deployed in such cluster. Any subsequent feature configuration - change won't be applied into the matching workload clusters; - - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile, - the specified features are deployed. Subsequent changes to the feature configuration are also - automatically applied to all matching workload clusters. - _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors - matching managed clusters for configuration drift. If drift is detected, a reconciliation is - triggered to ensure the managed cluster's configuration aligns with the ClusterProfile. - - DryRun means no change will be propagated to any matching cluster. A report - instead will be generated summarizing what would happen in any matching cluster - because of the changes made to ClusterProfile while in DryRun mode. - enum: - - OneTime - - Continuous - - ContinuousWithDriftDetection - - DryRun - type: string - templateResourceRefs: - description: |- - TemplateResourceRefs is a list of resource to collect from the management cluster. - Those resources' values will be used to instantiate templates - items: - properties: - identifier: - description: |- - Identifier is how the resource will be referred to in the - template - type: string - resource: - description: |- - Resource references a Kubernetes instance in the management - cluster to fetch and use during template instantiation. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - Name and namespace can be expressed as a template and instantiate using - - cluster namespace: .Cluster.metadata.namespace - - cluster name: .Cluster.metadata.name - - cluster type: .Cluster.kind - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - required: - - identifier - - resource - type: object - type: array - x-kubernetes-list-map-keys: - - identifier - x-kubernetes-list-type: map - tier: - default: 100 - description: |- - Tier controls the order of deployment for ClusterProfile or Profile resources targeting - the same cluster resources. - Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes - resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it. - Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest** - Tier value takes priority and deploys the resource. - Higher Tier values represent lower priority. The default Tier value is 100. - Using Tiers provides finer control over resource deployment within your cluster, particularly useful - when multiple configurations manage the same resources. - format: int32 - minimum: 1 - type: integer - validateHealths: - description: |- - ValidateHealths is a slice of Lua functions to run against - the managed cluster to validate the state of those add-ons/applications - is healthy - items: - properties: - featureID: - description: |- - FeatureID is an indentifier of the feature (Helm/Kustomize/Resources) - This field indicates when to run this check. - For instance: - - if set to Helm this check will be run after all helm - charts specified in the ClusterProfile are deployed. - - if set to Resources this check will be run after the content - of all the ConfigMaps/Secrets referenced by ClusterProfile in the - PolicyRef sections is deployed - enum: - - Resources - - Helm - - Kustomize - type: string - group: - description: Group of the resource to fetch in the managed - Cluster. - type: string - kind: - description: Kind of the resource to fetch in the managed - Cluster. - minLength: 1 - type: string - labelFilters: - description: LabelFilters allows to filter resources based - on current labels. - items: - properties: - key: - description: Key is the label key - type: string - operation: - description: Operation is the comparison operation - enum: - - Equal - - Different - type: string - value: - description: Value is the label value - type: string - required: - - key - - operation - - value - type: object - type: array - name: - description: Name is the name of this check - type: string - namespace: - description: |- - Namespace of the resource to fetch in the managed Cluster. - Empty for resources scoped at cluster level. - type: string - script: - description: |- - Script is a text containing a lua script. - Must return struct with field "health" - representing whether object is a match (true or false) - type: string - version: - description: Version of the resource to fetch in the managed - Cluster. - type: string - required: - - featureID - - group - - kind - - name - - version - type: object - type: array - type: object - clusterType: - description: ClusterType is the type of Cluster - type: string - required: - - clusterName - - clusterNamespace - - clusterType - type: object - status: - description: ClusterSummaryStatus defines the observed state of ClusterSummary - properties: - dependencies: - description: |- - Dependencies is a summary reporting the status of the dependencies - for the associated ClusterProfile - type: string - deployedGVKs: - description: |- - DeployedGVKs reports the list of GVKs deployed by ClusterSummary - in a managed cluster - items: - properties: - deployedGroupVersionKind: - description: |- - DeployedGroupVersionKind contains all GroupVersionKinds deployed in either - the workload cluster or the management cluster because of this feature. - Each element has format kind.version.group - items: - type: string - type: array - featureID: - description: FeatureID is an indentifier of the feature whose - status is reported - enum: - - Resources - - Helm - - Kustomize - type: string - required: - - featureID - type: object - type: array - x-kubernetes-list-map-keys: - - featureID - x-kubernetes-list-type: map - featureSummaries: - description: |- - FeatureSummaries reports the status of each workload cluster feature - directly managed by ClusterProfile. - items: - description: |- - FeatureSummary contains a summary of the state of a workload - cluster feature. - properties: - consecutiveFailures: - description: The number of consecutive deployment failures. - type: integer - deployedGroupVersionKind: - description: |- - DeployedGroupVersionKind contains all GroupVersionKinds deployed in either - the workload cluster or the management cluster because of this feature. - Each element has format kind.version.group - Deprecated: Replaced by FeatureDeploymentInfo field instead - items: - type: string - type: array - failureMessage: - description: FailureMessage provides more information about - the error. - type: string - failureReason: - description: FailureReason indicates the type of error that - occurred. - type: string - featureID: - description: FeatureID is an indentifier of the feature whose - status is reported - enum: - - Resources - - Helm - - Kustomize - type: string - hash: - description: |- - Hash represents of a unique value for a feature at a fixed point in - time - format: byte - type: string - lastAppliedTime: - description: LastAppliedTime is the time feature was last reconciled - format: date-time - type: string - status: - description: Status represents the state of the feature in the - workload cluster - enum: - - Provisioning - - Provisioned - - Failed - - FailedNonRetriable - - Removing - - Removed - type: string - required: - - featureID - type: object - type: array - x-kubernetes-list-map-keys: - - featureID - x-kubernetes-list-type: map - helmReleaseSummaries: - description: |- - HelmReleaseSummaries reports the status of each helm chart - directly managed by ClusterProfile. - items: - properties: - conflictMessage: - description: |- - Status indicates whether ClusterSummary can manage the helm - chart or there is a conflict - type: string - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - status: - description: |- - Status indicates whether ClusterSummary can manage the helm - chart or there is a conflict - enum: - - Managing - - Conflict - type: string - valuesHash: - description: ValuesHash represents of a unique value for the - values section - format: byte - type: string - required: - - releaseName - - releaseNamespace - - status - type: object - type: array - x-kubernetes-list-type: atomic - type: object - type: object - served: true - storage: true - subresources: - status: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.17.2 - name: profiles.config.projectsveltos.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - name: webhook-service - namespace: projectsveltos - path: /convert - conversionReviewVersions: - - v1 - group: config.projectsveltos.io - names: - kind: Profile - listKind: ProfileList - plural: profiles - singular: profile - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: Profile is the Schema for the profiles API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - properties: - clusterRefs: - description: ClusterRefs identifies clusters to associate to. - items: - description: ObjectReference contains enough information to let - you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - clusterSelector: - description: ClusterSelector identifies clusters to associate to. - type: string - continueOnConflict: - default: false - description: |- - By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after - encountering the first conflict (e.g., another ClusterProfile already deployed the resource). - If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even - if conflicts are detected for previous resources. - type: boolean - dependsOn: - description: |- - DependsOn specifies a list of other ClusterProfiles that this instance depends on. - In any managed cluster that matches this ClusterProfile, the add-ons and applications - defined in this instance will not be deployed until all add-ons and applications in the - ClusterProfiles listed as dependencies are deployed. - items: - type: string - type: array - extraAnnotations: - additionalProperties: - type: string - description: |- - ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources - deployed in a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a annotation with a key present in - `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value. - type: object - extraLabels: - additionalProperties: - type: string - description: |- - ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in - a managed cluster based on this ClusterProfile/Profile instance. - **Important:** If a resource deployed by Sveltos already has a label with a key present in - `ExtraLabels`, the value from `ExtraLabels` will override the existing value. - type: object - helmCharts: - description: Helm charts is a list of helm charts that need to be - deployed - items: - properties: - chartName: - description: ChartName is the chart name - minLength: 1 - type: string - chartVersion: - description: ChartVersion is the chart version - minLength: 1 - type: string - helmChartAction: - default: Install - description: HelmChartAction is the action that will be taken - on the helm chart - enum: - - Install - - Uninstall - type: string - options: - description: Options allows to set flags which are used during - installation. - properties: - atomic: - default: false - description: |- - if set, the installation process deletes the installation/upgrades on failure. - The --wait flag will be set automatically if --atomic is used - Default to false - type: boolean - dependencyUpdate: - default: false - description: |- - update dependencies if they are missing before installing the chart - Default to false - type: boolean - description: - description: Description is the description of an helm operation - type: string - disableHooks: - default: false - description: |- - prevent hooks from running during install/upgrade/uninstall - Default to false - type: boolean - disableOpenAPIValidation: - default: false - description: |- - if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema - Default to false - type: boolean - enableClientCache: - default: false - description: EnableClientCache is a flag to enable Helm - client cache. If it is not specified, it will be set to - false. - type: boolean - installOptions: - description: HelmInstallOptions are options specific to - helm install - properties: - createNamespace: - default: true - description: Create the release namespace if not present. - Defaults to true - type: boolean - replace: - default: true - description: Replaces if set indicates to replace an - older release with this one - type: boolean - type: object - labels: - additionalProperties: - type: string - description: Labels that would be added to release metadata. - type: object - skipCRDs: - default: false - description: |- - SkipCRDs controls whether CRDs should be installed during install/upgrade operation. - By default, CRDs are installed if not already present. - type: boolean - skipSchemaValidation: - default: false - description: SkipSchemaValidation determines if JSON schema - validation is disabled. - type: boolean - timeout: - description: time to wait for any individual Kubernetes - operation (like Jobs for hooks) (default 5m0s) - type: string - uninstallOptions: - description: HelmUninstallOptions are options specific to - helm uninstall + options: + description: Options allows to set flags which are used + during installation. properties: - deletionPropagation: - description: DeletionPropagation - enum: - - orphan - - foreground - - background - type: string - keepHistory: + atomic: + default: false description: |- - When uninstall a chart with this flag, Helm removes the resources associated with the chart, - but it keeps the release information. This allows to see details about the uninstalled release - using the helm history command. + if set, the installation process deletes the installation/upgrades on failure. + The --wait flag will be set automatically if --atomic is used + Default to false type: boolean - type: object - upgradeOptions: - description: HelmUpgradeOptions are options specific to - helm upgrade - properties: - cleanupOnFail: + dependencyUpdate: default: false - description: CleanupOnFail will, if true, cause the - upgrade to delete newly-created resources on a failed - update. + description: |- + update dependencies if they are missing before installing the chart + Default to false type: boolean - force: + description: + description: Description is the description of an helm + operation + type: string + disableHooks: default: false description: |- - Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway. - This should be used with caution. + prevent hooks from running during install/upgrade/uninstall + Default to false type: boolean - maxHistory: - default: 2 + disableOpenAPIValidation: + default: false description: |- - MaxHistory limits the maximum number of revisions saved per release - Default to 2 - type: integer - recreate: + if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema + Default to false + type: boolean + enableClientCache: default: false - description: Recreate will (if true) recreate pods after - a rollback. + description: EnableClientCache is a flag to enable Helm + client cache. If it is not specified, it will be set + to false. type: boolean - resetThenReuseValues: + installOptions: + description: HelmInstallOptions are options specific + to helm install + properties: + createNamespace: + default: true + description: Create the release namespace if not + present. Defaults to true + type: boolean + disableHooks: + default: false + description: |- + prevent hooks from running during install. If set to true, overrides + DisableHooks in HelmOptions. Use this one when you want to selective + disable hooks on install + Default to false + type: boolean + replace: + default: true + description: Replaces if set indicates to replace + an older release with this one + type: boolean + type: object + labels: + additionalProperties: + type: string + description: Labels that would be added to release metadata. + type: object + skipCRDs: default: false - description: ResetThenReuseValues will reset the values - to the chart's built-ins then merge with user's last - supplied values. + description: |- + SkipCRDs controls whether CRDs should be installed during install/upgrade operation. + By default, CRDs are installed if not already present. type: boolean - resetValues: + skipSchemaValidation: default: false - description: ResetValues will reset the values to the - chart's built-ins rather than merging with existing. + description: SkipSchemaValidation determines if JSON + schema validation is disabled. type: boolean - reuseValues: + timeout: + description: time to wait for any individual Kubernetes + operation (like Jobs for hooks) (default 5m0s) + type: string + uninstallOptions: + description: HelmUninstallOptions are options specific + to helm uninstall + properties: + deletionPropagation: + description: DeletionPropagation + enum: + - orphan + - foreground + - background + type: string + disableHooks: + default: false + description: |- + prevent hooks from running during install. If set to true, overrides + DisableHooks in HelmOptions. Use this one when you want to selective + disable hooks on uninstall + Default to false + type: boolean + keepHistory: + description: |- + When uninstall a chart with this flag, Helm removes the resources associated with the chart, + but it keeps the release information. This allows to see details about the uninstalled release + using the helm history command. + type: boolean + type: object + upgradeOptions: + description: HelmUpgradeOptions are options specific + to helm upgrade + properties: + cleanupOnFail: + default: false + description: CleanupOnFail will, if true, cause + the upgrade to delete newly-created resources + on a failed update. + type: boolean + disableHooks: + default: false + description: |- + prevent hooks from running during install. If set to true, overrides + DisableHooks in HelmOptions. Use this one when you want to selective + disable hooks on upgrade + Default to false + type: boolean + force: + default: false + description: |- + Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway. + This should be used with caution. + type: boolean + maxHistory: + default: 2 + description: |- + MaxHistory limits the maximum number of revisions saved per release + Default to 2 + type: integer + recreate: + default: false + description: Recreate will (if true) recreate pods + after a rollback. + type: boolean + resetThenReuseValues: + default: false + description: ResetThenReuseValues will reset the + values to the chart's built-ins then merge with + user's last supplied values. + type: boolean + resetValues: + default: false + description: ResetValues will reset the values to + the chart's built-ins rather than merging with + existing. + type: boolean + reuseValues: + default: false + description: |- + ReuseValues copies values from the current release to a new release if the + new release does not have any values. If the request already has values, + or if there are no values in the current release, this does nothing. + This is skipped if the ResetValues flag is set, in which case the + request values are not altered. + type: boolean + subNotes: + default: false + description: SubNotes determines whether sub-notes + are rendered in the chart. + type: boolean + upgradeCRDs: + default: false + description: |- + UpgradeCRDs upgrade CRDs from the Helm Chart's crds directory + By default, CRDs are not applied during Helm upgrade action by Helm + https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ + type: boolean + type: object + wait: default: false description: |- - ReuseValues copies values from the current release to a new release if the - new release does not have any values. If the request already has values, - or if there are no values in the current release, this does nothing. - This is skipped if the ResetValues flag is set, in which case the - request values are not altered. + if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet + are in a ready state before marking the release as successful. It will wait for as long as --timeout + Default to false type: boolean - subNotes: + waitForJobs: default: false - description: SubNotes determines whether sub-notes are - rendered in the chart. + description: |- + if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. + It will wait for as long as --timeout + Default to false + type: boolean + type: object + registryCredentialsConfig: + description: |- + RegistryCredentialsConfig is an optional configuration for credentials, + including information to connect to private registries. + properties: + ca: + description: |- + CASecretRef references a secret containing the TLS CA certificate + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + key: ca.crt + properties: + name: + description: name is unique within a namespace to + reference a secret resource. + type: string + namespace: + description: namespace defines the space within + which the secret name must be unique. + type: string + type: object + x-kubernetes-map-type: atomic + credentials: + description: |- + CredentialsSecretRef references a secret containing credentials + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + properties: + name: + description: name is unique within a namespace to + reference a secret resource. + type: string + namespace: + description: namespace defines the space within + which the secret name must be unique. + type: string + type: object + x-kubernetes-map-type: atomic + insecureSkipTLSVerify: + description: InsecureSkipTLSVerify controls server certificate + verification. type: boolean - upgradeCRDs: - default: false + key: description: |- - UpgradeCRDs upgrade CRDs from the Helm Chart's crds directory - By default, CRDs are not applied during Helm upgrade action by Helm - https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ + Key specifies the key within the CredentialsSecretRef containing the data + If not specified, it defaults to the only key in the secret if there's just one. + type: string + plainHTTP: + description: PlainHTTP indicates to use insecure HTTP + connections for the chart download type: boolean type: object - wait: - default: false + releaseName: + description: ReleaseName is the chart release + minLength: 1 + type: string + releaseNamespace: + description: ReleaseNamespace is the namespace release will + be installed + minLength: 1 + type: string + repositoryName: + description: RepositoryName is the name helm chart repository + minLength: 1 + type: string + repositoryURL: + description: RepositoryURL is the URL helm chart repository + minLength: 1 + type: string + values: description: |- - if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet - are in a ready state before marking the release as successful. It will wait for as long as --timeout - Default to false - type: boolean - waitForJobs: - default: false + Values field allows to define configuration for the Helm release. + These values can be static or leverage Go templates for dynamic customization. + When expressed as templates, the values are filled in using information from + resources within the management cluster before deployment (Cluster and TemplateResourceRefs) + type: string + valuesFrom: description: |- - if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. - It will wait for as long as --timeout - Default to false - type: boolean - type: object - releaseName: - description: ReleaseName is the chart release - minLength: 1 - type: string - releaseNamespace: - description: ReleaseNamespace is the namespace release will - be installed - minLength: 1 - type: string - repositoryName: - description: RepositoryName is the name helm chart repository - minLength: 1 - type: string - repositoryURL: - description: RepositoryURL is the URL helm chart repository - minLength: 1 - type: string - values: - description: |- - Values field allows to define configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - type: string - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to store configuration for the Helm release. - These values can be static or leverage Go templates for dynamic customization. - When expressed as templates, the values are filled in using information from - resources within the management cluster before deployment. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - chartName - - chartVersion - - releaseName - - releaseNamespace - - repositoryName - - repositoryURL - type: object - type: array - kustomizationRefs: - description: |- - Kustomization refs is a list of kustomization paths. Kustomization will - be run on those paths and the outcome will be deployed. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - flux GitRepository;OCIRepository;Bucket - - ConfigMap/Secret - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the kustomization.yaml file, or the - set of plain YAMLs a kustomization.yaml should be generated for. - Defaults to 'None', which translates to the root path of the SourceRef. - type: string - targetNamespace: - description: |- - TargetNamespace sets or overrides the namespace in the - kustomization.yaml file. - maxLength: 63 - minLength: 1 - type: string - values: - additionalProperties: - type: string - description: |- - Values is a map[string]string type that allows to define a set of key-value pairs. - These key-value pairs can optionally leverage Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - type: object - valuesFrom: - description: |- - ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, - it is possible to define key-value pairs. These key-value pairs can optionally leverage - Go templates for further processing. - With Sveltos, you can define key-value pairs where the values can be Go templates. - These templates have access to management cluster information during deployment. This allows - to do more than just replace placeholders. Variables can be used to dynamically - construct values based on other resources or variables within the Kustomize output. - For example, imagine you have a Region key with a template value like: - '{{ index .Cluster.metadata.labels "region" }}'. - This template retrieves the region label from the cluster instance metadata. - Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. - The output itself can also contain templates, like: - region: '{{ default "west" .Region }}'. - This way, the final output from Kustomize will have the region set dynamically based on - the actual region retrieved earlier. - items: - properties: - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - enum: - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. The Profile namespace will be used. + ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, + it is possible to store configuration for the Helm release. + These values can be static or leverage Go templates for dynamic customization. + When expressed as templates, the values are filled in using information from + resources within the management cluster before deployment (Cluster and TemplateResourceRefs) + items: + properties: + kind: + description: |- + Kind of the resource. Supported kinds are: + - ConfigMap/Secret + enum: + - ConfigMap + - Secret + type: string + name: + description: |- + Name of the referenced resource. + Name can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind + minLength: 1 + type: string + namespace: + description: |- + Namespace of the referenced resource. + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + For Profile namespace must be left empty. The Profile namespace will be used. + type: string + required: + - kind + - name + type: object + type: array + required: + - chartName + - chartVersion + - releaseName + - releaseNamespace + - repositoryName + - repositoryURL + type: object + type: array + kustomizationRefs: + description: |- + Kustomization refs is a list of kustomization paths. Kustomization will + be run on those paths and the outcome will be deployed. + items: + properties: + deploymentType: + default: Remote + description: |- + DeploymentType indicates whether resources need to be deployed + into the management cluster (local) or the managed cluster (remote) + enum: + - Local + - Remote + type: string + kind: + description: |- + Kind of the resource. Supported kinds are: + - flux GitRepository;OCIRepository;Bucket + - ConfigMap/Secret + enum: + - GitRepository + - OCIRepository + - Bucket + - ConfigMap + - Secret + type: string + name: + description: |- + Name of the referenced resource. + Name can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind + minLength: 1 + type: string + namespace: + description: |- + Namespace of the referenced resource. + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + For Profile namespace must be left empty. The Profile namespace will be used. + type: string + path: + description: |- + Path to the directory containing the kustomization.yaml file, or the + set of plain YAMLs a kustomization.yaml should be generated for. + Defaults to 'None', which translates to the root path of the SourceRef. + These values can be static or leverage Go templates for dynamic customization. + When expressed as templates, the values are filled in using information from + resources within the management cluster before deployment (Cluster) + type: string + targetNamespace: + description: |- + TargetNamespace sets or overrides the namespace in the + kustomization.yaml file. + maxLength: 63 + minLength: 1 + type: string + values: + additionalProperties: type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - kind - - name - - namespace - type: object - type: array - maxUpdate: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of clusters that can be updated concurrently. - Value can be an absolute number (ex: 5) or a percentage of desired cluster (ex: 10%). - Defaults to 100%. - Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile - changes, only 30% of matching clusters will be updated in parallel. Only when updates - in those cluster succeed, other matching clusters are updated. - pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ - x-kubernetes-int-or-string: true - policyRefs: - description: |- - PolicyRefs references all the ConfigMaps/Secrets containing kubernetes resources - that need to be deployed in the matching CAPI clusters. - items: - properties: - deploymentType: - default: Remote - description: |- - DeploymentType indicates whether resources need to be deployed - into the management cluster (local) or the managed cluster (remote) - enum: - - Local - - Remote - type: string - kind: - description: |- - Kind of the resource. Supported kinds are: - - ConfigMap/Secret - - flux GitRepository;OCIRepository;Bucket - enum: - - GitRepository - - OCIRepository - - Bucket - - ConfigMap - - Secret - type: string - name: - description: Name of the referenced resource. - minLength: 1 - type: string - namespace: - description: |- - Namespace of the referenced resource. - For ClusterProfile namespace can be left empty. In such a case, namespace will - be implicit set to cluster's namespace. - For Profile namespace must be left empty. Profile namespace will be used. - type: string - path: - description: |- - Path to the directory containing the YAML files. - Defaults to 'None', which translates to the root path of the SourceRef. - Used only for GitRepository;OCIRepository;Bucket - type: string - required: - - kind - - name - type: object - type: array - reloader: - default: false - description: |- - Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed - by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade - when a ConfigMap/Secret instance mounted as volume is modified. - When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically - starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it. - type: boolean - setRefs: - description: |- - SetRefs identifies referenced (cluster)Sets. - - ClusterProfile can reference ClusterSet; - - Profile can reference Set; - items: - type: string - type: array - stopMatchingBehavior: - default: WithdrawPolicies - description: |- - StopMatchingBehavior indicates what behavior should be when a Cluster stop matching - the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will - be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead - leave ClusterProfile deployed policies in the Cluster. - enum: - - WithdrawPolicies - - LeavePolicies - type: string - syncMode: - default: Continuous - description: |- - SyncMode specifies how features are synced in a matching workload cluster. - - OneTime means, first time a workload cluster matches the ClusterProfile, - features will be deployed in such cluster. Any subsequent feature configuration - change won't be applied into the matching workload clusters; - - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile, - the specified features are deployed. Subsequent changes to the feature configuration are also - automatically applied to all matching workload clusters. - _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors - matching managed clusters for configuration drift. If drift is detected, a reconciliation is - triggered to ensure the managed cluster's configuration aligns with the ClusterProfile. - - DryRun means no change will be propagated to any matching cluster. A report - instead will be generated summarizing what would happen in any matching cluster - because of the changes made to ClusterProfile while in DryRun mode. - enum: - - OneTime - - Continuous - - ContinuousWithDriftDetection - - DryRun - type: string - templateResourceRefs: - description: |- - TemplateResourceRefs is a list of resource to collect from the management cluster. - Those resources' values will be used to instantiate templates contained in referenced - PolicyRefs and Helm charts - items: - properties: - identifier: + description: |- + Values is a map[string]string type that allows to define a set of key-value pairs. + These key-value pairs can optionally leverage Go templates for further processing. + With Sveltos, you can define key-value pairs where the values can be Go templates. + These templates have access to management cluster information during deployment. This allows + to do more than just replace placeholders. Variables can be used to dynamically + construct values based on other resources or variables within the Kustomize output. + For example, imagine you have a Region key with a template value like: + '{{ index .Cluster.metadata.labels "region" }}'. + This template retrieves the region label from the cluster instance metadata. + Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. + The output itself can also contain templates, like: + region: '{{ default "west" .Region }}'. + This way, the final output from Kustomize will have the region set dynamically based on + the actual region retrieved earlier. + type: object + valuesFrom: + description: |- + ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data, + it is possible to define key-value pairs. These key-value pairs can optionally leverage + Go templates for further processing. + With Sveltos, you can define key-value pairs where the values can be Go templates. + These templates have access to management cluster information during deployment. This allows + to do more than just replace placeholders. Variables can be used to dynamically + construct values based on other resources or variables within the Kustomize output. + For example, imagine you have a Region key with a template value like: + '{{ index .Cluster.metadata.labels "region" }}'. + This template retrieves the region label from the cluster instance metadata. + Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output. + The output itself can also contain templates, like: + region: '{{ default "west" .Region }}'. + This way, the final output from Kustomize will have the region set dynamically based on + the actual region retrieved earlier. + items: + properties: + kind: + description: |- + Kind of the resource. Supported kinds are: + - ConfigMap/Secret + enum: + - ConfigMap + - Secret + type: string + name: + description: |- + Name of the referenced resource. + Name can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind + minLength: 1 + type: string + namespace: + description: |- + Namespace of the referenced resource. + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + For Profile namespace must be left empty. The Profile namespace will be used. + type: string + required: + - kind + - name + type: object + type: array + required: + - kind + - name + - namespace + type: object + type: array + maxConsecutiveFailures: + description: |- + The maximum number of consecutive deployment failures that Sveltos will permit. + After this many consecutive failures, the deployment will be considered failed, and Sveltos will stop retrying. + This setting applies only to feature deployments, not resource removal. + This field is optional. If not set, Sveltos default behavior is to keep retrying. + type: integer + maxUpdate: + anyOf: + - type: integer + - type: string + description: |- + The maximum number of clusters that can be updated concurrently. + Value can be an absolute number (ex: 5) or a percentage of desired cluster (ex: 10%). + Defaults to 100%. + Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile + changes, only 30% of matching clusters will be updated in parallel. Only when updates + in those cluster succeed, other matching clusters are updated. + pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ + x-kubernetes-int-or-string: true + patches: + description: |- + Define additional Kustomize inline Patches applied for all resources on this profile + Within the Patch Spec you can use templating + items: description: |- - Identifier is how the resource will be referred to in the - template + Patch contains an inline StrategicMerge or JSON6902 patch, and the target the patch should + be applied to. + properties: + patch: + description: |- + Patch contains an inline StrategicMerge patch or an inline JSON6902 patch with + an array of operation objects. + These values can be static or leverage Go templates for dynamic customization. + When expressed as templates, the values are filled in using information from + resources within the management cluster before deployment (Cluster and TemplateResourceRefs) + type: string + target: + description: Target points to the resources that the patch + document should be applied to. + properties: + annotationSelector: + description: |- + AnnotationSelector is a string that follows the label selection expression + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api + It matches with the resource annotations. + type: string + group: + description: |- + Group is the API group to select resources from. + Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + kind: + description: |- + Kind of the API Group to select resources from. + Together with Group and Version it is capable of unambiguously + identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + labelSelector: + description: |- + LabelSelector is a string that follows the label selection expression + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api + It matches with the resource labels. + type: string + name: + description: Name to match resources with. + type: string + namespace: + description: Namespace to select resources from. + type: string + version: + description: |- + Version of the API Group to select resources from. + Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources. + https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md + type: string + type: object + required: + - patch + type: object + type: array + policyRefs: + description: |- + PolicyRefs references all the ConfigMaps/Secrets/Flux Sources containing kubernetes resources + that need to be deployed in the matching managed clusters. + The values contained in those resources can be static or leverage Go templates for dynamic customization. + When expressed as templates, the values are filled in using information from + resources within the management cluster before deployment (Cluster and TemplateResourceRefs) + items: + properties: + deploymentType: + default: Remote + description: |- + DeploymentType indicates whether resources need to be deployed + into the management cluster (local) or the managed cluster (remote) + enum: + - Local + - Remote + type: string + kind: + description: |- + Kind of the resource. Supported kinds are: + - ConfigMap/Secret + - flux GitRepository;OCIRepository;Bucket + enum: + - GitRepository + - OCIRepository + - Bucket + - ConfigMap + - Secret + type: string + name: + description: |- + Name of the referenced resource. + Name can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind + minLength: 1 + type: string + namespace: + description: |- + Namespace of the referenced resource. + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + For Profile namespace must be left empty. Profile namespace will be used. + type: string + path: + description: |- + Path to the directory containing the YAML files. + Defaults to 'None', which translates to the root path of the SourceRef. + Used only for GitRepository;OCIRepository;Bucket + type: string + required: + - kind + - name + type: object + type: array + reloader: + default: false + description: |- + Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed + by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade + when a ConfigMap/Secret instance mounted as volume is modified. + When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically + starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it. + type: boolean + setRefs: + description: |- + SetRefs identifies referenced (cluster)Sets. + - ClusterProfile can reference ClusterSet; + - Profile can reference Set; + items: type: string - resource: - description: |- - Resource references a Kubernetes instance in the management - cluster to fetch and use during template instantiation. + type: array + stopMatchingBehavior: + default: WithdrawPolicies + description: |- + StopMatchingBehavior indicates what behavior should be when a Cluster stop matching + the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will + be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead + leave ClusterProfile deployed policies in the Cluster. + enum: + - WithdrawPolicies + - LeavePolicies + type: string + syncMode: + default: Continuous + description: |- + SyncMode specifies how features are synced in a matching workload cluster. + - OneTime means, first time a workload cluster matches the ClusterProfile, + features will be deployed in such cluster. Any subsequent feature configuration + change won't be applied into the matching workload clusters; + - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile, + the specified features are deployed. Subsequent changes to the feature configuration are also + automatically applied to all matching workload clusters. + _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors + matching managed clusters for configuration drift. If drift is detected, a reconciliation is + triggered to ensure the managed cluster's configuration aligns with the ClusterProfile. + - DryRun means no change will be propagated to any matching cluster. A report + instead will be generated summarizing what would happen in any matching cluster + because of the changes made to ClusterProfile while in DryRun mode. + enum: + - OneTime + - Continuous + - ContinuousWithDriftDetection + - DryRun + type: string + templateResourceRefs: + description: |- + TemplateResourceRefs is a list of resource to collect from the management cluster. + Those resources' values will be used to instantiate templates + items: + properties: + identifier: + description: |- + Identifier is how the resource will be referred to in the + template + type: string + resource: + description: |- + Resource references a Kubernetes instance in the management + cluster to fetch and use during template instantiation. + For ClusterProfile namespace can be left empty. In such a case, namespace will + be implicit set to cluster's namespace. + Name and namespace can be expressed as a template and instantiate using + - cluster namespace: .Cluster.metadata.namespace + - cluster name: .Cluster.metadata.name + - cluster type: .Cluster.kind + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: |- + If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would take on a value like: + "spec.containers{name}" (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined way of + referencing a part of an object. + type: string + kind: + description: |- + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + namespace: + description: |- + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + type: string + resourceVersion: + description: |- + Specific resourceVersion to which this reference is made, if any. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + type: string + uid: + description: |- + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + type: string + type: object + x-kubernetes-map-type: atomic + required: + - identifier + - resource + type: object + type: array + x-kubernetes-list-map-keys: + - identifier + x-kubernetes-list-type: map + tier: + default: 100 + description: |- + Tier controls the order of deployment for ClusterProfile or Profile resources targeting + the same cluster resources. + Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes + resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it. + Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest** + Tier value takes priority and deploys the resource. + Higher Tier values represent lower priority. The default Tier value is 100. + Using Tiers provides finer control over resource deployment within your cluster, particularly useful + when multiple configurations manage the same resources. + format: int32 + minimum: 1 + type: integer + validateHealths: + description: |- + ValidateHealths is a slice of Lua functions to run against + the managed cluster to validate the state of those add-ons/applications + is healthy + items: properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: + featureID: description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. + FeatureID is an indentifier of the feature (Helm/Kustomize/Resources) + This field indicates when to run this check. + For instance: + - if set to Helm this check will be run after all helm + charts specified in the ClusterProfile are deployed. + - if set to Resources this check will be run after the content + of all the ConfigMaps/Secrets referenced by ClusterProfile in the + PolicyRef sections is deployed + enum: + - Resources + - Helm + - Kustomize + type: string + group: + description: Group of the resource to fetch in the managed + Cluster. type: string kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + description: Kind of the resource to fetch in the managed + Cluster. + minLength: 1 type: string + labelFilters: + description: LabelFilters allows to filter resources based + on current labels. + items: + properties: + key: + description: Key is the label key + type: string + operation: + description: Operation is the comparison operation + enum: + - Equal + - Different + type: string + value: + description: Value is the label value + type: string + required: + - key + - operation + - value + type: object + type: array name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + description: Name is the name of this check type: string namespace: description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + Namespace of the resource to fetch in the managed Cluster. + Empty for resources scoped at cluster level. type: string - resourceVersion: + script: description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + Script is a text containing a lua script. + Must return struct with field "health" + representing whether object is a match (true or false) type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + version: + description: Version of the resource to fetch in the managed + Cluster. type: string + required: + - featureID + - group + - kind + - name + - version type: object - x-kubernetes-map-type: atomic - required: - - identifier - - resource - type: object - type: array - x-kubernetes-list-map-keys: - - identifier - x-kubernetes-list-type: map - tier: - default: 100 + type: array + type: object + clusterType: + description: ClusterType is the type of Cluster + type: string + required: + - clusterName + - clusterNamespace + - clusterType + type: object + status: + description: ClusterSummaryStatus defines the observed state of ClusterSummary + properties: + dependencies: description: |- - Tier controls the order of deployment for ClusterProfile or Profile resources targeting - the same cluster resources. - Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes - resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it. - Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest** - Tier value takes priority and deploys the resource. - Higher Tier values represent lower priority. The default Tier value is 100. - Using Tiers provides finer control over resource deployment within your cluster, particularly useful - when multiple configurations manage the same resources. - format: int32 - minimum: 1 - type: integer - validateHealths: + Dependencies is a summary reporting the status of the dependencies + for the associated ClusterProfile + type: string + deployedGVKs: description: |- - ValidateHealths is a slice of Lua functions to run against - the managed cluster to validate the state of those add-ons/applications - is healthy + DeployedGVKs reports the list of GVKs deployed by ClusterSummary + in a managed cluster items: properties: - featureID: + deployedGroupVersionKind: description: |- - FeatureID is an indentifier of the feature (Helm/Kustomize/Resources) - This field indicates when to run this check. - For instance: - - if set to Helm this check will be run after all helm - charts specified in the ClusterProfile are deployed. - - if set to Resources this check will be run after the content - of all the ConfigMaps/Secrets referenced by ClusterProfile in the - PolicyRef sections is deployed + DeployedGroupVersionKind contains all GroupVersionKinds deployed in either + the workload cluster or the management cluster because of this feature. + Each element has format kind.version.group + items: + type: string + type: array + featureID: + description: FeatureID is an indentifier of the feature whose + status is reported enum: - Resources - Helm - Kustomize type: string - group: - description: Group of the resource to fetch in the managed Cluster. - type: string - kind: - description: Kind of the resource to fetch in the managed Cluster. - minLength: 1 - type: string - labelFilters: - description: LabelFilters allows to filter resources based on - current labels. + required: + - featureID + type: object + type: array + x-kubernetes-list-map-keys: + - featureID + x-kubernetes-list-type: map + featureSummaries: + description: |- + FeatureSummaries reports the status of each workload cluster feature + directly managed by ClusterProfile. + items: + description: |- + FeatureSummary contains a summary of the state of a workload + cluster feature. + properties: + consecutiveFailures: + description: The number of consecutive deployment failures. + type: integer + deployedGroupVersionKind: + description: |- + DeployedGroupVersionKind contains all GroupVersionKinds deployed in either + the workload cluster or the management cluster because of this feature. + Each element has format kind.version.group + Deprecated: Replaced by FeatureDeploymentInfo field instead items: - properties: - key: - description: Key is the label key - type: string - operation: - description: Operation is the comparison operation - enum: - - Equal - - Different - type: string - value: - description: Value is the label value - type: string - required: - - key - - operation - - value - type: object + type: string type: array - name: - description: Name is the name of this check + failureMessage: + description: FailureMessage provides more information about + the error. + type: string + failureReason: + description: FailureReason indicates the type of error that + occurred. type: string - namespace: - description: |- - Namespace of the resource to fetch in the managed Cluster. - Empty for resources scoped at cluster level. + featureID: + description: FeatureID is an indentifier of the feature whose + status is reported + enum: + - Resources + - Helm + - Kustomize type: string - script: + hash: description: |- - Script is a text containing a lua script. - Must return struct with field "health" - representing whether object is a match (true or false) + Hash represents of a unique value for a feature at a fixed point in + time + format: byte type: string - version: - description: Version of the resource to fetch in the managed - Cluster. + lastAppliedTime: + description: LastAppliedTime is the time feature was last reconciled + format: date-time + type: string + status: + description: Status represents the state of the feature in the + workload cluster + enum: + - Provisioning + - Provisioned + - Failed + - FailedNonRetriable + - Removing + - Removed type: string required: - featureID - - group - - kind - - name - - version type: object type: array - type: object - status: - description: Status defines the observed state of ClusterProfile/Profile - properties: - matchingClusters: + x-kubernetes-list-map-keys: + - featureID + x-kubernetes-list-type: map + helmReleaseSummaries: description: |- - MatchingClusterRefs reference all the clusters currently matching - ClusterProfile ClusterSelector + HelmReleaseSummaries reports the status of each helm chart + directly managed by ClusterProfile. items: - description: ObjectReference contains enough information to let - you inspect or modify the referred object. properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: + conflictMessage: description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + Status indicates whether ClusterSummary can manage the helm + chart or there is a conflict type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + releaseName: + description: ReleaseName is the chart release + minLength: 1 type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + releaseNamespace: + description: ReleaseNamespace is the namespace release will + be installed + minLength: 1 type: string - resourceVersion: + status: description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + Status indicates whether ClusterSummary can manage the helm + chart or there is a conflict + enum: + - Managing + - Conflict type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + valuesHash: + description: ValuesHash represents of a unique value for the + values section + format: byte type: string + required: + - releaseName + - releaseNamespace + - status type: object - x-kubernetes-map-type: atomic type: array - updatedClusters: - description: |- - UpdatedClusters contains information all the cluster currently matching - ClusterProfile ClusterSelector and already updated to latest ClusterProfile - Spec - properties: - clusters: - description: |- - Clusters reference all the clusters currently matching - ClusterProfile ClusterSelector and already updated/being updated - to ClusterProfile Spec - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - hash: - description: |- - Hash represents of a unique value for ClusterProfile Spec at - a fixed point in time - format: byte - type: string - type: object - updatingClusters: - description: |- - UpdatingClusters reference all the cluster currently matching - ClusterProfile ClusterSelector and being updated - properties: - clusters: - description: |- - Clusters reference all the clusters currently matching - ClusterProfile ClusterSelector and already updated/being updated - to ClusterProfile Spec - items: - description: ObjectReference contains enough information to - let you inspect or modify the referred object. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: |- - If referring to a piece of an object instead of an entire object, this string - should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to have some well-defined way of - referencing a part of an object. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - resourceVersion: - description: |- - Specific resourceVersion to which this reference is made, if any. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - type: string - uid: - description: |- - UID of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - type: string - type: object - x-kubernetes-map-type: atomic - type: array - hash: - description: |- - Hash represents of a unique value for ClusterProfile Spec at - a fixed point in time - format: byte - type: string - type: object + x-kubernetes-list-type: atomic type: object type: object served: true - storage: false + storage: true subresources: status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.17.2 + name: profiles.config.projectsveltos.io +spec: + group: config.projectsveltos.io + names: + kind: Profile + listKind: ProfileList + plural: profiles + singular: profile + scope: Namespaced + versions: - name: v1beta1 schema: openAPIV3Schema: diff --git a/test/fv/conversion_test.go b/test/fv/conversion_test.go deleted file mode 100644 index c1d11e95..00000000 --- a/test/fv/conversion_test.go +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright 2024. projectsveltos.io. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fv_test - -import ( - "context" - "encoding/json" - "fmt" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - - configv1alpha1 "github.com/projectsveltos/addon-controller/api/v1alpha1" - configv1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" - "github.com/projectsveltos/addon-controller/controllers" - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" - libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" -) - -var _ = Describe("Conversion", func() { - const ( - namePrefix = "conversion-" - ) - - It("Post a ClusterProfile.v1alpha1 and verify all is deployed", Label("FV", "EXTENDED"), func() { - selector := fmt.Sprintf("%s=%s", key, value) - - Byf("Creating ClusterProfile.v1alpha1") - v1alpha1ClusterProfile := &configv1alpha1.ClusterProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: namePrefix + randomString(), - }, - Spec: configv1alpha1.Spec{ - ClusterSelector: libsveltosv1alpha1.Selector(selector), - }, - } - - v1alpha1ClusterProfile.Spec.SyncMode = configv1alpha1.SyncModeContinuous - Expect(k8sClient.Create(context.TODO(), v1alpha1ClusterProfile)).To(Succeed()) - - Byf("Getting ClusterProfile.v1beta1 %s", v1alpha1ClusterProfile.Name) - v1beta1ClusterProfile := &configv1beta1.ClusterProfile{} - Expect(k8sClient.Get(context.TODO(), - types.NamespacedName{Name: v1alpha1ClusterProfile.Name}, - v1beta1ClusterProfile)).To(Succeed()) - - verifyClusterProfileMatches(v1beta1ClusterProfile) - - v1beta1Spec, err := convertV1Alpha1SpecToV1Beta1(&v1alpha1ClusterProfile.Spec) - Expect(err).To(BeNil()) - - verifyClusterSummary(controllers.ClusterProfileLabelName, - v1alpha1ClusterProfile.Name, &v1beta1Spec, - kindWorkloadCluster.Namespace, kindWorkloadCluster.Name) - - configMapNs := randomString() - Byf("Create configMap's namespace %s", configMapNs) - ns := &corev1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: configMapNs, - }, - } - Expect(k8sClient.Create(context.TODO(), ns)).To(Succeed()) - - Byf("Create a configMap with a Namespace") - deployedNamespaceName := randomString() - configMap := createConfigMapWithPolicy(configMapNs, namePrefix+randomString(), - fmt.Sprintf(namespace, deployedNamespaceName)) - Expect(k8sClient.Create(context.TODO(), configMap)).To(Succeed()) - currentConfigMap := &corev1.ConfigMap{} - Expect(k8sClient.Get(context.TODO(), - types.NamespacedName{Namespace: configMap.Namespace, Name: configMap.Name}, currentConfigMap)).To(Succeed()) - - Byf("Update ClusterProfile.v1alpha1 %s to reference ConfigMap %s/%s", v1alpha1ClusterProfile.Name, configMap.Namespace, configMap.Name) - currentClusterProfile := &configv1alpha1.ClusterProfile{} - Expect(k8sClient.Get(context.TODO(), types.NamespacedName{Name: v1alpha1ClusterProfile.Name}, currentClusterProfile)).To(Succeed()) - currentClusterProfile.Spec.PolicyRefs = []configv1alpha1.PolicyRef{ - { - Kind: string(libsveltosv1beta1.ConfigMapReferencedResourceKind), - Namespace: configMap.Namespace, - Name: configMap.Name, - }, - } - Expect(k8sClient.Update(context.TODO(), currentClusterProfile)).To(Succeed()) - - v1beta1Spec, err = convertV1Alpha1SpecToV1Beta1(¤tClusterProfile.Spec) - Expect(err).To(BeNil()) - - clusterSummary := verifyClusterSummary(controllers.ClusterProfileLabelName, - currentClusterProfile.Name, &v1beta1Spec, - kindWorkloadCluster.Namespace, kindWorkloadCluster.Name) - - Byf("Getting client to access the workload cluster") - workloadClient, err := getKindWorkloadClusterKubeconfig() - Expect(err).To(BeNil()) - Expect(workloadClient).ToNot(BeNil()) - - Byf("Verifying proper Namespace is created in the workload cluster") - Eventually(func() error { - currentNs := &corev1.Namespace{} - return workloadClient.Get(context.TODO(), types.NamespacedName{Name: deployedNamespaceName}, currentNs) - }, timeout, pollingInterval).Should(BeNil()) - - Byf("Verifying ClusterSummary %s status is set to Deployed for Resources feature", clusterSummary.Name) - verifyFeatureStatusIsProvisioned(kindWorkloadCluster.Namespace, clusterSummary.Name, configv1beta1.FeatureResources) - - policies := []policy{ - {kind: "Namespace", name: deployedNamespaceName, namespace: "", group: ""}, - } - verifyClusterConfiguration(configv1beta1.ClusterProfileKind, v1alpha1ClusterProfile.Name, - clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName, configv1beta1.FeatureResources, - policies, nil) - - Byf("Changing clusterprofile.v1alpha1 to not reference configmap anymore") - Expect(k8sClient.Get(context.TODO(), types.NamespacedName{Name: v1alpha1ClusterProfile.Name}, currentClusterProfile)).To(Succeed()) - currentClusterProfile.Spec.PolicyRefs = []configv1alpha1.PolicyRef{} - Expect(k8sClient.Update(context.TODO(), currentClusterProfile)).To(Succeed()) - - v1beta1Spec, err = convertV1Alpha1SpecToV1Beta1(¤tClusterProfile.Spec) - Expect(err).To(BeNil()) - - verifyClusterSummary(controllers.ClusterProfileLabelName, - currentClusterProfile.Name, &v1beta1Spec, - kindWorkloadCluster.Namespace, kindWorkloadCluster.Name) - - Byf("Verifying Namespace is removed in the workload cluster") - Eventually(func() bool { - currentNs := &corev1.Namespace{} - err = workloadClient.Get(context.TODO(), types.NamespacedName{Name: deployedNamespaceName}, currentNs) - return err != nil && - apierrors.IsNotFound(err) - }, timeout, pollingInterval).Should(BeTrue()) - - deleteClusterProfile(v1beta1ClusterProfile) - - currentNs := &corev1.Namespace{} - Expect(k8sClient.Get(context.TODO(), types.NamespacedName{Name: configMapNs}, currentNs)).To(Succeed()) - Expect(k8sClient.Delete(context.TODO(), currentNs)).To(Succeed()) - }) -}) - -func convertV1Alpha1SpecToV1Beta1(srcSpec *configv1alpha1.Spec) (configv1beta1.Spec, error) { - dstSpec := configv1beta1.Spec{} - - dstSpec.ClusterRefs = srcSpec.ClusterRefs - dstSpec.ContinueOnConflict = srcSpec.ContinueOnConflict - dstSpec.DependsOn = srcSpec.DependsOn - dstSpec.ExtraAnnotations = srcSpec.ExtraAnnotations - dstSpec.ExtraLabels = srcSpec.ExtraLabels - - jsonData, err := json.Marshal(srcSpec.HelmCharts) // Marshal the Spec field - if err != nil { - return dstSpec, fmt.Errorf("error marshaling Spec.HelmCharts: %w", err) - } - err = json.Unmarshal(jsonData, &dstSpec.HelmCharts) // Unmarshal to v1beta1 type - if err != nil { - return dstSpec, fmt.Errorf("error unmarshaling JSON: %w", err) - } - - jsonData, err = json.Marshal(srcSpec.KustomizationRefs) // Marshal the Spec field - if err != nil { - return dstSpec, fmt.Errorf("error marshaling Spec.KustomizationRefs: %w", err) - } - err = json.Unmarshal(jsonData, &dstSpec.KustomizationRefs) // Unmarshal to v1beta1 type - if err != nil { - return dstSpec, fmt.Errorf("error unmarshaling JSON: %w", err) - } - - jsonData, err = json.Marshal(srcSpec.PolicyRefs) // Marshal the Spec field - if err != nil { - return dstSpec, fmt.Errorf("error marshaling Spec.PolicyRefs: %w", err) - } - err = json.Unmarshal(jsonData, &dstSpec.PolicyRefs) // Unmarshal to v1beta1 type - if err != nil { - return dstSpec, fmt.Errorf("error unmarshaling JSON: %w", err) - } - - dstSpec.Reloader = srcSpec.Reloader - dstSpec.SetRefs = srcSpec.SetRefs - - labelSelector, err := metav1.ParseToLabelSelector(string(srcSpec.ClusterSelector)) - if err != nil { - return dstSpec, fmt.Errorf("error converting labels.Selector to metav1.Selector: %w", err) - } - dstSpec.ClusterSelector = libsveltosv1beta1.Selector{LabelSelector: *labelSelector} - - return dstSpec, nil -} diff --git a/test/fv/fv_suite_test.go b/test/fv/fv_suite_test.go index 8af8670e..d50c53ed 100644 --- a/test/fv/fv_suite_test.go +++ b/test/fv/fv_suite_test.go @@ -37,7 +37,6 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - configv1alpha1 "github.com/projectsveltos/addon-controller/api/v1alpha1" configv1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" ) @@ -91,7 +90,6 @@ var _ = BeforeSuite(func() { Expect(clientgoscheme.AddToScheme(scheme)).To(Succeed()) Expect(clusterv1.AddToScheme(scheme)).To(Succeed()) Expect(libsveltosv1beta1.AddToScheme(scheme)).To(Succeed()) - Expect(configv1alpha1.AddToScheme(scheme)).To(Succeed()) Expect(configv1beta1.AddToScheme(scheme)).To(Succeed()) Expect(sourcev1.AddToScheme(scheme)).To(Succeed())