Skip to content

Commit 2f745c5

Browse files
KPA experimental install
1 parent ab8a683 commit 2f745c5

File tree

23 files changed

+221
-1
lines changed

23 files changed

+221
-1
lines changed

.github/workflows/lint-sample.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Run linter
4444
uses: golangci/golangci-lint-action@v8
4545
with:
46-
version: v2.2.2
46+
version: v2.3.0
4747
working-directory: ${{ matrix.folder }}
4848
- name: Run linter via makefile target
4949
working-directory: ${{ matrix.folder }}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: v2.0.0
2+
name: golangci-custom-linters
3+
destination: ./bin
4+
5+
plugins:
6+
- module: sigs.k8s.io/kube-api-linter
7+
version: latest

docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ linters:
2121
- unconvert
2222
- unparam
2323
- unused
24+
- kubeapilinter
2425
settings:
2526
revive:
2627
rules:
2728
- name: comment-spacings
2829
- name: import-shadowing
30+
custom:
31+
kubeapilinter:
32+
path: ./bin/golangci-custom-linters
33+
description: "Kube API Linter plugin"
34+
original-url: "sigs.k8s.io/kube-api-linter"
35+
settings:
36+
linters: {}
37+
lintersConfig: {}
2938
exclusions:
3039
generated: lax
3140
rules:
@@ -36,6 +45,9 @@ linters:
3645
- dupl
3746
- lll
3847
path: internal/*
48+
- path-except: "^api/"
49+
linters:
50+
- kubeapilinter
3951
paths:
4052
- third_party$
4153
- builtin$

docs/book/src/cronjob-tutorial/testdata/project/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ $(ENVTEST): $(LOCALBIN)
224224
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
225225
$(GOLANGCI_LINT): $(LOCALBIN)
226226
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
227+
@echo "Running golangci-lint custom..."
228+
@$(LOCALBIN)/golangci-lint custom || { \
229+
echo "golangci-lint failed. Cleaning up..."; \
230+
rm -f $(LOCALBIN)/golangci-lint; \
231+
exit 1; \
232+
}
227233

228234
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
229235
# $1 - target path with name of binary
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: v2.0.0
2+
name: golangci-custom-linters
3+
destination: ./bin
4+
5+
plugins:
6+
- module: sigs.k8s.io/kube-api-linter
7+
version: latest

docs/book/src/getting-started/testdata/project/.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ linters:
2121
- unconvert
2222
- unparam
2323
- unused
24+
- kubeapilinter
2425
settings:
2526
revive:
2627
rules:
2728
- name: comment-spacings
2829
- name: import-shadowing
30+
custom:
31+
kubeapilinter:
32+
path: ./bin/golangci-custom-linters
33+
description: "Kube API Linter plugin"
34+
original-url: "sigs.k8s.io/kube-api-linter"
35+
settings:
36+
linters: {}
37+
lintersConfig: {}
2938
exclusions:
3039
generated: lax
3140
rules:
@@ -36,6 +45,9 @@ linters:
3645
- dupl
3746
- lll
3847
path: internal/*
48+
- path-except: "^api/"
49+
linters:
50+
- kubeapilinter
3951
paths:
4052
- third_party$
4153
- builtin$

docs/book/src/getting-started/testdata/project/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ $(ENVTEST): $(LOCALBIN)
220220
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
221221
$(GOLANGCI_LINT): $(LOCALBIN)
222222
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
223+
@echo "Running golangci-lint custom..."
224+
@$(LOCALBIN)/golangci-lint custom || { \
225+
echo "golangci-lint failed. Cleaning up..."; \
226+
rm -f $(LOCALBIN)/golangci-lint; \
227+
exit 1; \
228+
}
223229

224230
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
225231
# $1 - target path with name of binary
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: v2.0.0
2+
name: golangci-custom-linters
3+
destination: ./bin
4+
5+
plugins:
6+
- module: sigs.k8s.io/kube-api-linter
7+
version: latest

docs/book/src/multiversion-tutorial/testdata/project/.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ linters:
2121
- unconvert
2222
- unparam
2323
- unused
24+
- kubeapilinter
2425
settings:
2526
revive:
2627
rules:
2728
- name: comment-spacings
2829
- name: import-shadowing
30+
custom:
31+
kubeapilinter:
32+
path: ./bin/golangci-custom-linters
33+
description: "Kube API Linter plugin"
34+
original-url: "sigs.k8s.io/kube-api-linter"
35+
settings:
36+
linters: {}
37+
lintersConfig: {}
2938
exclusions:
3039
generated: lax
3140
rules:
@@ -36,6 +45,9 @@ linters:
3645
- dupl
3746
- lll
3847
path: internal/*
48+
- path-except: "^api/"
49+
linters:
50+
- kubeapilinter
3951
paths:
4052
- third_party$
4153
- builtin$

docs/book/src/multiversion-tutorial/testdata/project/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ $(ENVTEST): $(LOCALBIN)
224224
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
225225
$(GOLANGCI_LINT): $(LOCALBIN)
226226
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
227+
@echo "Running golangci-lint custom..."
228+
@$(LOCALBIN)/golangci-lint custom || { \
229+
echo "golangci-lint failed. Cleaning up..."; \
230+
rm -f $(LOCALBIN)/golangci-lint; \
231+
exit 1; \
232+
}
227233

228234
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
229235
# $1 - target path with name of binary

0 commit comments

Comments
 (0)