Skip to content

Commit 6bda013

Browse files
KPA experimental install
1 parent 6d91914 commit 6bda013

File tree

22 files changed

+192
-0
lines changed

22 files changed

+192
-0
lines changed
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-kube-api-linter
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ 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+
type: "module"
33+
description: Kube API LInter lints Kube like APIs based on API conventions and best practices.
2934
exclusions:
3035
generated: lax
3136
rules:
@@ -36,6 +41,9 @@ linters:
3641
- dupl
3742
- lll
3843
path: internal/*
44+
- path-except: "^api/"
45+
linters:
46+
- kubeapilinter
3947
paths:
4048
- third_party$
4149
- 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-kube-api-linter
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ 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+
type: "module"
33+
description: Kube API LInter lints Kube like APIs based on API conventions and best practices.
2934
exclusions:
3035
generated: lax
3136
rules:
@@ -36,6 +41,9 @@ linters:
3641
- dupl
3742
- lll
3843
path: internal/*
44+
- path-except: "^api/"
45+
linters:
46+
- kubeapilinter
3947
paths:
4048
- third_party$
4149
- 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-kube-api-linter
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ 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+
type: "module"
33+
description: Kube API LInter lints Kube like APIs based on API conventions and best practices.
2934
exclusions:
3035
generated: lax
3136
rules:
@@ -36,6 +41,9 @@ linters:
3641
- dupl
3742
- lll
3843
path: internal/*
44+
- path-except: "^api/"
45+
linters:
46+
- kubeapilinter
3947
paths:
4048
- third_party$
4149
- 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

pkg/plugins/golang/v4/scaffolds/init.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ func (s *initScaffolder) Scaffold() error {
174174
&templates.DockerIgnore{},
175175
&templates.Readme{CommandName: s.commandName},
176176
&templates.Golangci{},
177+
&templates.CustomGcl{},
177178
&e2e.Test{},
178179
&e2e.WebhookTestUpdater{WireWebhook: false},
179180
&e2e.SuiteTest{},

0 commit comments

Comments
 (0)