Skip to content

Commit e8ce62d

Browse files
author
sapcc-bot
committed
Run go-makefile-maker
1 parent 01b6df2 commit e8ce62d

10 files changed

Lines changed: 63 additions & 54 deletions

File tree

.github/renovate.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"extends": [
44
"config:recommended",
55
"default:pinDigestsDisabled",
6-
"mergeConfidence:all-badges",
7-
"docker:disable"
6+
"docker:pinDigests",
7+
"mergeConfidence:all-badges"
88
],
99
"assignees": [
1010
"Nuckal777"
@@ -58,6 +58,15 @@
5858
],
5959
"dependencyDashboardApproval": true
6060
},
61+
{
62+
"matchFileNames": [
63+
".github/workflows/checks.yaml",
64+
".github/workflows/ci.yaml",
65+
".github/workflows/codeql.yaml",
66+
".github/workflows/container-registry-ghcr.yaml"
67+
],
68+
"enabled": false
69+
},
6170
{
6271
"matchPackageNames": [
6372
"/^k8s.io\\//"

.github/workflows/checks.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,29 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Check out code
27-
uses: actions/checkout@v6
27+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
28+
with:
29+
persist-credentials: false
2830
- name: Set up Go
29-
uses: actions/setup-go@v6
31+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
3032
with:
3133
check-latest: true
3234
go-version: 1.26.4
3335
- name: Run golangci-lint
34-
uses: golangci/golangci-lint-action@v9
36+
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9
3537
with:
36-
version: latest
38+
version: v2.12.2
3739
- name: Delete pre-installed shellcheck
3840
run: sudo rm -f "$(which shellcheck)"
3941
- name: Run shellcheck
4042
run: make run-shellcheck
4143
- name: Dependency Licenses Review
4244
run: make check-dependency-licenses
4345
- name: Check for spelling errors
44-
uses: crate-ci/typos@v1
46+
uses: crate-ci/typos@37bb98842b0d8c4ffebdb75301a13db0267cef89 # v1
4547
env:
4648
CLICOLOR: "1"
47-
- name: Delete typos binary
48-
run: rm -f typos
4949
- name: Check if source code files have license header
5050
run: make check-addlicense
5151
- name: REUSE Compliance Check
52-
uses: fsfe/reuse-action@v6
53-
- name: Install govulncheck
54-
run: go install golang.org/x/vuln/cmd/govulncheck@latest
55-
- name: Run govulncheck
56-
run: govulncheck -format text ./...
52+
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6

.github/workflows/ci.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Check out code
30-
uses: actions/checkout@v6
30+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
31+
with:
32+
persist-credentials: false
3133
- name: Set up Go
32-
uses: actions/setup-go@v6
34+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
3335
with:
3436
check-latest: true
3537
go-version: 1.26.4
@@ -43,12 +45,15 @@ jobs:
4345
runs-on: ubuntu-latest
4446
steps:
4547
- name: Check out code
46-
uses: actions/checkout@v6
48+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
49+
with:
50+
persist-credentials: false
4751
- name: Post coverage report
48-
uses: fgrosse/go-coverage-report@v1.3.0
52+
uses: fgrosse/go-coverage-report@cbeb2ab2e32591d690337146ba02a911cc566f3f # v1.3.0
4953
with:
5054
coverage-artifact-name: code-coverage
5155
coverage-file-name: cover.out
56+
root-package: github.com/cobaltcore-dev/cloud-profile-sync
5257
permissions:
5358
actions: read
5459
contents: read
@@ -60,16 +65,18 @@ jobs:
6065
runs-on: ubuntu-latest
6166
steps:
6267
- name: Check out code
63-
uses: actions/checkout@v6
68+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
69+
with:
70+
persist-credentials: false
6471
- name: Set up Go
65-
uses: actions/setup-go@v6
72+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
6673
with:
6774
check-latest: true
6875
go-version: 1.26.4
6976
- name: Run tests and generate coverage report
7077
run: make build/cover.out
7178
- name: Archive code coverage results
72-
uses: actions/upload-artifact@v7
79+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
7380
with:
7481
name: code-coverage
7582
path: build/cover.out

.github/workflows/codeql.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,20 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Check out code
30-
uses: actions/checkout@v6
30+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
31+
with:
32+
persist-credentials: false
3133
- name: Set up Go
32-
uses: actions/setup-go@v6
34+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
3335
with:
3436
check-latest: true
3537
go-version: 1.26.4
3638
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@v4
39+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
3840
with:
3941
languages: go
4042
queries: security-extended
4143
- name: Autobuild
42-
uses: github/codeql-action/autobuild@v4
44+
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
4345
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@v4
46+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4

.github/workflows/container-registry-ghcr.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Check out code
24-
uses: actions/checkout@v6
24+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
25+
with:
26+
persist-credentials: false
2527
- name: Log in to the Container registry
26-
uses: docker/login-action@v4
28+
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
2729
with:
2830
password: ${{ secrets.GITHUB_TOKEN }}
2931
registry: ghcr.io
3032
username: ${{ github.actor }}
3133
- name: Extract metadata (tags, labels) for Docker
3234
id: meta
33-
uses: docker/metadata-action@v6
35+
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6
3436
with:
3537
images: ghcr.io/${{ github.repository }}
3638
tags: |
@@ -45,11 +47,11 @@ jobs:
4547
# https://github.com/docker/metadata-action#typesha
4648
type=sha,format=long
4749
- name: Set up QEMU
48-
uses: docker/setup-qemu-action@v4
50+
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4
4951
- name: Set up Docker Buildx
50-
uses: docker/setup-buildx-action@v4
52+
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
5153
- name: Build and push Docker image
52-
uses: docker/build-push-action@v7
54+
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7
5355
with:
5456
context: .
5557
labels: ${{ steps.meta.outputs.labels }}

.golangci.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,17 @@ linters:
9393
- pattern: ^http\.Handle(?:Func)?$
9494
- pkg: ^gopkg\.in/square/go-jose\.v2
9595
msg: gopk.in/square/go-jose is archived and has CVEs. Replace it with gopkg.in/go-jose/go-jose.v2
96-
- pkg: ^github\.com/coreos/go-oidc
96+
- pkg: ^github\.com/coreos/go-oidc$
9797
msg: github.com/coreos/go-oidc depends on gopkg.in/square/go-jose which has CVEs. Replace it with github.com/coreos/go-oidc/v3
9898
- pkg: ^github\.com/howeyc/gopass
9999
msg: github.com/howeyc/gopass is archived, use golang.org/x/term instead
100100
- pkg: ^github\.com/containers/image/v5
101101
msg: github.com/containers/image/v5 is deprecated and was replaced with go.podman.io/image/v5
102102
goconst:
103103
min-occurrences: 5
104+
ignore-tests: true
105+
ignore-string-values:
106+
- '^[a-zA-Z_-]{1,16}$' # ignore short identifiers like "account" or "project_id"
104107
gocritic:
105108
enabled-checks:
106109
- boolExprSimplify
@@ -132,10 +135,8 @@ linters:
132135
- github.com/mdlayher/arp
133136
# for github.com/sapcc/vpa_butler
134137
- k8s.io/client-go
135-
# for github.com/sapcc/keppel et al
136-
- github.com/go-gorp/gorp/v3
137138
toolchain-forbidden: true
138-
go-version-pattern: 1\.\d+(\.\d+)?$
139+
go-version-pattern: 1\.\d+(\.0)?$
139140
gosec:
140141
excludes:
141142
# gosec wants us to set a short ReadHeaderTimeout to avoid Slowloris attacks, but doing so would expose us to Keep-Alive race conditions (see https://iximiuz.com/en/posts/reverse-proxy-http-keep-alive-and-502s/
@@ -172,6 +173,7 @@ linters:
172173
- github.com/majewsky/gg/option
173174
- github.com/onsi/ginkgo/v2
174175
- github.com/onsi/gomega
176+
- go.xyrillian.de/gg/option
175177
usestdlibvars:
176178
http-method: true
177179
http-status-code: true

.typos.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
[default.extend-words]
66

7-
[default]
8-
extend-ignore-identifiers-re = ["ANDed"]
9-
107
[files]
118
extend-exclude = [
129
"go.mod",

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ install-setup-envtest: FORCE
6868
# To add additional flags or values (before the default ones), specify the variable in the environment, e.g. `GO_BUILDFLAGS='-tags experimental' make`.
6969
# To override the default flags or values, specify the variable on the command line, e.g. `make GO_BUILDFLAGS='-tags experimental'`.
7070
GO_BUILDFLAGS +=
71-
GO_LDFLAGS +=
72-
GO_TESTFLAGS +=
73-
GO_TESTENV +=
74-
GO_BUILDENV +=
71+
GO_LDFLAGS +=
72+
GO_TESTFLAGS +=
73+
GO_TESTENV +=
74+
GO_BUILDENV +=
7575

7676
build-all: build/cloud-profile-sync
7777

@@ -100,13 +100,14 @@ GO_COVERPKGS := $(shell go list ./...)
100100
null :=
101101
space := $(null) $(null)
102102
comma := ,
103+
YEAR ?= $(shell date +%Y)
103104

104105
check: FORCE static-check build/cover.html build-all
105106
@printf "\e[1;32m>> All checks successful.\e[0m\n"
106107

107108
generate: install-controller-gen
108109
@printf "\e[1;36m>> controller-gen\e[0m\n"
109-
@controller-gen crd rbac:roleName=cloud-profile-sync webhook paths="./..." output:crd:artifacts:config=crd
110+
@controller-gen crd rbac:roleName=cloud-profile-sync webhook paths="./..." output:crd:artifacts:config=crd output:rbac:artifacts:config=config/rbac
110111
@controller-gen object paths="./..."
111112
@controller-gen applyconfiguration paths="./..."
112113

@@ -125,7 +126,7 @@ run-typos: FORCE install-typos
125126

126127
build/cover.out: FORCE generate install-setup-envtest | build
127128
@printf "\e[1;36m>> Running tests\e[0m\n"
128-
KUBEBUILDER_ASSETS=$$(setup-envtest use 1.34 -p path) go run github.com/onsi/ginkgo/v2/ginkgo run --randomize-all -output-dir=build $(GO_BUILDFLAGS) -ldflags '-s -w $(GO_LDFLAGS)' -covermode=count -coverpkg=$(subst $(space),$(comma),$(GO_COVERPKGS)) $(GO_TESTFLAGS) $(GO_TESTPKGS)
129+
KUBEBUILDER_ASSETS=$$(setup-envtest use 1.36 -p path) go run github.com/onsi/ginkgo/v2/ginkgo run --randomize-all -output-dir=build $(GO_BUILDFLAGS) -ldflags '-s -w $(GO_LDFLAGS)' -covermode=count -coverpkg=$(subst $(space),$(comma),$(GO_COVERPKGS)) $(GO_TESTFLAGS) $(GO_TESTPKGS)
129130
@awk < build/coverprofile.out '$$1 != "mode:" { is_filename[$$1] = true; counts1[$$1]+=$$2; counts2[$$1]+=$$3 } END { for (filename in is_filename) { printf "%s %d %d\n", filename, counts1[filename], counts2[filename]; } }' | sort | $(SED) '1s/^/mode: count\n/' > $@
130131

131132
build/cover.html: build/cover.out

REUSE.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ path = [
1111
".gitignore",
1212
".license-scan-overrides.jsonl",
1313
".license-scan-rules.json",
14+
"build/**/*",
1415
]
1516
SPDX-FileCopyrightText = "SAP SE or an SAP affiliate company"
1617
SPDX-License-Identifier = "Apache-2.0"
@@ -32,11 +33,3 @@ path = [
3233
]
3334
SPDX-FileCopyrightText = "2020 The Kubernetes Authors"
3435
SPDX-License-Identifier = "Apache-2.0"
35-
36-
[[annotations]]
37-
path = [
38-
"build/*",
39-
".claude/*",
40-
]
41-
SPDX-FileCopyrightText = "NOASSERTION"
42-
SPDX-License-Identifier = "CC0-1.0"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/cobaltcore-dev/cloud-profile-sync
22

3-
go 1.26.2
3+
go 1.26
44

55
require (
66
github.com/blang/semver/v4 v4.0.0

0 commit comments

Comments
 (0)