Skip to content

Commit b7a730c

Browse files
authored
Merge pull request #2409 from camilamacedo86/release-3
2 parents 4cdd9ca + e9458de commit b7a730c

File tree

431 files changed

+8586
-3614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

431 files changed

+8586
-3614
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ body:
1818
cross-repository effort, it probably belongs here. Feel free to continue :wink:
1919
2020
[cr-issue]: https://github.com/kubernetes-sigs/controller-runtime/issues/new
21-
[cr-issue]: https://github.com/kubernetes-sigs/controller-tools/issues/new
21+
[ct-issue]: https://github.com/kubernetes-sigs/controller-tools/issues/new
2222
2323
- type: markdown
2424
attributes:
@@ -98,7 +98,7 @@ body:
9898
id: cli-version
9999
attributes:
100100
label: KubeBuilder (CLI) Version
101-
description: "use `kubebuilder --version` to find this out"
101+
description: "use `kubebuilder version` to find this out"
102102
validations:
103103
required: true
104104

.github/ISSUE_TEMPLATE/feature_request.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ body:
1818
cross-repository effort, it probably belongs here. Feel free to continue :wink:
1919
2020
[cr-issue]: https://github.com/kubernetes-sigs/controller-runtime/issues/new
21-
[cr-issue]: https://github.com/kubernetes-sigs/controller-tools/issues/new
21+
[ct-issue]: https://github.com/kubernetes-sigs/controller-tools/issues/new
2222
2323
- type: markdown
2424
attributes:
2525
value: |
2626
# Hiya! Welcome to Kubebuilder!
27-
27+
2828
For a smooth issue process, try to answer the following questions.
2929
Don't worry if they're not all applicable; just try to include what you can :smile:
3030
@@ -34,7 +34,7 @@ body:
3434
<details>
3535
3636
<summary>Code & details examples</summary>
37-
37+
3838
`````markdown
3939
Some code code written in Go:
4040
@@ -63,7 +63,7 @@ body:
6363
6464
`````
6565
66-
[mdn-details]: ://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
66+
[mdn-details]: ://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
6767
6868
- type: textarea
6969
attributes:
@@ -80,7 +80,7 @@ body:
8080
validations: {required: true}
8181

8282
- type: dropdown
83-
attributes:
83+
attributes:
8484
label: "Extra Labels"
8585
description: |
8686
If this is *also* a documentation request, etc, please select that below.

.github/workflows/apidiff.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: APIDiff
2+
3+
# Trigger the workflow on pull requests and direct pushes to any branch
4+
on:
5+
push:
6+
pull_request:
7+
8+
jobs:
9+
go-apidiff:
10+
name: Verify API differences
11+
runs-on: ubuntu-latest
12+
# Pull requests from different repository only trigger this checks
13+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
14+
steps:
15+
- name: Clone the code
16+
uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
- name: Setup Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: '1.16'
23+
- name: Execute go-apidiff
24+
uses: joelanford/[email protected]
25+
with:
26+
compare-imports: true
27+
print-compatible: true
28+
- name: Report failure
29+
uses: nashmaniac/[email protected]
30+
# Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
31+
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
32+
with:
33+
title: 🐛 go-apidiff failed for ${{ github.sha }}
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
labels: kind/bug
36+
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Run linter
1919
uses: golangci/golangci-lint-action@v2
2020
with:
21-
version: v1.37 # Always uses the latest patch version.
21+
version: v1.41 # Always uses the latest patch version.
2222
only-new-issues: true # Show only new issues if it's a pull request
2323
- name: Report failure
2424
uses: nashmaniac/[email protected]

.golangci.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,35 @@ issues:
77
exclude-rules:
88
- linters: [gosec]
99
path: "test/e2e/*"
10+
11+
linters-settings:
12+
govet:
13+
enable=fieldalignment: true
14+
revive:
15+
rules:
16+
- name: if-return
17+
disabled: true
18+
1019
linters:
1120
disable-all: true
1221
enable:
1322
- deadcode
1423
- dupl
1524
- errcheck
25+
- exportloopref
1626
- goconst
1727
- gocyclo
1828
- gofmt
1929
- goimports
20-
- golint
2130
- gosec
2231
- gosimple
2332
- govet
2433
- ineffassign
25-
- interfacer
2634
- lll
27-
- maligned
2835
- misspell
2936
- nakedret
3037
- prealloc
31-
- scopelint
38+
- revive
3239
- staticcheck
3340
- structcheck
3441
- typecheck

