Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-Pick PR 585 #586

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-endpoint=$(MY_POD_IP):10199"{{ if .Values.csi.node.nvme.io_timeout }}
- "--nvme-io-timeout={{ .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 @@ -386,6 +386,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}
Loading