From b91b0f1dbac4a06842b159abfa40124db336b21d Mon Sep 17 00:00:00 2001 From: Isaac Date: Tue, 1 Apr 2025 13:34:15 +0200 Subject: [PATCH 1/3] Fix boilerplate outdated information --- .ci-operator.yaml | 4 ++-- .gitattributes | 13 ------------- .github/dependabot.yml | 2 -- 3 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 .gitattributes diff --git a/.ci-operator.yaml b/.ci-operator.yaml index 9b90924e..fce96a6e 100644 --- a/.ci-operator.yaml +++ b/.ci-operator.yaml @@ -1,4 +1,4 @@ build_root_image: - name: boilerplate namespace: openshift - tag: image-v5.0.1 + name: release + tag: rhel-8-release-golang-1.22-openshift-4.17 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 5fe35cbd..00000000 --- a/.gitattributes +++ /dev/null @@ -1,13 +0,0 @@ -### BEGIN BOILERPLATE GENERATED -- DO NOT EDIT ### -### This block must be the last thing in your ### -### .gitattributes file; otherwise the 'validate' ### -### CI check will fail. ### -# Used to ensure nobody mucked with boilerplate files. -boilerplate/_lib/freeze-check linguist-generated=false -# Show the boilerplate commit hash update. It's only one line anyway. -boilerplate/_data/last-boilerplate-commit linguist-generated=false -# Used by freeze-check. Good place for attackers to inject badness. -boilerplate/update linguist-generated=false -# Make sure attackers can't hide changes to this configuration -.gitattributes linguist-generated=false -### END BOILERPLATE GENERATED ### diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 004cb068..c7f9cfec 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,5 @@ updates: schedule: interval: "weekly" ignore: - - dependency-name: "app-sre/boilerplate" - # don't upgrade boilerplate via these means - dependency-name: "openshift4/ose-operator-registry" # don't upgrade ose-operator-registry via these means From c37bf215cb19b1453302af75c80840efc0d2da46 Mon Sep 17 00:00:00 2001 From: Isaac Date: Tue, 1 Apr 2025 13:35:07 +0200 Subject: [PATCH 2/3] Fix EOF --- .ci-operator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci-operator.yaml b/.ci-operator.yaml index fce96a6e..7b05a101 100644 --- a/.ci-operator.yaml +++ b/.ci-operator.yaml @@ -1,4 +1,4 @@ build_root_image: namespace: openshift name: release - tag: rhel-8-release-golang-1.22-openshift-4.17 \ No newline at end of file + tag: rhel-8-release-golang-1.22-openshift-4.17 From 798cf6dc6d65691d0b42fc7026bf0f0970a3428d Mon Sep 17 00:00:00 2001 From: Isaac Date: Tue, 1 Apr 2025 16:54:46 +0200 Subject: [PATCH 3/3] Fix lint CI task after the change in the operator image --- Makefile | 6 +++++- ci/golangci-lint.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 ci/golangci-lint.sh diff --git a/Makefile b/Makefile index 73898c7c..14745d19 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,10 @@ endif go-mod-update: go mod vendor +.PHONY: ensure-golangci +ensure-golangci: + ./ci/golangci-lint.sh + GOOS ?= linux GOENV=GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=1 ${FIPSENV} GOBUILDFLAGS=-gcflags="all=-trimpath=${GOPATH}" -asmflags="all=-trimpath=${GOPATH}" @@ -41,7 +45,7 @@ go-build: go-mod-update GOLANGCI_OPTIONAL_CONFIG = .golangci.yml GOLANGCI_LINT_CACHE =/tmp/golangci-cache .PHONY: lint -lint: go-mod-update +lint: go-mod-update ensure-golangci @echo "## Running the golangci-lint tool..." GOLANGCI_LINT_CACHE=${GOLANGCI_LINT_CACHE} golangci-lint run -c ${GOLANGCI_OPTIONAL_CONFIG} ./... diff --git a/ci/golangci-lint.sh b/ci/golangci-lint.sh new file mode 100755 index 00000000..f0e41838 --- /dev/null +++ b/ci/golangci-lint.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -ex + +if [ -z "${GOPATH:-}" ]; then + eval "$(go env | grep GOPATH)" +fi + +export BINARY=bin/golangci-lint +if [ ! -f "$BINARY" ]; then + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.7 +fi