Skip to content

Commit 2740520

Browse files
csi: add controller publish secret to csi-config-map CM
Signed-off-by: Praveen M <m.praveen@ibm.com>
1 parent 22da1f6 commit 2740520

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

internal/controller/clientprofile_controller.go

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,22 @@ type csiClusterInfoRecord struct {
6767
ClusterId string `json:"clusterID,omitempty"`
6868
Monitors []string `json:"monitors,omitempty"`
6969
CephFs struct {
70-
SubvolumeGroup string `json:"subvolumeGroup,omitempty"`
71-
KernelMountOptions string `json:"kernelMountOptions"`
72-
FuseMountOptions string `json:"fuseMountOptions"`
73-
RadosNamespace string `json:"radosNamespace,omitempty"`
70+
SubvolumeGroup string `json:"subvolumeGroup,omitempty"`
71+
KernelMountOptions string `json:"kernelMountOptions"`
72+
FuseMountOptions string `json:"fuseMountOptions"`
73+
RadosNamespace string `json:"radosNamespace,omitempty"`
74+
ControllerPublishSecretRef struct {
75+
Name string `json:"name,omitempty"`
76+
Namespace string `json:"namespace,omitempty"`
77+
} `json:"controllerPublishSecretRef,omitempty"`
7478
} `json:"cephFS,omitempty"`
7579
Rbd struct {
76-
RadosNamespace string `json:"radosNamespace,omitempty"`
77-
MirrorCount int `json:"mirrorCount,omitempty"`
80+
RadosNamespace string `json:"radosNamespace,omitempty"`
81+
MirrorCount int `json:"mirrorCount,omitempty"`
82+
ControllerPublishSecretRef struct {
83+
Name string `json:"name,omitempty"`
84+
Namespace string `json:"namespace,omitempty"`
85+
} `json:"controllerPublishSecretRef,omitempty"`
7886
} `json:"rbd,omitempty"`
7987
Nfs struct{} `json:"nfs,omitempty"`
8088
ReadAffinity struct {
@@ -322,10 +330,18 @@ func composeCsiClusterInfoRecord(clientProfile *csiv1.ClientProfile, cephConn *c
322330
if mountOpt := cephFs.FuseMountOptions; mountOpt != nil {
323331
record.CephFs.FuseMountOptions = utils.MapToString(mountOpt, "=", ",")
324332
}
333+
if cephCsiSecrets := cephFs.CephCsiSecrets; cephCsiSecrets != nil {
334+
record.CephFs.ControllerPublishSecretRef.Name = cephCsiSecrets.ControllerPublishSecret.Name
335+
record.CephFs.ControllerPublishSecretRef.Namespace = cephCsiSecrets.ControllerPublishSecret.Namespace
336+
}
325337
}
326338
if rbd := clientProfile.Spec.Rbd; rbd != nil {
327339
record.Rbd.RadosNamespace = rbd.RadosNamespace
328340
record.Rbd.MirrorCount = cephConn.Spec.RbdMirrorDaemonCount
341+
if cephCsiSecrets := rbd.CephCsiSecrets; cephCsiSecrets != nil {
342+
record.Rbd.ControllerPublishSecretRef.Name = cephCsiSecrets.ControllerPublishSecret.Name
343+
record.Rbd.ControllerPublishSecretRef.Namespace = cephCsiSecrets.ControllerPublishSecret.Namespace
344+
}
329345
}
330346
if readAffinity := cephConn.Spec.ReadAffinity; readAffinity != nil {
331347
record.ReadAffinity.Enabled = true

0 commit comments

Comments
 (0)