Skip to content

Commit

Permalink
Merge pull request #413 from datamattsson/v250f1
Browse files Browse the repository at this point in the history
Entrypoint fixes
  • Loading branch information
dileepds authored Jul 17, 2024
2 parents 41d0506 + 7210b04 commit b11c9fb
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 37 deletions.
61 changes: 31 additions & 30 deletions cmd/csi-driver/conform/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,32 @@ done
disableNodeConformance=${DISABLE_NODE_CONFORMANCE}
disableNodeConfiguration=${DISABLE_NODE_CONFIGURATION}

if [ "$nodeService" = true ] || [ "$nodeInit" = true ]; then
# Copy HPE Log Collector diag script
echo "copying hpe log collector diag script"
cp -f "/opt/hpe-storage/bin/hpe-logcollector.sh" \
/usr/local/bin/hpe-logcollector.sh
chmod +x /usr/local/bin/hpe-logcollector.sh

# symlink to host iscsi/multipath config files
ln -s /host/etc/multipath.conf /etc/multipath.conf
ln -s /host/etc/multipath /etc/multipath
ln -s /host/etc/iscsi /etc/iscsi

# symlink to host os release files for parsing
if [ -f /host/etc/redhat-release ]; then
# remove existing file from ubi
rm /etc/redhat-release
ln -s /host/etc/redhat-release /etc/redhat-release
fi

if [ -f /host/etc/os-release ]; then
# remove existing file from ubi
rm /etc/os-release
ln -s /host/etc/os-release /etc/os-release
fi
fi

if [ "$nodeInit" = true ]; then
# Disable the conformance checks
if [ "$disableNodeConformance" = "true" ]; then
Expand Down Expand Up @@ -44,43 +70,18 @@ if [ "$nodeInit" = true ]; then
systemctl restart hpe-storage-node
fi

# One shot NodeMonitor to ensure node is ready
exec /bin/csi-driver $@
exit $?
fi

if [ "$nodeService" = true ]; then
# Copy HPE Log Collector diag script
echo "copying hpe log collector diag script"
cp -f "/opt/hpe-storage/bin/hpe-logcollector.sh" \
/usr/local/bin/hpe-logcollector.sh
chmod +x /usr/local/bin/hpe-logcollector.sh

# Copy /etc/multipath.conf template if missing on host
if [ ! -f /host/etc/multipath.conf ] &&
[ "$disableNodeConfiguration" != true ]; then
cp /opt/hpe-storage/nimbletune/multipath.conf.upstream /host/etc/multipath.conf
fi

# symlink to host iscsi/multipath config files
ln -s /host/etc/multipath.conf /etc/multipath.conf
ln -s /host/etc/multipath /etc/multipath
ln -s /host/etc/iscsi /etc/iscsi

# symlink to host os release files for parsing
if [ -f /host/etc/redhat-release ]; then
# remove existing file from ubi
rm /etc/redhat-release
ln -s /host/etc/redhat-release /etc/redhat-release
fi

if [ -f /host/etc/os-release ]; then
# remove existing file from ubi
rm /etc/os-release
ln -s /host/etc/os-release /etc/os-release
fi
# One shot NodeMonitor to ensure node is ready
exec /bin/csi-driver $@
exit $?
fi

echo "starting csi plugin..."
echo "Starting CSI plugin..."

# Serve! Serve!!!
exec /bin/csi-driver $@
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/Scalingo/go-etcd-lock v3.0.1+incompatible
github.com/container-storage-interface/spec v1.7.0
github.com/golang/protobuf v1.5.4
github.com/hpe-storage/common-host-libs v0.0.0-20240715144320-82b6622e0433
github.com/hpe-storage/common-host-libs v0.0.0-20240717051902-d204e2e2e8fd
github.com/hpe-storage/k8s-custom-resources v0.0.0-20240118202512-5f62990a7c2d
github.com/kubernetes-csi/csi-lib-utils v0.11.0
github.com/kubernetes-csi/csi-test v2.1.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hpe-storage/common-host-libs v0.0.0-20240715144320-82b6622e0433 h1:qWnM82+e/JZ6tGaKK3dtTCtg4r+SHOWsKXG6B40+pb0=
github.com/hpe-storage/common-host-libs v0.0.0-20240715144320-82b6622e0433/go.mod h1:ihkZYcRtUpjrwM2Rh/eU1iIDijUD8YJe7bSS92sXtJk=
github.com/hpe-storage/common-host-libs v0.0.0-20240717051902-d204e2e2e8fd h1:nUxP2DVIdJJHJJv2r7NBET9asoxhxOtmxSoFTfJHY+s=
github.com/hpe-storage/common-host-libs v0.0.0-20240717051902-d204e2e2e8fd/go.mod h1:ihkZYcRtUpjrwM2Rh/eU1iIDijUD8YJe7bSS92sXtJk=
github.com/hpe-storage/k8s-custom-resources v0.0.0-20240118202512-5f62990a7c2d h1:ui+o/+dBn3pwOBHL3AB14XsYaeogpPJZF0Dk3vJh7zY=
github.com/hpe-storage/k8s-custom-resources v0.0.0-20240118202512-5f62990a7c2d/go.mod h1:+zrGrGKf/jqr38KxLEGRll+UsjeUybdLH0MZCBxPPoI=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ github.com/google/uuid
# github.com/gorilla/mux v1.8.0
## explicit; go 1.12
github.com/gorilla/mux
# github.com/hpe-storage/common-host-libs v0.0.0-20240715144320-82b6622e0433
# github.com/hpe-storage/common-host-libs v0.0.0-20240717051902-d204e2e2e8fd
## explicit; go 1.19
github.com/hpe-storage/common-host-libs/chapi
github.com/hpe-storage/common-host-libs/concurrent
Expand Down

0 comments on commit b11c9fb

Please sign in to comment.