Skip to content

Commit

Permalink
Merge pull request #1202 from huww98/csi-agent-rm-kubelet-dir-check
Browse files Browse the repository at this point in the history
csi-agent: disable sub-directory check in NodeServerWithValidator
  • Loading branch information
k8s-ci-robot authored Nov 5, 2024
2 parents 91a83bc + 99e367d commit 6b2a0e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/csi-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/kubernetes-sigs/alibaba-cloud-csi-driver/pkg/common"
"github.com/kubernetes-sigs/alibaba-cloud-csi-driver/pkg/disk"
"github.com/kubernetes-sigs/alibaba-cloud-csi-driver/pkg/oss"
"github.com/kubernetes-sigs/alibaba-cloud-csi-driver/pkg/utils"
"github.com/kubernetes-sigs/alibaba-cloud-csi-driver/pkg/version"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
Expand Down Expand Up @@ -74,6 +75,13 @@ func (s *FileGrpcServer) ServeOneRequest(method string) error {
}

func main() {
_, ok := os.LookupEnv("KUBELET_ROOT_DIR")
if !ok {
// This is nessesary to disable the check of sub-directory in NodeServerWithValidator.
// CSI-agent is not invoked by kubelet, so there is no usual kubelet directory structure.
utils.KubeletRootDir = "/"
}

logrus.SetOutput(os.Stderr)
flag.StringVar(&mountProxySocket, "mount-proxy-sock", "/run/kube-agent/csi-agent.sock", "socket path of mount proxy server")
flag.Parse()
Expand Down

0 comments on commit 6b2a0e6

Please sign in to comment.