Skip to content

Commit

Permalink
fix: unmount existing rclone mounts at startup
Browse files Browse the repository at this point in the history
Doing the unmounting in a helm preStart hook was causing issues.
  • Loading branch information
olevski committed Nov 11, 2024
1 parent 862a8d5 commit b9cb81b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 362 deletions.
8 changes: 0 additions & 8 deletions deploy/csi-rclone/templates/csi-nodeplugin-rclone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ spec:
value: {{ .Values.logLevel | default "NOTICE" | quote }}
image: {{ .Values.csiNodepluginRclone.rclone.image.repository }}:{{ .Values.csiNodepluginRclone.rclone.image.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.csiNodepluginRclone.rclone.imagePullPolicy }}
# TODO: check if necessary
lifecycle:
postStart:
exec:
command:
- /bin/sh
- -c
- mount -t fuse.rclone | while read -r mount; do umount $(echo $mount | awk {print $3}) ; done
resources:
{{- toYaml .Values.csiControllerRclone.rclone.resources | nindent 12 }}
securityContext: {{- toYaml .Values.csiNodepluginRclone.rclone.containerSecurityContext
Expand Down
4 changes: 2 additions & 2 deletions devenv/nix/goModule.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ pkgs}:
{ pkgs }:

let
csiDriver = pkgs.buildGoModule {
pname = "csi-rclone-pvc-1";
version = "0.2.0";
src = ../../.;
vendorHash = "sha256-q1tfnO5B6U9c+Ve+kpOfnWGvbdShgkPXvR7axsA7O5Y=";
vendorHash = "sha256-kSSPjuiBYAlpFFdFwA0/v1nuSftyfIaV8R/x1yAc1ac=";
# CGO = 0;
# preBuild = ''
# whoami
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@ go 1.18

require (
github.com/container-storage-interface/spec v1.9.0
github.com/fernet/fernet-go v0.0.0-20240119011108-303da6aec611
github.com/google/uuid v1.4.0
github.com/kubernetes-csi/csi-test/v5 v5.2.0
github.com/kubernetes-csi/drivers v1.0.2
github.com/onsi/ginkgo/v2 v2.13.1
github.com/onsi/gomega v1.30.0
github.com/spf13/cobra v1.1.1
golang.org/x/net v0.17.0
google.golang.org/grpc v1.58.1
gopkg.in/ini.v1 v1.67.0
k8s.io/api v0.20.4
k8s.io/apimachinery v0.20.4
k8s.io/client-go v0.20.4
k8s.io/klog v1.0.0
k8s.io/kubernetes v1.20.4
k8s.io/mount-utils v0.0.0
k8s.io/utils v0.0.0-20231127182322-b307cd553661
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fernet/fernet-go v0.0.0-20240119011108-303da6aec611 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.1 // indirect
Expand All @@ -28,16 +32,13 @@ require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/googleapis/gnostic v0.4.1 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/kubernetes-csi/csi-lib-utils v0.3.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/onsi/ginkgo/v2 v2.13.1 // indirect
github.com/onsi/gomega v1.30.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.4 // indirect
golang.org/x/crypto v0.14.0 // indirect
Expand All @@ -51,7 +52,6 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
Expand Down
Loading

0 comments on commit b9cb81b

Please sign in to comment.