Skip to content

Commit

Permalink
chore(bors): merge pull request #585
Browse files Browse the repository at this point in the history
585: Csi Node Stage URI fix r=tiagolobocastro a=tiagolobocastro

    fix(csi/node): add rest client to csi node

    Also adds helm var to configure it (if ever needed).

    Signed-off-by: Tiago Castro <[email protected]>



Co-authored-by: Tiago Castro <[email protected]>
  • Loading branch information
mayastor-bors and tiagolobocastro committed Dec 11, 2024
2 parents b7dd0fb + 9a82872 commit 551771f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ repos:
- id: rust-lint
name: Rust lint
description: Run cargo clippy on files included in the commit.
entry: nix-shell --pure --run 'cargo-clippy --all --all-targets -- -D warnings'
entry: nix-shell --pure --run './scripts/rust/linter.sh clippy'
pass_filenames: false
types: [file, rust]
language: system
- id: rust-style
name: Rust style
description: Run cargo fmt on files included in the commit.
entry: nix-shell --pure --run 'cargo-fmt --all -- --check'
entry: nix-shell --pure --run './scripts/rust/linter.sh fmt'
pass_filenames: false
types: [file, rust]
language: system
Expand Down
3 changes: 1 addition & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ pipeline {
steps {
sh 'printenv'
sh 'nix-shell --run "./dependencies/control-plane/scripts/rust/generate-openapi-bindings.sh"'
sh 'nix-shell --run "cargo fmt --all -- --check"'
sh 'nix-shell --run "cargo clippy --all-targets -- -D warnings"'
sh 'nix-shell --run "./scripts/rust/linter.sh"'
sh 'nix-shell --run "./scripts/git/check-submodule-branches.sh"'
}
}
Expand Down
3 changes: 2 additions & 1 deletion chart/templates/mayastor/csi/csi-node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ spec:
args:
- "--csi-socket={{ default .Values.csi.node.pluginMountPath .Values.csi.node.pluginMounthPath }}/{{ .Values.csi.node.socketPath }}"
- "--node-name=$(MY_NODE_NAME)"
- "--rest-endpoint=http://{{ .Release.Name }}-api-rest:8081"
- "--rest-endpoint=http://{{ .Release.Name }}-api-rest:8081"{{ if .Values.csi.node.restClient.enabled }}
- "--enable-rest"{{ end }}
- "--enable-registration"
- "--grpc-ip=$(MY_POD_IP)"
- "--grpc-port=10199"{{ if .Values.csi.node.nvme.io_timeout }}
Expand Down
2 changes: 2 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ csi:
# Additional arguments when creating filesystems
mkfs_args:
xfs: ""
restClient:
enabled: true
# -- Set tolerations, overrides global
tolerations: []
# -- Set PriorityClass, overrides global
Expand Down
34 changes: 29 additions & 5 deletions scripts/rust/linter.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

cargo fmt --version
cargo fmt --all
set -e

cargo clippy --version
cargo clippy --all --all-targets $1 -- -D warnings
FMT_ERROR=

OP="${1:-}"

case "$OP" in
"" | "fmt" | "clippy")
;;
*)
echo "linter $OP not supported"
exit 2
esac

cargo fmt -- --version
cargo clippy -- --version

if [ -z "$OP" ] || [ "$OP" = "fmt" ]; then
cargo fmt --all --check || FMT_ERROR=$?
if [ -n "$FMT_ERROR" ]; then
cargo fmt --all
fi
fi

if [ -z "$OP" ] || [ "$OP" = "clippy" ]; then
cargo clippy --all --all-targets -- -D warnings
fi

exit ${FMT_ERROR:-0}

0 comments on commit 551771f

Please sign in to comment.