From b15a7414b5ab8651d0c3e370ccdb525f81ad30b5 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 14 Jan 2025 13:19:07 +0100 Subject: [PATCH 1/3] Makefile: add markdownlint and markdownlint-fix targets This is so that markdownlint can conveniently be run locally in developer environments. Signed-off-by: Michael Adam --- Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index af27e721..5143d641 100644 --- a/Makefile +++ b/Makefile @@ -134,6 +134,15 @@ test-e2e: go test ./test/e2e/ -v -ginkgo.v +MARKDOWNLINT_IMAGE = docker.io/davidanson/markdownlint-cli2:v0.17.1 +.PHONY: markdownlint +markdownlint: + @$(CONTAINER_TOOL) run --platform linux/amd64 -v .\:/workdir\:z $(MARKDOWNLINT_IMAGE) markdownlint-cli2 "**.md" "#vendor/**" --config .markdownlint.yaml + +.PHONY: markdownlint-fix +markdownlint-fix: + @$(CONTAINER_TOOL) run --platform linux/amd64 -v .\:/workdir\:z $(MARKDOWNLINT_IMAGE) markdownlint-cli2 "**.md" "#vendor/**" --config .markdownlint.yaml --fix + .PHONY: golangci-lint-fix golangci-lint-fix: $(GOLANGCI_LINT) ## Run the golangci-lint linter and perform fixes @@ -141,9 +150,9 @@ golangci-lint-fix: $(GOLANGCI_LINT) ## Run the golangci-lint linter and perform .PHONY: lint -lint: golangci-lint ## Run various linters +lint: golangci-lint markdownlint ## Run various linters .PHONY: lint-fix -lint-fix: golangci-lint-fix ## run linters and perform fixes +lint-fix: golangci-lint-fix markdownlint-fix## run linters and perform fixes ##@ Build From 42d2f79a23b9bd17018be731d878a6ee1ab4156c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 14 Jan 2025 13:25:27 +0100 Subject: [PATCH 2/3] ci: use the markdownlint make target in the lint workflow Signed-off-by: Michael Adam --- .github/workflows/lint.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index edf3eaa8..cec16eb1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -76,10 +76,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 1 - - uses: DavidAnson/markdownlint-cli2-action@v19 - with: - config: .markdownlint.yaml - globs: 'docs/*.md' + - name: run markdownlint + run: make markdownlint shellcheck: name: Shellcheck From 426f28807786287ccf9627d166764b776341cd67 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 15 Jan 2025 12:17:52 +0100 Subject: [PATCH 3/3] docs: fix markdownlint errors Also fixed a lint error in an issue template Signed-off-by: Michael Adam --- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- docs/design/hostNetwork.md | 2 +- docs/design/logrotate.md | 2 +- docs/design/operator.md | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index ac305787..cd6be6f4 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -8,7 +8,7 @@ about: Suggest an idea for this project What new functionality do you want? -# Who is the end user and what is the use case where this feature will be valuable? +## Who is the end user and what is the use case where this feature will be valuable? ## Who is going to use this feature and under what circumstances? diff --git a/docs/design/hostNetwork.md b/docs/design/hostNetwork.md index e4d1d7ff..2014bd63 100644 --- a/docs/design/hostNetwork.md +++ b/docs/design/hostNetwork.md @@ -1,7 +1,7 @@ # Enabling host networking for controller plugin pods By default, the Ceph-CSI controller plugins operate on the pod network -but under some circumstances, like setups with a dedicated storage network, +but under some circumstances, like setups with a dedicated storage network, where the pod network cannot connect to the ceph cluster, it is necessary to run the Ceph-CSI controller plugin pods on the host network. diff --git a/docs/design/logrotate.md b/docs/design/logrotate.md index b8e9e95c..df808e34 100644 --- a/docs/design/logrotate.md +++ b/docs/design/logrotate.md @@ -2,7 +2,7 @@ Log rotation involves managing log files by controlling their size. This feature will be added to the CephCSI and csi-addons containers in the CephCSI node-plugin and controller-plugin pods. When logrotate is used, it will generate a log file at the host path and run the logrotator sidecar container in CephCSI pods. The logrotator sidecar container will then ensure that log files are rotated based on predefined settings. -Logroate configuration, +Logroate configuration, `OperatorConfig CRD`: diff --git a/docs/design/operator.md b/docs/design/operator.md index 01c1681e..1ce27724 100644 --- a/docs/design/operator.md +++ b/docs/design/operator.md @@ -358,8 +358,8 @@ status: {} The ClientProfileMapping CR contains a mapping between pairs of Ceph CSI client profiles. The information in this CR helps Ceph CSI identify -peered configuration between different k8s cluster. This information is -utilized in the management and consumption of volumes in backup and +peered configuration between different k8s cluster. This information is +utilized in the management and consumption of volumes in backup and DR scenarios ```yaml