diff --git a/api/v1alpha1/sveltoscluster_type.go b/api/v1alpha1/sveltoscluster_type.go index 19a4f45..3c0277f 100644 --- a/api/v1alpha1/sveltoscluster_type.go +++ b/api/v1alpha1/sveltoscluster_type.go @@ -74,6 +74,12 @@ type SveltosClusterSpec struct { // and will be used to connect to the Kubernetes cluster. // +optional KubeconfigName string `json:"kubeconfigName,omitempty"` + + // KubeconfigKeyName specifies the key within the Secret that holds the kubeconfig. + // If not specified, Sveltos will use first key in the Secret. + // +optional + KubeconfigKeyName string `json:"kubeconfigKeyName,omitempty"` + // Paused can be used to prevent controllers from processing the // SveltosCluster and all its associated objects. // +optional diff --git a/api/v1alpha1/zz_generated.conversion.go b/api/v1alpha1/zz_generated.conversion.go index 52fd2cb..5a27635 100644 --- a/api/v1alpha1/zz_generated.conversion.go +++ b/api/v1alpha1/zz_generated.conversion.go @@ -2887,6 +2887,7 @@ func Convert_v1beta1_SveltosClusterList_To_v1alpha1_SveltosClusterList(in *v1bet func autoConvert_v1alpha1_SveltosClusterSpec_To_v1beta1_SveltosClusterSpec(in *SveltosClusterSpec, out *v1beta1.SveltosClusterSpec, s conversion.Scope) error { out.KubeconfigName = in.KubeconfigName + out.KubeconfigKeyName = in.KubeconfigKeyName out.Paused = in.Paused out.TokenRequestRenewalOption = (*v1beta1.TokenRequestRenewalOption)(unsafe.Pointer(in.TokenRequestRenewalOption)) out.ArbitraryData = *(*map[string]string)(unsafe.Pointer(&in.ArbitraryData)) @@ -2902,6 +2903,7 @@ func Convert_v1alpha1_SveltosClusterSpec_To_v1beta1_SveltosClusterSpec(in *Svelt func autoConvert_v1beta1_SveltosClusterSpec_To_v1alpha1_SveltosClusterSpec(in *v1beta1.SveltosClusterSpec, out *SveltosClusterSpec, s conversion.Scope) error { out.KubeconfigName = in.KubeconfigName + out.KubeconfigKeyName = in.KubeconfigKeyName out.Paused = in.Paused out.TokenRequestRenewalOption = (*TokenRequestRenewalOption)(unsafe.Pointer(in.TokenRequestRenewalOption)) out.ArbitraryData = *(*map[string]string)(unsafe.Pointer(&in.ArbitraryData)) diff --git a/api/v1beta1/sveltoscluster_type.go b/api/v1beta1/sveltoscluster_type.go index e4cc593..5042f98 100644 --- a/api/v1beta1/sveltoscluster_type.go +++ b/api/v1beta1/sveltoscluster_type.go @@ -74,6 +74,12 @@ type SveltosClusterSpec struct { // and will be used to connect to the Kubernetes cluster. // +optional KubeconfigName string `json:"kubeconfigName,omitempty"` + + // KubeconfigKeyName specifies the key within the Secret that holds the kubeconfig. + // If not specified, Sveltos will use first key in the Secret. + // +optional + KubeconfigKeyName string `json:"kubeconfigKeyName,omitempty"` + // Paused can be used to prevent controllers from processing the // SveltosCluster and all its associated objects. // +optional diff --git a/config/crd/bases/lib.projectsveltos.io_accessrequests.yaml b/config/crd/bases/lib.projectsveltos.io_accessrequests.yaml index ac88d81..db26796 100644 --- a/config/crd/bases/lib.projectsveltos.io_accessrequests.yaml +++ b/config/crd/bases/lib.projectsveltos.io_accessrequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: accessrequests.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_classifierreports.yaml b/config/crd/bases/lib.projectsveltos.io_classifierreports.yaml index e806f15..aa97729 100644 --- a/config/crd/bases/lib.projectsveltos.io_classifierreports.yaml +++ b/config/crd/bases/lib.projectsveltos.io_classifierreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: classifierreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_classifiers.yaml b/config/crd/bases/lib.projectsveltos.io_classifiers.yaml index 072bb98..4ec9bf9 100644 --- a/config/crd/bases/lib.projectsveltos.io_classifiers.yaml +++ b/config/crd/bases/lib.projectsveltos.io_classifiers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: classifiers.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_clusterhealthchecks.yaml b/config/crd/bases/lib.projectsveltos.io_clusterhealthchecks.yaml index f264ba4..8055dff 100644 --- a/config/crd/bases/lib.projectsveltos.io_clusterhealthchecks.yaml +++ b/config/crd/bases/lib.projectsveltos.io_clusterhealthchecks.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: clusterhealthchecks.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_clustersets.yaml b/config/crd/bases/lib.projectsveltos.io_clustersets.yaml index 0289879..2f163fe 100644 --- a/config/crd/bases/lib.projectsveltos.io_clustersets.yaml +++ b/config/crd/bases/lib.projectsveltos.io_clustersets.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: clustersets.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_debuggingconfigurations.yaml b/config/crd/bases/lib.projectsveltos.io_debuggingconfigurations.yaml index 15b7532..1cf10c7 100644 --- a/config/crd/bases/lib.projectsveltos.io_debuggingconfigurations.yaml +++ b/config/crd/bases/lib.projectsveltos.io_debuggingconfigurations.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: debuggingconfigurations.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_eventreports.yaml b/config/crd/bases/lib.projectsveltos.io_eventreports.yaml index b82b93b..159aecb 100644 --- a/config/crd/bases/lib.projectsveltos.io_eventreports.yaml +++ b/config/crd/bases/lib.projectsveltos.io_eventreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: eventreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_eventsources.yaml b/config/crd/bases/lib.projectsveltos.io_eventsources.yaml index 836951c..1a2a9ef 100644 --- a/config/crd/bases/lib.projectsveltos.io_eventsources.yaml +++ b/config/crd/bases/lib.projectsveltos.io_eventsources.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: eventsources.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_healthcheckreports.yaml b/config/crd/bases/lib.projectsveltos.io_healthcheckreports.yaml index a8e4ab1..62ca482 100644 --- a/config/crd/bases/lib.projectsveltos.io_healthcheckreports.yaml +++ b/config/crd/bases/lib.projectsveltos.io_healthcheckreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: healthcheckreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_healthchecks.yaml b/config/crd/bases/lib.projectsveltos.io_healthchecks.yaml index 0987c9e..4512956 100644 --- a/config/crd/bases/lib.projectsveltos.io_healthchecks.yaml +++ b/config/crd/bases/lib.projectsveltos.io_healthchecks.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: healthchecks.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_reloaderreports.yaml b/config/crd/bases/lib.projectsveltos.io_reloaderreports.yaml index 296ec43..4ce6fc9 100644 --- a/config/crd/bases/lib.projectsveltos.io_reloaderreports.yaml +++ b/config/crd/bases/lib.projectsveltos.io_reloaderreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: reloaderreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_reloaders.yaml b/config/crd/bases/lib.projectsveltos.io_reloaders.yaml index ba80ccc..195b194 100644 --- a/config/crd/bases/lib.projectsveltos.io_reloaders.yaml +++ b/config/crd/bases/lib.projectsveltos.io_reloaders.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: reloaders.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_resourcesummaries.yaml b/config/crd/bases/lib.projectsveltos.io_resourcesummaries.yaml index 909ee88..29fb65f 100644 --- a/config/crd/bases/lib.projectsveltos.io_resourcesummaries.yaml +++ b/config/crd/bases/lib.projectsveltos.io_resourcesummaries.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: resourcesummaries.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_rolerequests.yaml b/config/crd/bases/lib.projectsveltos.io_rolerequests.yaml index 2b3ff34..a1db94a 100644 --- a/config/crd/bases/lib.projectsveltos.io_rolerequests.yaml +++ b/config/crd/bases/lib.projectsveltos.io_rolerequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: rolerequests.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_sets.yaml b/config/crd/bases/lib.projectsveltos.io_sets.yaml index 54adbad..bb89142 100644 --- a/config/crd/bases/lib.projectsveltos.io_sets.yaml +++ b/config/crd/bases/lib.projectsveltos.io_sets.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: sets.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/config/crd/bases/lib.projectsveltos.io_sveltosclusters.yaml b/config/crd/bases/lib.projectsveltos.io_sveltosclusters.yaml index d228393..3499d5a 100644 --- a/config/crd/bases/lib.projectsveltos.io_sveltosclusters.yaml +++ b/config/crd/bases/lib.projectsveltos.io_sveltosclusters.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: sveltosclusters.lib.projectsveltos.io spec: group: lib.projectsveltos.io @@ -81,6 +81,11 @@ spec: type: string description: ArbitraryData allows for arbitrary nested structures type: object + kubeconfigKeyName: + description: |- + KubeconfigKeyName specifies the key within the Secret that holds the kubeconfig. + If not specified, Sveltos will use first key in the Secret. + type: string kubeconfigName: description: |- KubeconfigName allows overriding the default Sveltos convention which expected a valid kubeconfig @@ -231,6 +236,11 @@ spec: type: string description: ArbitraryData allows for arbitrary nested structures type: object + kubeconfigKeyName: + description: |- + KubeconfigKeyName specifies the key within the Secret that holds the kubeconfig. + If not specified, Sveltos will use first key in the Secret. + type: string kubeconfigName: description: |- KubeconfigName allows overriding the default Sveltos convention which expected a valid kubeconfig diff --git a/go.mod b/go.mod index 0780f70..4470dd3 100644 --- a/go.mod +++ b/go.mod @@ -13,15 +13,15 @@ require ( github.com/pkg/errors v0.9.1 golang.org/x/text v0.19.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.31.1 - k8s.io/apiextensions-apiserver v0.31.1 - k8s.io/apimachinery v0.31.1 - k8s.io/client-go v0.31.1 + k8s.io/api v0.31.2 + k8s.io/apiextensions-apiserver v0.31.2 + k8s.io/apimachinery v0.31.2 + k8s.io/client-go v0.31.2 k8s.io/klog/v2 v2.130.1 - k8s.io/kubectl v0.31.1 + k8s.io/kubectl v0.31.2 k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 sigs.k8s.io/cluster-api v1.8.4 - sigs.k8s.io/controller-runtime v0.19.0 + sigs.k8s.io/controller-runtime v0.19.1 sigs.k8s.io/kustomize/api v0.18.0 sigs.k8s.io/kustomize/kyaml v0.18.1 ) @@ -87,7 +87,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/cluster-bootstrap v0.31.0 // indirect - k8s.io/component-base v0.31.1 // indirect + k8s.io/component-base v0.31.2 // indirect k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/go.sum b/go.sum index 7148733..a8f36cd 100644 --- a/go.sum +++ b/go.sum @@ -213,30 +213,30 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= -k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= -k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40= -k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ= -k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= -k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= -k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= +k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= +k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= +k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0= +k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM= +k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= +k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= +k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= k8s.io/cluster-bootstrap v0.31.0 h1:jj5t1PArBPddvDypdNpzqnZQ/+qnGxpJuTF7SX05h1Y= k8s.io/cluster-bootstrap v0.31.0/go.mod h1:6ujqWFrBV4amKe1ii/6BXgrd57bF/Q3gXebLJdmfSK4= -k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8= -k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w= +k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA= +k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 h1:1dWzkmJrrprYvjGwh9kEUxmcUV/CtNU8QM7h1FLWQOo= k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38/go.mod h1:coRQXBK9NxO98XUv3ZD6AK3xzHCxV6+b7lrquKwaKzA= -k8s.io/kubectl v0.31.1 h1:ih4JQJHxsEggFqDJEHSOdJ69ZxZftgeZvYo7M/cpp24= -k8s.io/kubectl v0.31.1/go.mod h1:aNuQoR43W6MLAtXQ/Bu4GDmoHlbhHKuyD49lmTC8eJM= +k8s.io/kubectl v0.31.2 h1:gTxbvRkMBwvTSAlobiTVqsH6S8Aa1aGyBcu5xYLsn8M= +k8s.io/kubectl v0.31.2/go.mod h1:EyASYVU6PY+032RrTh5ahtSOMgoDRIux9V1JLKtG5xM= k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 h1:MDF6h2H/h4tbzmtIKTuctcwZmY0tY9mD9fNT47QO6HI= k8s.io/utils v0.0.0-20240921022957-49e7df575cb6/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/cluster-api v1.8.4 h1:jBKQH1H/HUdUFk8T6qDzIxZJfWw1F5ZP0ZpYQJDmTHs= sigs.k8s.io/cluster-api v1.8.4/go.mod h1:pXv5LqLxuIbhGIXykyNKiJh+KrLweSBajVHHitPLyoY= -sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= -sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= +sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo= diff --git a/hack/tools/go.mod b/hack/tools/go.mod index e5dffbe..4989b7c 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -6,8 +6,8 @@ require ( github.com/a8m/envsubst v1.4.2 github.com/onsi/ginkgo/v2 v2.20.2 golang.org/x/oauth2 v0.23.0 - k8s.io/client-go v0.31.1 - sigs.k8s.io/controller-tools v0.16.3 + k8s.io/client-go v0.31.2 + sigs.k8s.io/controller-tools v0.16.4 ) require ( @@ -17,7 +17,7 @@ require ( github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect - github.com/gobuffalo/flect v1.0.2 // indirect + github.com/gobuffalo/flect v1.0.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 // indirect @@ -31,19 +31,19 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/x448/float16 v0.8.4 // indirect golang.org/x/mod v0.21.0 // indirect - golang.org/x/net v0.29.0 // indirect + golang.org/x/net v0.30.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.6.0 // indirect - golang.org/x/tools v0.25.0 // indirect + golang.org/x/tools v0.26.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.31.1 // indirect - k8s.io/apiextensions-apiserver v0.31.0 // indirect - k8s.io/apimachinery v0.31.1 // indirect + k8s.io/api v0.31.2 // indirect + k8s.io/apiextensions-apiserver v0.31.1 // indirect + k8s.io/apimachinery v0.31.2 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/hack/tools/go.sum b/hack/tools/go.sum index 9148b80..72bc410 100644 --- a/hack/tools/go.sum +++ b/hack/tools/go.sum @@ -25,8 +25,8 @@ github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogB github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= -github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= +github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= +github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= @@ -111,8 +111,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -125,22 +125,22 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= -golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -160,22 +160,22 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= -k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= -k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk= -k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk= -k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= -k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= -k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= +k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= +k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= +k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40= +k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ= +k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= +k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= +k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3 h1:b2FmK8YH+QEwq/Sy2uAEhmqL5nPfGYbJOcaqjeYYZoA= k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-tools v0.16.3 h1:z48C5/d4jCVQQvtiSBL5MYyZ3EO2eFIOXrIKMgHVhFY= -sigs.k8s.io/controller-tools v0.16.3/go.mod h1:AEj6k+w1kYpLZv2einOH3mj52ips4W/6FUjnB5tkJGs= +sigs.k8s.io/controller-tools v0.16.4 h1:VXmar78eDXbx1by/H09ikEq1hiq3bqInxuV3lMr3GmQ= +sigs.k8s.io/controller-tools v0.16.4/go.mod h1:kcsZyYMXiOFuBhofSPtkB90zTSxVRxVVyvtKQcx3q1A= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/lib/clusterproxy/cluster_utils.go b/lib/clusterproxy/cluster_utils.go index 53dfa48..f0ee072 100644 --- a/lib/clusterproxy/cluster_utils.go +++ b/lib/clusterproxy/cluster_utils.go @@ -179,7 +179,8 @@ func GetSecretData(ctx context.Context, c client.Client, } if clusterType == libsveltosv1beta1.ClusterTypeSveltos { - return GetSveltosSecretData(ctx, logger, c, clusterNamespace, clusterName) + data, err := GetSveltosSecretData(ctx, logger, c, clusterNamespace, clusterName) + return data, err } return GetCAPISecretData(ctx, logger, c, clusterNamespace, clusterName) } diff --git a/lib/clusterproxy/clusterproxy.go b/lib/clusterproxy/clusterproxy.go index 99a32be..2d86a25 100644 --- a/lib/clusterproxy/clusterproxy.go +++ b/lib/clusterproxy/clusterproxy.go @@ -149,8 +149,10 @@ func GetSveltosKubernetesClient(ctx context.Context, logger logr.Logger, c clien return client.New(config, client.Options{Scheme: s}) } -func GetSveltosSecretName(ctx context.Context, logger logr.Logger, c client.Client, - clusterNamespace, clusterName string) (string, error) { +// GetSveltosSecretNameAndKey returns the name of the Secret containing the Kubeconfig +// for the SveltosCluster. If a key is specified, returns the name of the key to use. +func GetSveltosSecretNameAndKey(ctx context.Context, logger logr.Logger, c client.Client, + clusterNamespace, clusterName string) (secretName, secretkey string, err error) { logger.WithValues("namespace", clusterNamespace, "cluster", clusterName) logger.V(logs.LogVerbose).Info("Get secret name") @@ -163,42 +165,43 @@ func GetSveltosSecretName(ctx context.Context, logger logr.Logger, c client.Clie if err := c.Get(ctx, key, &cluster); err != nil { if apierrors.IsNotFound(err) { logger.Info("SveltosCluster does not exist") - return "", errors.Wrap(err, + return "", "", errors.Wrap(err, fmt.Sprintf("SveltosCluster %s/%s does not exist", clusterNamespace, clusterName, )) } - return "", err + return "", "", err } - secretName := cluster.Spec.KubeconfigName + secretName = cluster.Spec.KubeconfigName if secretName == "" { secretName = fmt.Sprintf("%s%s", cluster.Name, sveltosKubeconfigSecretNamePostfix) } - return secretName, nil + return secretName, cluster.Spec.KubeconfigKeyName, nil } // GetSveltosSecretData verifies Cluster exists and returns the content of secret containing -// the kubeconfig for Sveltos cluster +// the kubeconfig for Sveltos cluster. func GetSveltosSecretData(ctx context.Context, logger logr.Logger, c client.Client, clusterNamespace, clusterName string) ([]byte, error) { logger.WithValues("namespace", clusterNamespace, "cluster", clusterName) logger.V(logs.LogVerbose).Info("Get secret") - secretName, err := GetSveltosSecretName(ctx, logger, c, clusterNamespace, clusterName) + secretName, secretKey, err := GetSveltosSecretNameAndKey(ctx, logger, c, clusterNamespace, clusterName) if err != nil { return nil, err } - return getSecretData(ctx, logger, c, clusterNamespace, secretName) + data, err := getSecretData(ctx, logger, c, clusterNamespace, secretName, secretKey) + return data, err } // UpdateSveltosSecretData updates the content of the secret containing the // the kubeconfig for Sveltos cluster func UpdateSveltosSecretData(ctx context.Context, logger logr.Logger, c client.Client, - clusterNamespace, clusterName, kubeconfig string) error { + clusterNamespace, clusterName, kubeconfig, kubeconfigKey string) error { logger.WithValues("namespace", clusterNamespace, "cluster", clusterName) logger.V(logs.LogVerbose).Info("Get secret") @@ -239,7 +242,7 @@ func UpdateSveltosSecretData(ctx context.Context, logger logr.Logger, c client.C } secret.Data = map[string][]byte{ - "kubeconfig": []byte(kubeconfig), + kubeconfigKey: []byte(kubeconfig), } return c.Update(ctx, secret) } @@ -348,9 +351,9 @@ func CreateKubeconfig(logger logr.Logger, kubeconfigContent []byte) (string, err } func getSecretData(ctx context.Context, logger logr.Logger, c client.Client, - clusterNamespace, secretName string) ([]byte, error) { + clusterNamespace, secretName, secretKey string) ([]byte, error) { - logger = logger.WithValues("secret", secretName) + logger = logger.WithValues("secret", secretName, "key", secretKey) secret := &corev1.Secret{} key := client.ObjectKey{ @@ -365,9 +368,22 @@ func getSecretData(ctx context.Context, logger logr.Logger, c client.Client, clusterNamespace, secretName)) } - for k, contents := range secret.Data { + if secret.Data == nil { + return nil, errors.New("data section is empty") + } + + if secretKey != "" { + content, ok := secret.Data[secretKey] + if !ok { + return nil, errors.New(fmt.Sprintf("data section does not contain key: %s", secretKey)) + } + + return content, nil + } + + for k, content := range secret.Data { logger.V(logs.LogVerbose).Info("Reading secret", "key", k) - return contents, nil + return content, nil } return nil, nil diff --git a/lib/clusterproxy/clusterproxy_test.go b/lib/clusterproxy/clusterproxy_test.go index 69acbbe..cd65c91 100644 --- a/lib/clusterproxy/clusterproxy_test.go +++ b/lib/clusterproxy/clusterproxy_test.go @@ -268,13 +268,14 @@ var _ = Describe("clusterproxy ", func() { It("UpdateSveltosSecretData updates secret with SveltosCluster kubeconfig", func() { randomData := []byte(randomString()) + kubeconfigKey := randomString() secret := corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Namespace: sveltosCluster.Namespace, Name: sveltosCluster.Name + clusterproxy.SveltosKubeconfigSecretNamePostfix, }, Data: map[string][]byte{ - "value": randomData, + kubeconfigKey: randomData, }, } @@ -286,7 +287,8 @@ var _ = Describe("clusterproxy ", func() { c := fake.NewClientBuilder().WithScheme(scheme).WithObjects(initObjects...).Build() newKubeconfig := randomString() - err := clusterproxy.UpdateSveltosSecretData(context.TODO(), logger, c, sveltosCluster.Namespace, sveltosCluster.Name, newKubeconfig) + err := clusterproxy.UpdateSveltosSecretData(context.TODO(), logger, c, sveltosCluster.Namespace, + sveltosCluster.Name, newKubeconfig, kubeconfigKey) Expect(err).To(BeNil()) currentSecret := &corev1.Secret{} @@ -294,7 +296,7 @@ var _ = Describe("clusterproxy ", func() { Expect(err).To(BeNil()) Expect(currentSecret.Data).ToNot(BeNil()) - Expect(reflect.DeepEqual(currentSecret.Data["kubeconfig"], []byte(newKubeconfig))).To(BeTrue()) + Expect(reflect.DeepEqual(currentSecret.Data[kubeconfigKey], []byte(newKubeconfig))).To(BeTrue()) }) It("getSveltosSecretData returns an error when cluster does not exist", func() { @@ -322,9 +324,37 @@ var _ = Describe("clusterproxy ", func() { clusterproxy.SveltosKubeconfigSecretNamePostfix))) }) + It("getSveltosSecretData returns an error when key with kubeconfig does not exist", func() { + randomData := []byte(randomString()) + kubeconfigKey := "kubeconfig" + secret := corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: sveltosCluster.Namespace, + Name: sveltosCluster.Name + clusterproxy.SveltosKubeconfigSecretNamePostfix, + }, + Data: map[string][]byte{ + kubeconfigKey: randomData, + }, + } + + sveltosCluster.Spec.KubeconfigKeyName = randomString() + initObjects := []client.Object{ + sveltosCluster, + &secret, + } + + c := fake.NewClientBuilder().WithScheme(scheme).WithObjects(initObjects...).Build() + + _, err := clusterproxy.GetSveltosSecretData(context.TODO(), logger, c, sveltosCluster.Namespace, sveltosCluster.Name) + Expect(err).ToNot(BeNil()) + Expect(err.Error()).To(ContainSubstring( + fmt.Sprintf("data section does not contain key: %s", sveltosCluster.Spec.KubeconfigKeyName))) + }) + It("getSveltosSecretData returns overridden secret data", func() { sveltosClusterWithOverride := sveltosCluster.DeepCopy() sveltosClusterWithOverride.Spec.KubeconfigName = randomString() + sveltosClusterWithOverride.Spec.KubeconfigKeyName = randomString() randomData := []byte(randomString()) secret := corev1.Secret{ @@ -333,7 +363,8 @@ var _ = Describe("clusterproxy ", func() { Name: sveltosClusterWithOverride.Spec.KubeconfigName, }, Data: map[string][]byte{ - "value": randomData, + "value": []byte(randomString()), + sveltosClusterWithOverride.Spec.KubeconfigKeyName: randomData, }, } @@ -350,18 +381,48 @@ var _ = Describe("clusterproxy ", func() { Expect(data).To(Equal(randomData)) }) - It("getSveltosSecretData returns default secret data", func() { + It("getSveltosSecretData returns default secret data (multiple keys)", func() { randomData := []byte(randomString()) + key := randomString() secret := corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Namespace: sveltosCluster.Namespace, Name: sveltosCluster.Name + clusterproxy.SveltosKubeconfigSecretNamePostfix, }, Data: map[string][]byte{ - "value": randomData, + randomString(): []byte(randomString()), + key: randomData, + }, + } + + sveltosCluster.Spec.KubeconfigKeyName = key + initObjects := []client.Object{ + sveltosCluster, + &secret, + } + + c := fake.NewClientBuilder().WithScheme(scheme).WithObjects(initObjects...).Build() + + data, err := clusterproxy.GetSveltosSecretData(context.TODO(), logger, c, sveltosCluster.Namespace, + sveltosCluster.Name) + Expect(err).To(BeNil()) + Expect(data).To(Equal(randomData)) + }) + + It("getSveltosSecretData returns default secret data (single key)", func() { + randomData := []byte(randomString()) + key := "value" + secret := corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: sveltosCluster.Namespace, + Name: sveltosCluster.Name + clusterproxy.SveltosKubeconfigSecretNamePostfix, + }, + Data: map[string][]byte{ + key: randomData, }, } + sveltosCluster.Spec.KubeconfigKeyName = key initObjects := []client.Object{ sveltosCluster, &secret, diff --git a/lib/crd/accessrequests.go b/lib/crd/accessrequests.go index 13cf1e9..46a95aa 100644 --- a/lib/crd/accessrequests.go +++ b/lib/crd/accessrequests.go @@ -21,7 +21,7 @@ var AccessRequestCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: accessrequests.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/classifierreports.go b/lib/crd/classifierreports.go index d80fa44..6eadd49 100644 --- a/lib/crd/classifierreports.go +++ b/lib/crd/classifierreports.go @@ -21,7 +21,7 @@ var ClassifierReportCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: classifierreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/classifiers.go b/lib/crd/classifiers.go index 84878bb..bac2318 100644 --- a/lib/crd/classifiers.go +++ b/lib/crd/classifiers.go @@ -21,7 +21,7 @@ var ClassifierCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: classifiers.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/clusterhealthchecks.go b/lib/crd/clusterhealthchecks.go index c3fd47b..9ba8e41 100644 --- a/lib/crd/clusterhealthchecks.go +++ b/lib/crd/clusterhealthchecks.go @@ -22,7 +22,7 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: clusterhealthchecks.lib.projectsveltos.io spec: conversion: diff --git a/lib/crd/clustersets.go b/lib/crd/clustersets.go index 1cc4fdb..5a0f0cb 100644 --- a/lib/crd/clustersets.go +++ b/lib/crd/clustersets.go @@ -22,7 +22,7 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: clustersets.lib.projectsveltos.io spec: conversion: diff --git a/lib/crd/debuggingconfigurations.go b/lib/crd/debuggingconfigurations.go index e621eae..df283cb 100644 --- a/lib/crd/debuggingconfigurations.go +++ b/lib/crd/debuggingconfigurations.go @@ -21,7 +21,7 @@ var DebuggingConfigurationCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: debuggingconfigurations.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/eventreports.go b/lib/crd/eventreports.go index e9076ed..19b8aab 100644 --- a/lib/crd/eventreports.go +++ b/lib/crd/eventreports.go @@ -21,7 +21,7 @@ var EventReportCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: eventreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/eventsources.go b/lib/crd/eventsources.go index af79a75..1edf8f4 100644 --- a/lib/crd/eventsources.go +++ b/lib/crd/eventsources.go @@ -21,7 +21,7 @@ var EventSourceCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: eventsources.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/healthcheckreports.go b/lib/crd/healthcheckreports.go index 1d49797..ac874cd 100644 --- a/lib/crd/healthcheckreports.go +++ b/lib/crd/healthcheckreports.go @@ -21,7 +21,7 @@ var HealthCheckReportCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: healthcheckreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/healthchecks.go b/lib/crd/healthchecks.go index 17e86ed..3e3dcfa 100644 --- a/lib/crd/healthchecks.go +++ b/lib/crd/healthchecks.go @@ -21,7 +21,7 @@ var HealthCheckCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: healthchecks.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/reloaderreports.go b/lib/crd/reloaderreports.go index 57be5e6..22d4d5f 100644 --- a/lib/crd/reloaderreports.go +++ b/lib/crd/reloaderreports.go @@ -21,7 +21,7 @@ var ReloaderReportCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: reloaderreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/reloaders.go b/lib/crd/reloaders.go index 2c7773d..a5cc054 100644 --- a/lib/crd/reloaders.go +++ b/lib/crd/reloaders.go @@ -21,7 +21,7 @@ var ReloaderCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: reloaders.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/resourcesummaries.go b/lib/crd/resourcesummaries.go index 1a05b81..2e1ad21 100644 --- a/lib/crd/resourcesummaries.go +++ b/lib/crd/resourcesummaries.go @@ -21,7 +21,7 @@ var ResourceSummaryCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: resourcesummaries.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/lib/crd/rolerequests.go b/lib/crd/rolerequests.go index f1806eb..f3df278 100644 --- a/lib/crd/rolerequests.go +++ b/lib/crd/rolerequests.go @@ -22,7 +22,7 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: rolerequests.lib.projectsveltos.io spec: conversion: diff --git a/lib/crd/sets.go b/lib/crd/sets.go index d3752f9..39adc01 100644 --- a/lib/crd/sets.go +++ b/lib/crd/sets.go @@ -22,7 +22,7 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: sets.lib.projectsveltos.io spec: conversion: diff --git a/lib/crd/sveltosclusters.go b/lib/crd/sveltosclusters.go index b17f73e..109cb4f 100644 --- a/lib/crd/sveltosclusters.go +++ b/lib/crd/sveltosclusters.go @@ -21,7 +21,7 @@ var SveltosClusterCRD = []byte(`apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: sveltosclusters.lib.projectsveltos.io spec: group: lib.projectsveltos.io @@ -99,6 +99,11 @@ spec: type: string description: ArbitraryData allows for arbitrary nested structures type: object + kubeconfigKeyName: + description: |- + KubeconfigKeyName specifies the key within the Secret that holds the kubeconfig. + If not specified, Sveltos will use first key in the Secret. + type: string kubeconfigName: description: |- KubeconfigName allows overriding the default Sveltos convention which expected a valid kubeconfig @@ -249,6 +254,11 @@ spec: type: string description: ArbitraryData allows for arbitrary nested structures type: object + kubeconfigKeyName: + description: |- + KubeconfigKeyName specifies the key within the Secret that holds the kubeconfig. + If not specified, Sveltos will use first key in the Secret. + type: string kubeconfigName: description: |- KubeconfigName allows overriding the default Sveltos convention which expected a valid kubeconfig diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_accessrequests.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_accessrequests.lib.projectsveltos.io.yaml index f2abfab..a2f175f 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_accessrequests.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_accessrequests.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: accessrequests.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifierreports.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifierreports.lib.projectsveltos.io.yaml index ab763c7..f9d3fca 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifierreports.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifierreports.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: classifierreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifiers.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifiers.lib.projectsveltos.io.yaml index 05bfcc9..15cc910 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifiers.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifiers.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: classifiers.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clusterhealthchecks.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clusterhealthchecks.lib.projectsveltos.io.yaml index cde1126..9fd4ffc 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clusterhealthchecks.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clusterhealthchecks.lib.projectsveltos.io.yaml @@ -3,7 +3,7 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: clusterhealthchecks.lib.projectsveltos.io spec: conversion: diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clustersets.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clustersets.lib.projectsveltos.io.yaml index fe76a01..fd3dace 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clustersets.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clustersets.lib.projectsveltos.io.yaml @@ -3,7 +3,7 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: clustersets.lib.projectsveltos.io spec: conversion: diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_debuggingconfigurations.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_debuggingconfigurations.lib.projectsveltos.io.yaml index a16deed..2f1bafd 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_debuggingconfigurations.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_debuggingconfigurations.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: debuggingconfigurations.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_eventreports.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_eventreports.lib.projectsveltos.io.yaml index ea2ef47..6196c33 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_eventreports.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_eventreports.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: eventreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_eventsources.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_eventsources.lib.projectsveltos.io.yaml index 61c3f5b..0e79a10 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_eventsources.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_eventsources.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: eventsources.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_healthcheckreports.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_healthcheckreports.lib.projectsveltos.io.yaml index 3388842..00412fd 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_healthcheckreports.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_healthcheckreports.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: healthcheckreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_healthchecks.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_healthchecks.lib.projectsveltos.io.yaml index 86c2a87..6e4e4d6 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_healthchecks.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_healthchecks.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: healthchecks.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_reloaderreports.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_reloaderreports.lib.projectsveltos.io.yaml index 3e7b5fc..6dda0b8 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_reloaderreports.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_reloaderreports.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: reloaderreports.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_reloaders.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_reloaders.lib.projectsveltos.io.yaml index 395df7d..5aaba17 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_reloaders.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_reloaders.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: reloaders.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_resourcesummaries.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_resourcesummaries.lib.projectsveltos.io.yaml index 813f8c0..cf74a76 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_resourcesummaries.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_resourcesummaries.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: resourcesummaries.lib.projectsveltos.io spec: group: lib.projectsveltos.io diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_rolerequests.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_rolerequests.lib.projectsveltos.io.yaml index e75ee0e..e9fcc37 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_rolerequests.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_rolerequests.lib.projectsveltos.io.yaml @@ -3,7 +3,7 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: rolerequests.lib.projectsveltos.io spec: conversion: diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_sets.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_sets.lib.projectsveltos.io.yaml index d4c338f..5d98768 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_sets.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_sets.lib.projectsveltos.io.yaml @@ -3,7 +3,7 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: sets.lib.projectsveltos.io spec: conversion: diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_sveltosclusters.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_sveltosclusters.lib.projectsveltos.io.yaml index 06ff5f6..6cea24a 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_sveltosclusters.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_sveltosclusters.lib.projectsveltos.io.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4 name: sveltosclusters.lib.projectsveltos.io spec: group: lib.projectsveltos.io @@ -80,6 +80,11 @@ spec: type: string description: ArbitraryData allows for arbitrary nested structures type: object + kubeconfigKeyName: + description: |- + KubeconfigKeyName specifies the key within the Secret that holds the kubeconfig. + If not specified, Sveltos will use first key in the Secret. + type: string kubeconfigName: description: |- KubeconfigName allows overriding the default Sveltos convention which expected a valid kubeconfig @@ -230,6 +235,11 @@ spec: type: string description: ArbitraryData allows for arbitrary nested structures type: object + kubeconfigKeyName: + description: |- + KubeconfigKeyName specifies the key within the Secret that holds the kubeconfig. + If not specified, Sveltos will use first key in the Secret. + type: string kubeconfigName: description: |- KubeconfigName allows overriding the default Sveltos convention which expected a valid kubeconfig