Skip to content

Commit

Permalink
Merge pull request #2409 from camilamacedo86/release-3
Browse files Browse the repository at this point in the history
  • Loading branch information
estroz authored Oct 29, 2021
2 parents 4cdd9ca + e9458de commit b7a730c
Show file tree
Hide file tree
Showing 431 changed files with 8,586 additions and 3,614 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body:
cross-repository effort, it probably belongs here. Feel free to continue :wink:
[cr-issue]: https://github.com/kubernetes-sigs/controller-runtime/issues/new
[cr-issue]: https://github.com/kubernetes-sigs/controller-tools/issues/new
[ct-issue]: https://github.com/kubernetes-sigs/controller-tools/issues/new
- type: markdown
attributes:
Expand Down Expand Up @@ -98,7 +98,7 @@ body:
id: cli-version
attributes:
label: KubeBuilder (CLI) Version
description: "use `kubebuilder --version` to find this out"
description: "use `kubebuilder version` to find this out"
validations:
required: true

Expand Down
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ body:
cross-repository effort, it probably belongs here. Feel free to continue :wink:
[cr-issue]: https://github.com/kubernetes-sigs/controller-runtime/issues/new
[cr-issue]: https://github.com/kubernetes-sigs/controller-tools/issues/new
[ct-issue]: https://github.com/kubernetes-sigs/controller-tools/issues/new
- type: markdown
attributes:
value: |
# Hiya! Welcome to Kubebuilder!
For a smooth issue process, try to answer the following questions.
Don't worry if they're not all applicable; just try to include what you can :smile:
Expand All @@ -34,7 +34,7 @@ body:
<details>
<summary>Code & details examples</summary>
`````markdown
Some code code written in Go:
Expand Down Expand Up @@ -63,7 +63,7 @@ body:
`````
[mdn-details]: ://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
[mdn-details]: ://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
- type: textarea
attributes:
Expand All @@ -80,7 +80,7 @@ body:
validations: {required: true}

- type: dropdown
attributes:
attributes:
label: "Extra Labels"
description: |
If this is *also* a documentation request, etc, please select that below.
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: APIDiff

# Trigger the workflow on pull requests and direct pushes to any branch
on:
push:
pull_request:

jobs:
go-apidiff:
name: Verify API differences
runs-on: ubuntu-latest
# Pull requests from different repository only trigger this checks
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Clone the code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Execute go-apidiff
uses: joelanford/[email protected]
with:
compare-imports: true
print-compatible: true
- name: Report failure
uses: nashmaniac/[email protected]
# Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
title: 🐛 go-apidiff failed for ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: kind/bug
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v2
with:
version: v1.37 # Always uses the latest patch version.
version: v1.41 # Always uses the latest patch version.
only-new-issues: true # Show only new issues if it's a pull request
- name: Report failure
uses: nashmaniac/[email protected]
Expand Down
15 changes: 11 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,35 @@ issues:
exclude-rules:
- linters: [gosec]
path: "test/e2e/*"

linters-settings:
govet:
enable=fieldalignment: true
revive:
rules:
- name: if-return
disabled: true

linters:
disable-all: true
enable:
- deadcode
- dupl
- errcheck
- exportloopref
- goconst
- gocyclo
- gofmt
- goimports
- golint
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- maligned
- misspell
- nakedret
- prealloc
- scopelint
- revive
- staticcheck
- structcheck
- typecheck
Expand Down
20 changes: 12 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Please see https://git.k8s.io/community/CLA.md for more info.

## Prerequisites

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

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

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

## What to do before submitting a pull request
## What to do before submitting a pull request

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/`
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/`
1. Run `make test-unit test-e2e-local`
- 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`.

**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.

Expand Down Expand Up @@ -87,9 +89,9 @@ separately.

## Where the CI Tests are configured

1. See the [action files](.github/workflows) to check its tests, and the scripts used on it.
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).
1. Check that all scripts used by the CI are defined in the project.
1. See the [action files](.github/workflows) to check its tests, and the scripts used on it.
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).
1. Check that all scripts used by the CI are defined in the project.

## How to contribute to docs

Expand All @@ -102,7 +104,7 @@ The docs are published off of three branches:
legacy docs
- `master`:
[master.book.kubebuilder.io](https://master.book.kubebuilder.io) --
"nightly" docs
"nightly" docs

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

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

[golangci]:https://github.com/golangci/golangci-lint
[kind]:https://kind.sigs.k8s.io/#installation-and-usage
[setup-envtest]:https://book.kubebuilder.io/reference/envtest
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,17 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.37.1 ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.41.1 ;\
}

.PHONY: apidiff
apidiff: go-apidiff ## Run the go-apidiff to verify any API differences compared with origin/master
$(GO_APIDIFF) master --compare-imports --print-compatible --repo-path=.

GO_APIDIFF = $(shell pwd)/bin/go-apidiff
go-apidiff:
@[ -f $(GO_APIDIFF) ] || { \
cd tools && go build -tags=tools -o $(GO_APIDIFF) github.com/joelanford/go-apidiff ;\
}

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

.PHONY: test-unit
TEST_PKGS := ./pkg/... ./test/e2e/utils/...
test-unit: ## Run the unit tests
go test -race -v ./pkg/...
go test -race $(TEST_PKGS)

.PHONY: test-coverage
test-coverage: ## Run unit tests creating the output to report coverage
- rm -rf *.out # Remove all coverage files if exists
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/...
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)

.PHONY: test-integration
test-integration: ## Run the integration tests
Expand Down
6 changes: 3 additions & 3 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ aliases:
# active folks who can be contacted to perform admin-related
# tasks on the repo, or otherwise approve any PRs.
kubebuilder-admins:
- droot
- mengqiy
- pwittrock
- estroz
- camilamacedo86

# non-admin folks who can approve any PRs in the repo
kubebuilder-approvers:
- estroz
- adirio

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

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/kubernetes-sigs/kubebuilder.svg?branch=master)](https://travis-ci.org/kubernetes-sigs/kubebuilder "Travis")
[![Lint](https://github.com/kubernetes-sigs/kubebuilder/actions/workflows/lint.yml/badge.svg)](https://github.com/kubernetes-sigs/kubebuilder/actions/workflows/lint.yml)
[![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)
[![Go Report Card](https://goreportcard.com/badge/sigs.k8s.io/kubebuilder)](https://goreportcard.com/report/sigs.k8s.io/kubebuilder)
[![Coverage Status](https://coveralls.io/repos/github/kubernetes-sigs/kubebuilder/badge.svg?branch=master)](https://coveralls.io/github/kubernetes-sigs/kubebuilder?branch=master)

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

## Philosophy

See [DESIGN.md](DESIGN.md) for the guiding principals of the various KubeBuilder projects.
See [DESIGN.md](DESIGN.md) for the guiding principles of the various KubeBuilder projects.

TL;DR:

Expand Down
2 changes: 1 addition & 1 deletion build/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ builds:
- linux_ppc64le
- darwin_amd64
env:
- KUBERNETES_VERSION=1.19.2
- KUBERNETES_VERSION=1.22.1
- CGO_ENABLED=0

# Only binaries of the form "kubebuilder_${goos}_${goarch}" will be released.
Expand Down
1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func main() {
cli.WithVersion(versionString()),
cli.WithPlugins(
golangv2.Plugin{},
golangv3.Plugin{},
gov3Bundle,
&kustomizecommonv1.Plugin{},
&declarativev1.Plugin{},
Expand Down
Loading

0 comments on commit b7a730c

Please sign in to comment.