-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(dependencies): update toools versions #5252
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
31b5173
chore(dependencies): update toools versions
ivankatliarchuk d38fb89
chore(dependencies): update toools versions
ivankatliarchuk 7cbb4e8
chore(dependencies): update toools versions
ivankatliarchuk 5498279
chore(dependencies): update toools versions
ivankatliarchuk 69b7f72
Merge branch 'master' into renovate-deps
ivankatliarchuk aa7f5ca
chore(dependencies): update toools versions
ivankatliarchuk e9f1a19
chore(dependencies): update toools versions
ivankatliarchuk d7af29c
chore(dependencies): update toools versions
ivankatliarchuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,3 +47,4 @@ jobs: | |
| with: | ||
| path-to-profile: profile.cov | ||
| if: github.actor != 'nektos/act' | ||
| continue-on-error: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,28 +24,26 @@ cover-html: cover | |
| @go tool cover -html=cover.out | ||
|
|
||
| #? controller-gen: download controller-gen if necessary | ||
| controller-gen: | ||
| controller-gen-install: | ||
| @scripts/install-tools.sh --generator | ||
| ifeq (, $(shell which controller-gen)) | ||
| @{ \ | ||
| set -e ;\ | ||
| go install sigs.k8s.io/controller-tools/cmd/[email protected] ;\ | ||
| } | ||
| CONTROLLER_GEN=$(GOBIN)/controller-gen | ||
| else | ||
| CONTROLLER_GEN=$(shell which controller-gen) | ||
| endif | ||
|
|
||
| #? golangci-lint: Install golangci-lint tool | ||
| golangci-lint: | ||
| @command -v golangci-lint > /dev/null || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.0.2 | ||
| #? controller-gen-install: download controller-gen if necessary | ||
| controller-gen-install: | ||
| @scripts/install-tools.sh --generator | ||
|
|
||
| #? golangci-lint-verify: Verify golangci-lint configuration | ||
| golangci-lint-verify: golangci-lint | ||
| @golangci-lint config verify | ||
| #? golangci-lint-install: Install golangci-lint tool | ||
| golangci-lint-install: | ||
| @scripts/install-tools.sh --golangci | ||
|
|
||
| #? go-lint: Run the golangci-lint tool | ||
| .PHONY: go-lint | ||
| go-lint: golangci-lint | ||
| go-lint: golangci-lint-install | ||
| golangci-lint config verify | ||
| gofmt -l -s -w . | ||
| golangci-lint run --timeout=30m --fix ./... | ||
|
|
||
|
|
@@ -71,7 +69,7 @@ lint: licensecheck go-lint oas-lint | |
|
|
||
| #? crd: Generates CRD using controller-gen | ||
| .PHONY: crd | ||
| crd: controller-gen | ||
| crd: controller-gen-install | ||
| ${CONTROLLER_GEN} crd:crdVersions=v1 paths="./endpoint/..." output:crd:stdout > docs/contributing/crd-source/crd-manifest.yaml | ||
|
|
||
| #? test: The verify target runs tasks similar to the CI tasks, but without code coverage | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright 2025 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. | ||
|
|
||
| # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools | ||
| CONTROLLER_TOOLS_GENERATOR_VERSION=v0.15.0 | ||
| # renovate: datasource=github-releases depName=golangci/golangci-lint | ||
| GOLANG_CI_LINTER_VERSION=v2.0.2 | ||
|
|
||
| # Execute | ||
| # scripts/install-tools.sh | ||
| # scripts/install-tools.sh -h | ||
| # scripts/install-tools.sh --generator | ||
| # scripts/install-tools.sh --golangci | ||
|
|
||
| show_help() { | ||
| cat << EOF | ||
| 'external-dns' helm linter helper commands | ||
|
|
||
| Usage: $(basename "$0") <options> | ||
| -h, --help Display help | ||
| --generator Install generator | ||
| --golangci Install golangci linter | ||
| EOF | ||
| } | ||
|
|
||
| install_generator() { | ||
| # https://github.com/kubernetes-sigs/controller-tools/blob/main/cmd/controller-gen/main.go | ||
| local install=false | ||
| if [[ -x $(which controller-gen) ]]; then | ||
| local version=$(controller-gen --version | sed 's/Version: //') | ||
| if [[ "${version}" == "${CONTROLLER_TOOLS_GENERATOR_VERSION}" ]]; then | ||
| install=false | ||
| else | ||
| install=true | ||
| fi | ||
| else | ||
| install=true | ||
| fi | ||
| if [[ "$install" == true ]]; then | ||
| set -ex ;\ | ||
| go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_TOOLS_GENERATOR_VERSION} ; | ||
| fi | ||
| } | ||
|
|
||
| install_golangci() { | ||
| local install=false | ||
| if [[ -x $(which golangci-lint) ]]; then | ||
| local version=$(golangci-lint version --short) | ||
| if [[ "${version}" == "${GOLANG_CI_LINTER_VERSION#v}" ]]; then | ||
| install=false | ||
| else | ||
| install=true | ||
| fi | ||
| else | ||
| install=true | ||
| fi | ||
| if [[ "$install" == true ]]; then | ||
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh \ | ||
| | sh -s -- -b $(go env GOPATH)/bin "${GOLANG_CI_LINTER_VERSION}" | ||
| fi | ||
| } | ||
|
|
||
| function main() { | ||
| case $1 in | ||
| --generator) | ||
| install_generator | ||
| ;; | ||
| --golangci) | ||
| install_golangci | ||
| ;; | ||
| -h|--help) | ||
| show_help | ||
| ;; | ||
| *) | ||
| echo "unknown sub-command" >&2 | ||
| show_help | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| } | ||
|
|
||
| main "$@" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to pin version here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's pinned on line 20 https://github.com/kubernetes-sigs/external-dns/blob/aa7f5ca0d7ce91f67d18b0bdca875e66b092e451/scripts/install-tools.sh#L20C1-L20C32
this script is not versioned to my understanding, but version is passed to the script.
Docs how to install https://golangci-lint.run/welcome/install/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I would still replace
HEADwith a commit so that we are not subject to weird changes to the script that either break things or worse are a security risk.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a tag, as commit sha is trictky to manage. will this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it tricky? It would just be
https://raw.githubusercontent.com/golangci/golangci-lint/cc3567e3127d8530afb69be1b7bd20ba9ebcc7c1/install.sh.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated updates tricky
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to commit sha