Skip to content

Commit

Permalink
Makefile: migrate lint-markdownlint to upstream provided image and ma…
Browse files Browse the repository at this point in the history
…rkdownlint-cli2
  • Loading branch information
chrischdi committed Aug 16, 2023
1 parent 683ae4d commit 628789b
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 80 deletions.
7 changes: 7 additions & 0 deletions .github/.markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config:
# First line in a file should be a top-level heading
MD041: false
# Multiple consecutive blank lines
MD012: false
# Trailing spaces
MD009: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ about: Tell us about a problem you are experiencing

- Cluster-api-provider-vsphere version:
- Kubernetes version: (use `kubectl version`):
- OS (e.g. from `/etc/os-release`):
- OS (e.g. from `/etc/os-release`):
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ about: Suggest an idea for this project

- Cluster-api-provider-vsphere version:
- Kubernetes version: (use `kubectl version`):
- OS (e.g. from `/etc/os-release`):
- OS (e.g. from `/etc/os-release`):
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/release_tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@ Please see the corresponding sections in [release-tasks.md](https://github.com/k
## Tasks

Early in the cycle:

* [ ] [Prepare main branch for development of the new release](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/docs/release/release-tasks.md#prepare-main-branch-for-development-of-the-new-release)
* [ ] [Remove previously deprecated code](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/docs/release/release-tasks.md#remove-previously-deprecated-code)

If and when necessary:

* [ ] [Bump the Kubernetes version](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/docs/release/release-tasks.md#optional-bump-the-kubernetes-version)

Late in the cycle:

* [ ] [Bump dependencies](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/docs/release/release-tasks.md#bump-dependencies)
* [ ] [Create the new release branch](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/docs/release/release-tasks.md#create-a-release-branch)
* [ ] [opt] [Cut beta/rc releases](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/docs/release/release-tasks.md#cut-a-release)
* [ ] [Cut the minor release](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/docs/release/release-tasks.md#cut-a-release)

Continuously:

* [Reduce the amount of flaky tests](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/docs/release/release-tasks.md#continuously-reduce-the-amount-of-flaky-tests)
6 changes: 6 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config:
default: true
line_length: false
ignores:
- _releasenotes
# - .github
4 changes: 0 additions & 4 deletions .markdownlintrc

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The steps to add someone as a maintainer are:
* Open PR to add Github username to **cluster-api-provider-vsphere-maintainers**
to [kubernetes/org/config/kubernetes-sigs/sig-cluster-lifecycle/teams.yaml](https://github.com/kubernetes/org/blob/main/config/kubernetes-sigs/sig-cluster-lifecycle/teams.yaml)
* Open PR to add Github username to [kubernetes/test-infra/config/jobs/kubernetes-sigs/cluster-api-provider-vsphere/OWNERS](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-sigs/cluster-api-provider-vsphere/OWNERS)
* Open PR to add Google ID to the [email protected] and [email protected] Google groups in [kubernetes/k8s.io/groups/sig-cluster-lifecycle/groups.yaml](https://github.com/kubernetes/k8s.io/blob/main/groups/sig-cluster-lifecycle/groups.yaml)
* Open PR to add Google ID to the <[email protected]> and <[email protected]> Google groups in [kubernetes/k8s.io/groups/sig-cluster-lifecycle/groups.yaml](https://github.com/kubernetes/k8s.io/blob/main/groups/sig-cluster-lifecycle/groups.yaml)
* Open PR to add approvers/reviewers to [CAPV image promotion](https://github.com/kubernetes/k8s.io/blob/main/registry.k8s.io/images/k8s-staging-capi-vsphere/OWNERS).
* Open PR to image-builder to modify `cluster-api-vsphere-maintainers` in [OWNERS_ALIASES](https://github.com/kubernetes-sigs/image-builder/blob/main/OWNERS_ALIASES)

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ RELEASE_NOTES_BIN := release-notes
RELEASE_NOTES := $(abspath $(TOOLS_BIN_DIR)/$(RELEASE_NOTES_BIN)-$(RELEASE_NOTES_VER))
RELEASE_NOTES_PKG := sigs.k8s.io/cluster-api/hack/tools/release

# Defines the version used for lint-markdown. Make sure to run ./hack/markdownlint-sync-image.sh after updating the image.
MARKDOWNLINT_CLI2_VERSION ?= "v0.8.1"
MARKDOWNLINT_CLI2_IMAGE_NAME ?= "gcr.io/cluster-api-provider-vsphere/extra/markdownlint-cli2"

# Define Docker related variables. Releases should modify and double check these vars.
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
PROD_REGISTRY ?= registry.k8s.io/cluster-api-vsphere
Expand Down Expand Up @@ -334,7 +338,7 @@ lint-go-full: lint-go ## Run slower linters to detect possible issues

.PHONY: lint-markdown
lint-markdown: ## Lint the project's markdown
docker run --rm -v "$$(pwd)":/build$(DOCKER_VOL_OPTS) gcr.io/cluster-api-provider-vsphere/extra/mdlint:0.17.0 -- /md/lint -i _releasenotes .
docker run --rm -v "$$(pwd)":/workdir$(DOCKER_VOL_OPTS) --entrypoint="markdownlint-cli2-config" $(MARKDOWNLINT_CLI2_IMAGE_NAME):$(MARKDOWNLINT_CLI2_VERSION) ".markdownlint-cli2.yaml" "**/*.md"

.PHONY: lint-fix
lint-fix: $(GOLANGCI_LINT) ## Lint the codebase and run auto-fixers if supported by the linter
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Check out the [getting started guide](./docs/getting_started.md) for launching a

- Native Kubernetes manifests and API
- Manages the bootstrapping of VMs on cluster.
- Choice of Linux distribution between Ubuntu 18.04 and CentOS 7 using VM Templates based on [OVA images](#Kubernetes-versions-with-published-OVAs).
- Choice of Linux distribution between Ubuntu 18.04 and CentOS 7 using VM Templates based on [OVA images](#kubernetes-versions-with-published-ovas).
- Deploys Kubernetes control planes into provided clusters on vSphere.
- Doesn't use SSH for bootstrapping nodes.
- Installs only the minimal components to bootstrap a control plane and workers.
Expand Down Expand Up @@ -128,7 +128,7 @@ We also use the issue tracker to track features. If you have an idea for a featu
[good_first_issue]: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
[kops]: https://github.com/kubernetes/kops
[kubicorn]: http://kubicorn.io/
[mailint_list]: https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle
[mailing_list]: https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle
[meeting_notes]: https://docs.google.com/document/d/1jQrQiOW75uWraPk4b_LWtCTHwT7EZwrWWwMdxeWOEvk/edit?usp=sharing
[new_issue]: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/issues/new
[prow]: https://go.k8s.io/bot-commands
Expand Down
2 changes: 0 additions & 2 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ $ clusterctl generate custom-cluster vsphere-quickstart \
<!-- References -->
[vm-template]: https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.vm_admin.doc/GUID-17BEDA21-43F6-41F4-8FB2-E01D275FE9B4.html
[cluster-api-book]: https://cluster-api.sigs.k8s.io/
[glossary-bootstrapping]: https://cluster-api.sigs.k8s.io/reference/glossary.html#bootstrap
[kind]: https://kind.sigs.k8s.io
[glossary-management-cluster]: https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/book/GLOSSARY.md#management-cluster
[releases]: https://github.com/kubernetes-sigs/cluster-api/releases
[docker]: https://docs.docker.com/glossary/?term=install
[kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
Expand Down
4 changes: 2 additions & 2 deletions docs/gpu-pci.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Let's create a CAPV cluster with GPU enabled via PCI passthrough mode and run a
- Browse to a host in the vSphere Client navigator.
- On the **Configure** tab, expand **Hardware** and click **PCI Devices**.
- Select the GPU device to be used for passthrough and click **TOGGLE PASSTHROUGH**. This sets the device to be available in the passthrough mode.
<img width="1673" alt="image" src="https://user-images.githubusercontent.com/8758225/178333983-0dcc9771-ba41-4c90-918f-388795d77846.png">
![image](https://user-images.githubusercontent.com/8758225/178333983-0dcc9771-ba41-4c90-918f-388795d77846.png)

- Find the Device ID and Vendor ID of the PCI device.
- Browse to a host in the vSphere Client navigator.
- On the **Configure** tab, expand **Hardware** and click **PCI Devices**.
- Click on the **PASSTHROUGH-ENABLED DEVICES** tab and select the device you want to use.
- As shown below, the **General Information** section lists out the Device ID and Vendor ID information.
<img width="1675" alt="image" src="https://user-images.githubusercontent.com/8758225/178334149-def48b35-1142-4c05-b455-fefd15b1e41a.png">
![image](https://user-images.githubusercontent.com/8758225/178334149-def48b35-1142-4c05-b455-fefd15b1e41a.png)

**Note**: The device and vendor ID combination is the same for a single family of GPU cards. So, for all the Tesla T4 cards, the values would be the ones listed above.

Expand Down
11 changes: 9 additions & 2 deletions docs/proposal/20211006-supervisor-based-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,29 @@ status: implementable

## Table of Contents

- [Title](#title)
- [supervisor-based APIs for CAPV](#supervisor-based-apis-for-capv)
- [Table of Contents](#table-of-contents)
- [Glossary](#glossary)
- [Summary](#summary)
- [Motivation](#motivation)
- [Goals](#goals)
- [Non-Goals/Future Work](#non-goalsfuture-work)
- [Proposal](#proposal)
- [Release engineering](#release-engineering)
- [User Stories](#user-stories)
- [Story 1](#story-1)
- [Story 2](#story-2)
- [Story 3](#story-3)
- [Story 3](#story-3)
- [Implementation Details/Notes/Constraints](#implementation-detailsnotesconstraints)
- [Controller changes](#controller-changes)
- [Newly added Controllers](#newly-added-controllers)
- [ServiceDiscovery controller](#servicediscovery-controller)
- [CI and test coverage](#ci-and-test-coverage)
- [Security Model](#security-model)
- [Risks and Mitigations](#risks-and-mitigations)
- [Alternatives](#alternatives)
- [Use a separate branch to host the new APIs and controllers](#use-a-separate-branch-to-host-the-new-apis-and-controllers)
- [Add new fields to current API and heavily rely on webhook for field compatibility](#add-new-fields-to-current-api-and-heavily-rely-on-webhook-for-field-compatibility)
- [Upgrade Strategy](#upgrade-strategy)
- [Implementation History](#implementation-history)

Expand Down
2 changes: 1 addition & 1 deletion docs/proposal/20220907-node-affinity-and-anti-affinity.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ status: proposed

## Table of Contents

* [Support for Node affinity and anti-affinity](#support-for-node-affinity-and-anti-affinity)
* [Support for Node anti-affinity](#support-for-node-anti-affinity)
* [Table of Contents](#table-of-contents)
* [Glossary](#glossary)
* [Summary](#summary)
Expand Down
30 changes: 30 additions & 0 deletions hack/markdownlint-sync-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Copyright 2023 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

MAKEFILE_PATH="$(dirname "${0}")/../Makefile"

MARKDOWNLINT_CLI2_VERSION="$(grep '^MARKDOWNLINT_CLI2_VERSION ' < "${MAKEFILE_PATH}" | awk '{print $NF}' | tr -d '"')"
TARGET_IMAGE_NAME="$(grep '^MARKDOWNLINT_CLI2_IMAGE_NAME ' < "${MAKEFILE_PATH}" | awk '{print $NF}' | tr -d '"')"

ORIGINAL_IMAGE="davidanson/markdownlint-cli2:${MARKDOWNLINT_CLI2_VERSION}"
TARGET_IMAGE="${TARGET_IMAGE_NAME}:${MARKDOWNLINT_CLI2_VERSION}"

echo docker pull "${ORIGINAL_IMAGE}"
echo docker tag "${ORIGINAL_IMAGE}" "${TARGET_IMAGE}"
echo docker push "${TARGET_IMAGE}"
34 changes: 0 additions & 34 deletions hack/tools/mdlint/Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions hack/tools/mdlint/Makefile

This file was deleted.

0 comments on commit 628789b

Please sign in to comment.