Skip to content

Commit

Permalink
Fixed some small API issue
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
  • Loading branch information
belgaied2 committed Nov 26, 2024
1 parent 457e3f1 commit 736693c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/harvestercluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -209,7 +209,7 @@ spec:
required:
- cloudConfigCredentialsSecretKey
- cloudConfigCredentialsSecretName
- manifestConfigMapKey
- manifestsConfigMapKey
- manifestsConfigMapName
- manifestsConfigMapNamespace
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -232,7 +232,7 @@ spec:
required:
- cloudConfigCredentialsSecretKey
- cloudConfigCredentialsSecretName
- manifestConfigMapKey
- manifestsConfigMapKey
- manifestsConfigMapName
- manifestsConfigMapNamespace
type: object
Expand Down
6 changes: 3 additions & 3 deletions controllers/harvestercluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion controllers/harvestercluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down

0 comments on commit 736693c

Please sign in to comment.