diff --git a/api/v1alpha1/harvestercluster_types.go b/api/v1alpha1/harvestercluster_types.go index 1dfa81c..4b64d77 100644 --- a/api/v1alpha1/harvestercluster_types.go +++ b/api/v1alpha1/harvestercluster_types.go @@ -175,8 +175,8 @@ type UpdateCloudProviderConfig struct { // ManifestsConfigMapName is the name of the required ConfigMap. ManifestsConfigMapName string `json:"manifestsConfigMapName"` - // ManifestConfigMapKey is the key in the ConfigMap that contains the cloud provider deployment manifests. - ManifestConfigMapKey string `json:"manifestConfigMapKey"` + // ManifestsConfigMapKey is the key in the ConfigMap that contains the cloud provider deployment manifests. + ManifestsConfigMapKey string `json:"manifestsConfigMapKey"` // CloudConfigCredentialsSecretName is the name of the secret containing the cloud provider credentials. CloudConfigCredentialsSecretName string `json:"cloudConfigCredentialsSecretName"` diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_harvesterclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_harvesterclusters.yaml index 0a67c7a..f405bbe 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_harvesterclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_harvesterclusters.yaml @@ -194,8 +194,8 @@ spec: description: CloudConfigCredentialsSecretName is the name of the secret containing the cloud provider credentials. type: string - manifestConfigMapKey: - description: ManifestConfigMapKey is the key in the ConfigMap + manifestsConfigMapKey: + description: ManifestsConfigMapKey is the key in the ConfigMap that contains the cloud provider deployment manifests. type: string manifestsConfigMapName: @@ -209,7 +209,7 @@ spec: required: - cloudConfigCredentialsSecretKey - cloudConfigCredentialsSecretName - - manifestConfigMapKey + - manifestsConfigMapKey - manifestsConfigMapName - manifestsConfigMapNamespace type: object diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_infraclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_infraclustertemplates.yaml index 8d4011a..6251369 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_infraclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_infraclustertemplates.yaml @@ -217,8 +217,8 @@ spec: description: CloudConfigCredentialsSecretName is the name of the secret containing the cloud provider credentials. type: string - manifestConfigMapKey: - description: ManifestConfigMapKey is the key in the ConfigMap + manifestsConfigMapKey: + description: ManifestsConfigMapKey is the key in the ConfigMap that contains the cloud provider deployment manifests. type: string manifestsConfigMapName: @@ -232,7 +232,7 @@ spec: required: - cloudConfigCredentialsSecretKey - cloudConfigCredentialsSecretName - - manifestConfigMapKey + - manifestsConfigMapKey - manifestsConfigMapName - manifestsConfigMapNamespace type: object diff --git a/controllers/harvestercluster_controller.go b/controllers/harvestercluster_controller.go index 4f98bb5..daa88bf 100644 --- a/controllers/harvestercluster_controller.go +++ b/controllers/harvestercluster_controller.go @@ -591,9 +591,9 @@ func (r *HarvesterClusterReconciler) reconcileCloudProviderConfig(scope *Cluster return errors.Wrapf(err, "unable to get the referenced config map %s/%s", updateCloudConfig.ManifestsConfigMapNamespace, updateCloudConfig.ManifestsConfigMapName) } - cloudConfigManifest, err := locutil.GetDataKeyFromConfigMap(referencedConfigMap, updateCloudConfig.ManifestConfigMapKey) + cloudConfigManifest, err := locutil.GetDataKeyFromConfigMap(referencedConfigMap, updateCloudConfig.ManifestsConfigMapKey) if err != nil { - return errors.Wrapf(err, "unable to get the data key %s from the referenced config map %s/%s", updateCloudConfig.ManifestConfigMapKey, updateCloudConfig.ManifestsConfigMapNamespace, updateCloudConfig.ManifestsConfigMapName) + return errors.Wrapf(err, "unable to get the data key %s from the referenced config map %s/%s", updateCloudConfig.ManifestsConfigMapKey, updateCloudConfig.ManifestsConfigMapNamespace, updateCloudConfig.ManifestsConfigMapName) } // Generate the B64 Kubeconfig fpr the cloud provider @@ -619,7 +619,7 @@ func (r *HarvesterClusterReconciler) reconcileCloudProviderConfig(scope *Cluster } // Update the ConfigMap with the modified cloudConfig Manifest - referencedConfigMap.Data[updateCloudConfig.ManifestConfigMapKey] = modifiedManifests + referencedConfigMap.Data[updateCloudConfig.ManifestsConfigMapKey] = modifiedManifests err = r.Client.Update(context.TODO(), referencedConfigMap) if err != nil { diff --git a/controllers/harvestercluster_controller_test.go b/controllers/harvestercluster_controller_test.go index fa2d9d3..55c77d7 100644 --- a/controllers/harvestercluster_controller_test.go +++ b/controllers/harvestercluster_controller_test.go @@ -229,7 +229,7 @@ data: UpdateCloudProviderConfig: infrav1.UpdateCloudProviderConfig{ ManifestsConfigMapNamespace: "test-hv", ManifestsConfigMapName: "harvester-csi-driver-addon", - ManifestConfigMapKey: "harvester-cloud-provider-deploy.yaml", + ManifestsConfigMapKey: "harvester-cloud-provider-deploy.yaml", CloudConfigCredentialsSecretName: "cloud-config", CloudConfigCredentialsSecretKey: "cloud-config", },