Skip to content

Commit fd94b35

Browse files
KPA experimental install
1 parent ab8a683 commit fd94b35

File tree

22 files changed

+220
-0
lines changed

22 files changed

+220
-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-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,6 +21,7 @@ linters:
2121
- unconvert
2222
- unparam
2323
- unused
24+
- kubeapilinter
2425
settings:
2526
revive:
2627
rules:
@@ -36,10 +37,20 @@ linters:
3637
- dupl
3738
- lll
3839
path: internal/*
40+
- path-except: "^api/"
41+
linters:
42+
- kubeapilinter
3943
paths:
4044
- third_party$
4145
- builtin$
4246
- examples$
47+
custom:
48+
kubeapilinter:
49+
type: "module"
50+
description: Kube API Linter lints Kube like APIs based on API conventions and best practices.
51+
settings:
52+
linters: {}
53+
lintersConfig: {}
4354
formatters:
4455
enable:
4556
- gofmt
@@ -50,3 +61,4 @@ formatters:
5061
- third_party$
5162
- builtin$
5263
- examples$
64+

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,6 +21,7 @@ linters:
2121
- unconvert
2222
- unparam
2323
- unused
24+
- kubeapilinter
2425
settings:
2526
revive:
2627
rules:
@@ -36,10 +37,20 @@ linters:
3637
- dupl
3738
- lll
3839
path: internal/*
40+
- path-except: "^api/"
41+
linters:
42+
- kubeapilinter
3943
paths:
4044
- third_party$
4145
- builtin$
4246
- examples$
47+
custom:
48+
kubeapilinter:
49+
type: "module"
50+
description: Kube API Linter lints Kube like APIs based on API conventions and best practices.
51+
settings:
52+
linters: {}
53+
lintersConfig: {}
4354
formatters:
4455
enable:
4556
- gofmt
@@ -50,3 +61,4 @@ formatters:
5061
- third_party$
5162
- builtin$
5263
- examples$
64+

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,6 +21,7 @@ linters:
2121
- unconvert
2222
- unparam
2323
- unused
24+
- kubeapilinter
2425
settings:
2526
revive:
2627
rules:
@@ -36,10 +37,20 @@ linters:
3637
- dupl
3738
- lll
3839
path: internal/*
40+
- path-except: "^api/"
41+
linters:
42+
- kubeapilinter
3943
paths:
4044
- third_party$
4145
- builtin$
4246
- examples$
47+
custom:
48+
kubeapilinter:
49+
type: "module"
50+
description: Kube API Linter lints Kube like APIs based on API conventions and best practices.
51+
settings:
52+
linters: {}
53+
lintersConfig: {}
4354
formatters:
4455
enable:
4556
- gofmt
@@ -50,3 +61,4 @@ formatters:
5061
- third_party$
5162
- builtin$
5263
- examples$
64+

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)