Skip to content

Commit

Permalink
Merge branch 'master' into feature/fix-LBM1-19398
Browse files Browse the repository at this point in the history
  • Loading branch information
rahman-lb authored Sep 6, 2024
2 parents c96666e + e5bfdc8 commit d49eb27
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 36 deletions.
8 changes: 8 additions & 0 deletions deploy/helm/lb-csi/templates/lb-csi-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,11 @@ spec:
#imagePullSecrets:
#- name: my-docker-registry-credentials-secret
{{- end }}

{{- if .Values.lbControllerTolerations }}
tolerations:
- key: {{ .Values.lbControllerTolerations.key}}
operator: {{ .Values.lbControllerTolerations.operator}}
value: {{ .Values.lbControllerTolerations.value}}
effect: {{ .Values.lbControllerTolerations.effect}}
{{- end }}
8 changes: 8 additions & 0 deletions deploy/helm/lb-csi/templates/lb-csi-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,11 @@ spec:
#imagePullSecrets:
#- name: my-docker-registry-credentials-secret
{{- end }}

{{- if .Values.lbNodeTolerations }}
tolerations:
- key: {{ .Values.lbNodeTolerations.key}}
operator: {{ .Values.lbNodeTolerations.operator}}
value: {{ .Values.lbNodeTolerations.value}}
effect: {{ .Values.lbNodeTolerations.effect}}
{{- end }}
16 changes: 16 additions & 0 deletions deploy/helm/lb-csi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,19 @@ rwx: false
# - name: cluster-admin-jwt
# jwt: |-
# ZXlKaGJHY2lPaUpTVXpJMU5pSXNJbXRwWkNJNkluTjVjM1JsYlRweWIyOTBJaXdpZEhsd0lqb2lTbGRVSW4wLmV5SmhkV1FpT2lKTWFXZG9kRTlUSWl3aVpYaHdJam94TmpRNU9UUXpNelkyTENKcFlYUWlPakUyTVRnME1EY3pOallzSW1semN5STZJbk41YzNSbGMzUnpJaXdpYW5ScElqb2lRMUJzTXpCdVNtVlFXV3hCU1dsRGJtMWpYMlJ2UVNJc0ltNWlaaUk2TVRZeE9EUXdOek0yTml3aWNtOXNaWE1pT2xzaWMzbHpkR1Z0T21Oc2RYTjBaWEl0WVdSdGFXNGlYU3dpYzNWaUlqb2liR2xuYUhSdmN5MWpiR2xsYm5RaWZRLm5PY2pTaTJlMUZ1RFhEMHRsYXFackZnQ2I2WFRqc19Lc2phUHRZbHBUMDZCNmQ5bmhfM1hIejNCRTZIUGJydVM3RERIT2xFOWZNUWpSbUl0LWZDZjJMQ0Jja1J6bm1fQnVGLU9wWGRQc2hDY1plX3VCeUFaTXNkMDJsR05fWHR2Sy03SXh3ZTZsSkd1S215dFdwWUhvcTczUVVfYUhITjItMHJJUFlWSEpfQmN4NDcxblQyRmQzbG5PSFNtNWVZWUhQTzJrcGdUSy0yMkVIX21FUWYxbldjQms3UU15T3RWbVloUmNwN0F3REhDLTllQkNnM0w2VDFFdlV1YWRMTXZpbXNGV2VWeXZya1ZVVzhrWjhZeDJTNlMzMG5FeFN2NHJ3aHVUX3Q4VnNyRFhnUWdWd0ZacGhiZ0dTZTBDQlR1dUNiMkt5TlRvVmxnQjBoQ05mUjBaZw==

# CSI controller pod tolerations will enable controller-pod deployment to the desired node.
# Replace values with desired key-value pairs of tainted nodes.
lbControllerTolerations:
key: "lb-csi-controller"
operator: "Equal"
value: "lb-csi-controller-pod"
effect: "NoSchedule"

