Skip to content

Commit

Permalink
Merge pull request ceph#93 from Madhu-1/fix-csiaddons
Browse files Browse the repository at this point in the history
fix: address csi addons problems in csi
  • Loading branch information
nb-ohad authored Aug 6, 2024
2 parents 0b13d9e + 4dc3da8 commit 6d04e9e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
14 changes: 9 additions & 5 deletions internal/controller/driver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,16 +612,20 @@ func (r *driverReconcile) reconcileControllerPluginDeployment() error {
Name: "csi-addons",
Image: r.images["addons"],
ImagePullPolicy: imagePullPolicy,
Args: append(
slices.Clone(leaderElectionArgs),
Args: []string{
// csiaddons does not require utils.LeaderElectionContainerArg as its enabled by default and no option to disable it
utils.LeaderElectionNamespaceContainerArg(r.driver.Namespace),
utils.LeaderElectionLeaseDurationContainerArg(leaderElectionSpec.LeaseDuration),
utils.LeaderElectionRenewDeadlineContainerArg(leaderElectionSpec.RenewDeadline),
utils.LeaderElectionRetryPeriodContainerArg(leaderElectionSpec.RetryPeriod),
utils.LogVerbosityContainerArg(logVerbosity),
utils.NodeIdContainerArg,
utils.CsiAddonsNodeIdContainerArg,
utils.PodContainerArg,
utils.PodUidContainerArg,
utils.CsiAddonsAddressContainerArg,
utils.ControllerPortContainerArg,
utils.NamespaceContainerArg,
),
},
Ports: []corev1.ContainerPort{
utils.CsiAddonsContainerPort,
},
Expand Down Expand Up @@ -891,7 +895,7 @@ func (r *driverReconcile) reconcileNodePluginDeamonSet() error {
},
},
Args: []string{
utils.NodeIdContainerArg,
utils.CsiAddonsNodeIdContainerArg,
utils.LogVerbosityContainerArg(logVerbosity),
utils.CsiAddonsAddressContainerArg,
utils.ControllerPortContainerArg,
Expand Down
9 changes: 5 additions & 4 deletions internal/utils/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
const (
SocketDir = "/csi"
csiEndpoint = "unix://" + SocketDir + "/csi.sock"
csiAddonsEndpoint = "unix://" + SocketDir + "/csi-addons.sock.sock"
csiAddonsEndpoint = "unix://" + SocketDir + "/csi-addons.sock"

kmsConfigVolumeName = "ceph-csi-kms-config"
registrationVolumeName = "registration-dir"
Expand Down Expand Up @@ -309,8 +309,9 @@ var CsiAddonsContainerPort = corev1.ContainerPort{
// Ceph CSI common container arguments
var CsiAddressContainerArg = fmt.Sprintf("--csi-address=%s", csiEndpoint)
var EndpointContainerArg = fmt.Sprintf("--endpoint=%s", csiEndpoint)
var CsiAddonsEndpointContainerArg = fmt.Sprintf("--csi-addons-endpoint=(%s)", csiAddonsEndpoint)
var CsiAddonsAddressContainerArg = fmt.Sprintf("--csi-addons-address=(%s)", csiAddonsEndpoint)
var CsiAddonsEndpointContainerArg = fmt.Sprintf("--csi-addons-endpoint=%s", csiAddonsEndpoint)
var CsiAddonsAddressContainerArg = fmt.Sprintf("--csi-addons-address=%s", csiAddonsEndpoint)
var CsiAddonsNodeIdContainerArg = fmt.Sprintf("--node-id=$(%s)", NodeIdEnvVar.Name)
var LeaderElectionContainerArg = "--leader-election=true"
var NodeIdContainerArg = fmt.Sprintf("--nodeid=$(%s)", NodeIdEnvVar.Name)
var PidlimitContainerArg = "--pidlimit=-1"
Expand All @@ -321,7 +322,7 @@ var DefaultFsTypeContainerArg = "--default-fstype=ext4"
var HandleVolumeInuseErrorContainerArg = "--handle-volume-inuse-error=false"
var PodUidContainerArg = fmt.Sprintf("--pod-uid=$(%s)", PodUidEnvVar.Name)
var PodContainerArg = fmt.Sprintf("--pod=$(%s)", PodNameEnvVar.Name)
var NamespaceContainerArg = fmt.Sprintf("--namespace=(%s)", PodNamespaceEnvVar.Name)
var NamespaceContainerArg = fmt.Sprintf("--namespace=$(%s)", PodNamespaceEnvVar.Name)
var ControllerPortContainerArg = fmt.Sprintf("--controller-port=%d", CsiAddonsContainerPort.ContainerPort)
var DriverNamespaceContainerArg = fmt.Sprintf("--drivernamespace=$(%s)", DriverNamespaceEnvVar.Name)
var MetricsPathContainerArg = "--metricspath=/metrics"
Expand Down

0 comments on commit 6d04e9e

Please sign in to comment.