CONTRIBUTING.md

+12-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Please see https://git.k8s.io/community/CLA.md for more info.
1010

1111
## Prerequisites
1212

13-
- [go](https://golang.org/dl/) version v1.15+.
13+
- [go](https://golang.org/dl/) version v1.16+.
1414
- [docker](https://docs.docker.com/install/) version 17.03+.
1515
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) version v1.11.3+.
1616
- [kustomize](https://sigs.k8s.io/kustomize/docs/INSTALL.md) v3.1.0+
@@ -35,13 +35,15 @@ $ git clone [email protected]:<user>/kubebuilder.git $GOPATH/src/sigs.k8s.io/kubebu
3535
```
3636

3737
1. Ensure you activate module support before continue (`$ export GO111MODULE=on`)
38-
1. Run the command `make install` to create a bin with the source code
38+
1. Run the command `make install` to create a bin with the source code
3939

4040
**NOTE** In order to check the local environment run `make test-unit`.
4141

42-
## What to do before submitting a pull request
42+
## What to do before submitting a pull request
4343

44-
1. Run the script `make generate` to update/generate the mock data used in the e2e test in `$GOPATH/src/sigs.k8s.io/kubebuilder/testdata/`
44+
1. Run the script `make generate` to update/generate the mock data used in the e2e test in `$GOPATH/src/sigs.k8s.io/kubebuilder/testdata/`
45+
1. Run `make test-unit test-e2e-local`
46+
- e2e tests use [`kind`][kind] and [`setup-envtest`][setup-envtest]. If you want to bring your own binaries, place them in `$(go env GOPATH)/bin`.
4547

4648
**IMPORTANT:** The `make generate` is very helpful. By using it, you can check if good part of the commands still working successfully after the changes. Also, note that its usage is a pre-requirement to submit a PR.
4749

@@ -87,9 +89,9 @@ separately.
8789

8890
## Where the CI Tests are configured
8991

90-
1. See the [action files](.github/workflows) to check its tests, and the scripts used on it.
91-
1. Note that the prow tests used in the CI are configured in [kubernetes-sigs/kubebuilder/kubebuilder-presubmits.yaml](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-sigs/kubebuilder/kubebuilder-presubmits.yaml).
92-
1. Check that all scripts used by the CI are defined in the project.
92+
1. See the [action files](.github/workflows) to check its tests, and the scripts used on it.
93+
1. Note that the prow tests used in the CI are configured in [kubernetes-sigs/kubebuilder/kubebuilder-presubmits.yaml](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-sigs/kubebuilder/kubebuilder-presubmits.yaml).
94+
1. Check that all scripts used by the CI are defined in the project.
9395

9496
## How to contribute to docs
9597

@@ -102,7 +104,7 @@ The docs are published off of three branches:
102104
legacy docs
103105
- `master`:
104106
[master.book.kubebuilder.io](https://master.book.kubebuilder.io) --
105-
"nightly" docs
107+
"nightly" docs
106108

107109
See [VERSIONING.md](VERSIONING.md#book-releases) for more information.
108110

@@ -129,3 +131,5 @@ KubeBuilder and the related repositories. See
129131
Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md).
130132

131133
[golangci]:https://github.com/golangci/golangci-lint
134+
[kind]:https://kind.sigs.k8s.io/#installation-and-usage
135+
[setup-envtest]:https://book.kubebuilder.io/reference/envtest

Makefile

+14-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,17 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
8282
golangci-lint:
8383
@[ -f $(GOLANGCI_LINT) ] || { \
8484
set -e ;\
85-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.37.1 ;\
85+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.41.1 ;\
86+
}
87+
88+
.PHONY: apidiff
89+
apidiff: go-apidiff ## Run the go-apidiff to verify any API differences compared with origin/master
90+
$(GO_APIDIFF) master --compare-imports --print-compatible --repo-path=.
91+
92+
GO_APIDIFF = $(shell pwd)/bin/go-apidiff
93+
go-apidiff:
94+
@[ -f $(GO_APIDIFF) ] || { \
95+
cd tools && go build -tags=tools -o $(GO_APIDIFF) github.com/joelanford/go-apidiff ;\
8696
}
8797

8898
##@ Tests
@@ -91,13 +101,14 @@ golangci-lint:
91101
test: test-unit test-integration test-testdata test-book ## Run the unit and integration tests (used in the CI)
92102

93103
.PHONY: test-unit
104+
TEST_PKGS := ./pkg/... ./test/e2e/utils/...
94105
test-unit: ## Run the unit tests
95-
go test -race -v ./pkg/...
106+
go test -race $(TEST_PKGS)
96107

97108
.PHONY: test-coverage
98109
test-coverage: ## Run unit tests creating the output to report coverage
99110
- rm -rf *.out # Remove all coverage files if exists
100-
go test -race -failfast -tags=integration -coverprofile=coverage-all.out -coverpkg="./pkg/cli/...,./pkg/config/...,./pkg/internal/...,./pkg/machinery/...,./pkg/model/...,./pkg/plugin/...,./pkg/plugins/golang" ./pkg/...
111+
go test -race -failfast -tags=integration -coverprofile=coverage-all.out -coverpkg="./pkg/cli/...,./pkg/config/...,./pkg/internal/...,./pkg/machinery/...,./pkg/model/...,./pkg/plugin/...,./pkg/plugins/golang" $(TEST_PKGS)
101112

102113
.PHONY: test-integration
103114
test-integration: ## Run the integration tests

OWNERS_ALIASES

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ aliases:
44
# active folks who can be contacted to perform admin-related
55
# tasks on the repo, or otherwise approve any PRs.
66
kubebuilder-admins:
7-
- droot
8-
- mengqiy
97
- pwittrock
108
- estroz
119
- camilamacedo86
1210

1311
# non-admin folks who can approve any PRs in the repo
1412
kubebuilder-approvers:
15-
- estroz
1613
- adirio
1714

1815
# folks who can review and LGTM any PRs in the repo (doesn't include
@@ -24,3 +21,6 @@ aliases:
2421
# but are no longer directly involved
2522
kubebuilder-emeritus-approvers:
2623
- directxman12
24+
- droot
25+
- mengqiy
26+

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[![Build Status](https://travis-ci.org/kubernetes-sigs/kubebuilder.svg?branch=master)](https://travis-ci.org/kubernetes-sigs/kubebuilder "Travis")
1+
[![Lint](https://github.com/kubernetes-sigs/kubebuilder/actions/workflows/lint.yml/badge.svg)](https://github.com/kubernetes-sigs/kubebuilder/actions/workflows/lint.yml)
2+
[![Unit tests](https://github.com/kubernetes-sigs/kubebuilder/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/kubernetes-sigs/kubebuilder/actions/workflows/unit-tests.yml)
23
[![Go Report Card](https://goreportcard.com/badge/sigs.k8s.io/kubebuilder)](https://goreportcard.com/report/sigs.k8s.io/kubebuilder)
34
[![Coverage Status](https://coveralls.io/repos/github/kubernetes-sigs/kubebuilder/badge.svg?branch=master)](https://coveralls.io/github/kubernetes-sigs/kubebuilder?branch=master)
45

@@ -62,7 +63,7 @@ Building APIs using CRDs, Controllers and Admission Webhooks.
6263

6364
## Philosophy
6465

65-
See [DESIGN.md](DESIGN.md) for the guiding principals of the various KubeBuilder projects.
66+
See [DESIGN.md](DESIGN.md) for the guiding principles of the various KubeBuilder projects.
6667

6768
TL;DR:
6869

build/.goreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ builds:
4343
- linux_ppc64le
4444
- darwin_amd64
4545
env:
46-
- KUBERNETES_VERSION=1.19.2
46+
- KUBERNETES_VERSION=1.22.1
4747
- CGO_ENABLED=0
4848

4949
# Only binaries of the form "kubebuilder_${goos}_${goarch}" will be released.

cmd/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func main() {
4343
cli.WithVersion(versionString()),
4444
cli.WithPlugins(
4545
golangv2.Plugin{},
46+
golangv3.Plugin{},
4647
gov3Bundle,
4748
&kustomizecommonv1.Plugin{},
4849
&declarativev1.Plugin{},

0 commit comments

Comments
 (0)