# CSI node pod tolerations will enable node-pod deployment to the desired node.
# Replace values with desired key-value pairs of tainted nodes.
lbNodeTolerations:
key: "lb-csi-controller"
operator: "Equal"
value: "lb-csi-controller-pod"
effect: "NoSchedule"
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
golang.org/x/sys v0.20.0
golang.org/x/sys v0.23.0
google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae
google.golang.org/genproto/googleapis/rpc v0.0.0-20240506185236-b8a5c65736ae
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.34.1
gopkg.in/yaml.v2 v2.4.0
k8s.io/mount-utils v0.30.0
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
k8s.io/mount-utils v0.30.3
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/mountinfo v0.7.2 // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.33.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/text v0.16.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
Expand Down
33 changes: 16 additions & 17 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyT
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
Expand Down Expand Up @@ -76,8 +76,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kubernetes-csi/csi-test/v3 v3.1.1 h1:mFxPbUf7pti663WTCsfaT3YRPVIzy0yLx8HWbVKfN4I=
github.com/kubernetes-csi/csi-test/v3 v3.1.1/go.mod h1:UWxYP5cDlD6iSNVKEiLFqfJnJinuhtI7MLt61rQQOfI=
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
Expand Down Expand Up @@ -147,8 +147,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -170,16 +170,15 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
Expand All @@ -191,8 +190,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY=
golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down Expand Up @@ -248,7 +247,7 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/mount-utils v0.30.0 h1:EceYTNYVabfpdtIAHC4KgMzoZkm1B8ovZ1J666mYZQI=
k8s.io/mount-utils v0.30.0/go.mod h1:9sCVmwGLcV1MPvbZ+rToMDnl1QcGozy+jBPd0MsQLIo=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/mount-utils v0.30.3 h1:8Z3wSW5+GSvGNtlDhtoZrBCKLMIf5z/9tf8pie+G06s=
k8s.io/mount-utils v0.30.3/go.mod h1:9sCVmwGLcV1MPvbZ+rToMDnl1QcGozy+jBPd0MsQLIo=
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
23 changes: 11 additions & 12 deletions pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,14 @@ func (d *Driver) NodeStageVolume(
// path, or some such). and i THINK i can see `kubelet` creating it
// before calling the plugins...
tgtPath := req.StagingTargetPath
notMnt, err := mountutils.IsNotMountPoint(d.mounter, tgtPath)
isMnt, err := d.mounter.IsMountPoint(tgtPath)
if os.IsNotExist(err) {
return nil, mkEinvalf("staging_target_path",
"'%s' doesn't exist", tgtPath)
} else if err != nil {
return nil, mkEExec("can't examine staging path: %s", err)
}
// don't you not like double negatives?
if !notMnt {
if isMnt {
dev, _, err := mountutils.GetDeviceNameFromMount(d.mounter, tgtPath)
if err != nil {
log.Debugf("failed to find what's mounted at '%s': %s", tgtPath, err)
Expand Down Expand Up @@ -432,17 +431,17 @@ func (d *Driver) NodeUnstageVolume(
// retrying the call...

ioErr := false
notMnt, err := mountutils.IsNotMountPoint(d.mounter, tgtPath)
isMnt, err := d.mounter.IsMountPoint(tgtPath)
if err != nil && !os.IsNotExist(err) {
if strings.Contains(err.Error(), "input/output error") {
d.log.Warnf("check mount '%s' failed with IO error (notMnt: %t) - try to umount anyway: %s",
tgtPath, notMnt, err)
d.log.Warnf("check mount '%s' failed with IO error (isMnt: %t) - try to umount anyway: %s",
tgtPath, isMnt, err)
ioErr = true
} else {
return nil, mkEExec("can't examine staging path: %s", err)
}
}
if !notMnt || ioErr {
if isMnt || ioErr {
err = d.mounter.Unmount(tgtPath)
if err != nil {
return nil, mkEExec("failed to unmount '%s': %s", tgtPath, err)
Expand Down Expand Up @@ -628,11 +627,11 @@ func (d *Driver) NodePublishVolume(

// for idempotency - start in reverse order:
if _, err := os.Stat(req.TargetPath); err == nil {
notMnt, err := mountutils.IsNotMountPoint(d.mounter, req.TargetPath)
isMnt, err := d.mounter.IsMountPoint(req.TargetPath)
if err != nil {
return nil, mkEExec("can't examine target path: %s", err)
}
if !notMnt {
if isMnt {
dev, err := getDeviceNameFromMount(ctx, req.TargetPath)
if err != nil {
log.Debugf("failed to find what's mounted at '%s': %s",
Expand Down Expand Up @@ -681,17 +680,17 @@ func (d *Driver) NodeUnpublishVolume(

ioErr := false
tgtPath := req.TargetPath
notMnt, err := mountutils.IsNotMountPoint(d.mounter, tgtPath)
isMnt, err := d.mounter.IsMountPoint(tgtPath)
if err != nil && !os.IsNotExist(err) {
if strings.Contains(err.Error(), "input/output error") {
d.log.Warnf("check mount '%s' failed with IO error (notMnt: %t) - try to umount anyway: %s",
tgtPath, notMnt, err)
tgtPath, isMnt, err)
ioErr = true
} else {
return nil, mkEExec("can't examine mount path: %s", err)
}
}
if !notMnt || ioErr {
if isMnt || ioErr {
err = d.mounter.Unmount(tgtPath)
if err != nil {
return nil, mkEExec("failed to unmount '%s': %s", tgtPath, err)
Expand Down

0 comments on commit d49eb27

Please sign in to comment.