deploy: added json field tags for csi config map

This commit adds the json field tags for csi config map for
encoding and decoding JSON.

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M
2023-12-18 16:34:31 +05:30
committed by mergify[bot]
parent 35f034f156
commit 50e505619c
10 changed files with 74 additions and 124 deletions

View File

@ -21,7 +21,7 @@ import (
"encoding/json"
"fmt"
"github.com/ceph/ceph-csi/internal/util"
cephcsi "github.com/ceph/ceph-csi/api/deploy/kubernetes"
v1 "k8s.io/api/core/v1"
apierrs "k8s.io/apimachinery/pkg/api/errors"
@ -54,19 +54,13 @@ func createConfigMap(pluginPath string, c kubernetes.Interface, f *framework.Fra
if err != nil {
return err
}
conmap := []util.ClusterInfo{{
conmap := []cephcsi.ClusterInfo{{
ClusterID: fsID,
Monitors: mons,
RBD: struct {
NetNamespaceFilePath string `json:"netNamespaceFilePath"`
RadosNamespace string `json:"radosNamespace"`
}{
RBD: cephcsi.RBD{
RadosNamespace: radosNamespace,
},
ReadAffinity: struct {
Enabled bool `json:"enabled"`
CrushLocationLabels []string `json:"crushLocationLabels"`
}{
ReadAffinity: cephcsi.ReadAffinity{
Enabled: true,
CrushLocationLabels: []string{
crushLocationRegionLabel,
@ -123,7 +117,7 @@ func createCustomConfigMap(
for key := range clusterInfo {
clusterID = append(clusterID, key)
}
conmap := make([]util.ClusterInfo, len(clusterID))
conmap := make([]cephcsi.ClusterInfo, len(clusterID))
for i, j := range clusterID {
conmap[i].ClusterID = j