Skip to content

Commit

Permalink
Merge pull request #2952 from kubernetes-sigs/release-3.7
Browse files Browse the repository at this point in the history
📖 Update docs with release 3.7.0
  • Loading branch information
k8s-ci-robot committed Sep 20, 2022
2 parents b60ca27 + 3bfc84e commit 5b33042
Show file tree
Hide file tree
Showing 646 changed files with 6,464 additions and 11,579 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.19"
- name: Execute go-apidiff
uses: joelanford/go-apidiff@v0.2.0
uses: joelanford/go-apidiff@v0.4.0
with:
compare-imports: true
print-compatible: true
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ jobs:
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && needs.check_docs_only.outputs.skip != 'true'
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Clone the code
uses: actions/checkout@v3
- name: Run linter
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: v1.45.2 # Always uses the latest patch version.
version: v1.49 # 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/create-issue-action@v1.1
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release
on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '~1.19'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: v1.11.2
args: release -f ./build/.goreleaser.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: kubebuilder
path: dist/*
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/testdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.18'
go-version: '1.19'
- name: Remove pre-installed kustomize
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.19"
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
- name: Remove pre-installed kustomize
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.19"
- name: Generate the coverage output
run: make test-coverage
- name: Send the coverage output
Expand Down
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ linters-settings:
linters:
disable-all: true
enable:
- deadcode
- dupl
- errcheck
- exportloopref
Expand All @@ -37,12 +36,10 @@ linters:
- prealloc
- revive
- staticcheck
- structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck

run:
deadline: 5m
37 changes: 20 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,28 @@ $ git clone git@github.com:<user>/kubebuilder.git $GOPATH/src/sigs.k8s.io/kubebu

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

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

Following the targets that can be used to test your changes locally.

| Command | Description | Is called in the CI? |
|--- |--- |--- |
| make test-unit | Runs go tests | no |
| make test| Runs tests in shell (`./test.sh`) | yes |
| make lint | Run [golangci][golangci] lint checks | yes |
| make lint-fix | Run [golangci][golangci] to automatically perform fixes | no |
| make test-coverage | Run coveralls to check the % of code covered by tests | yes |
| make check-testdata | Checks if the testdata dir is updated with the latest changes | yes |
| make test-e2e-local | Runs the CI e2e tests locally | no |
| Command | Description | Is called in the CI? |
| ------------------- | ------------------------------------------------------------- | -------------------- |
| make test-unit | Runs go tests | no |
| make test | Runs tests in shell (`./test.sh`) | yes |
| make lint | Run [golangci][golangci] lint checks | yes |
| make lint-fix | Run [golangci][golangci] to automatically perform fixes | no |
| make test-coverage | Run coveralls to check the % of code covered by tests | yes |
| make check-testdata | Checks if the testdata dir is updated with the latest changes | yes |
| make test-e2e-local | Runs the CI e2e tests locally | no |

**NOTE** To use the `make lint` is required to install `golangci-lint` locally. More info: https://github.com/golangci/golangci-lint#install

## PR Process

See [VERSIONING.md](VERSIONING.md) for a full description. TL;DR:
See [VERSIONING.md](VERSIONING.md) for a full description. TL;DR:

Every PR should be annotated with an icon indicating whether it's
a:
Expand All @@ -90,8 +91,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.
2. 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).
3. Check that all scripts used by the CI are defined in the project.
4. Notice that our policy to test the project is to run against k8s version N-2. So that the old version should be removed when there is a new k8s version available.

## How to contribute to docs

Expand All @@ -115,19 +117,20 @@ Check the CI job after to do the Pull Request and then, click on in the `Details
Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/).

You can reach the maintainers of this project at:

- [Slack](http://slack.k8s.io/)
- [Mailing List](https://groups.google.com/forum/#!forum/kubebuilder)

## Becoming a reviewer or approver

Contributors may eventually become official reviewers or approvers in
Kubebuilder and the related repositories. See
Kubebuilder and the related repositories. See
[CONTRIBUTING-ROLES.md](docs/CONTRIBUTING-ROLES.md) for more information.

## Code of conduct

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
[golangci]: https://github.com/golangci/golangci-lint
[kind]: https://kind.sigs.k8s.io/#installation-and-usage
[setup-envtest]: https://book.kubebuilder.io/reference/envtest
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ 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.45.2 ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.49.0 ;\
}

.PHONY: apidiff
Expand Down
3 changes: 2 additions & 1 deletion OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ aliases:

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

# folks who can review and LGTM any PRs in the repo (doesn't include
# approvers & admins -- those count too via the OWNERS file)
kubebuilder-reviewers:
- jmrodri
- joelanford
- rashmigottipati
- everettraven
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ See the [Getting Started](https://book.kubebuilder.io/quick-start.html) document

![Quick Start](docs/gif/kb-demo.v2.0.1.svg)

Also, ensure that you check out the [Deploy Image](https://book.kubebuilder.io/plugins/deploy-image-plugin-v1-alpha.html)
Plugin. This plugin allows users to scaffold API/Controllers to deploy and manage an
Operand (image) on the cluster following the guidelines and best practices. It abstracts the
complexities of achieving this goal while allowing users to customize the generated code.

## Documentation

Check out the Kubebuilder [book](https://book.kubebuilder.io).
Expand Down
11 changes: 7 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ the process was done to ensure that we have an aligned process under the org (si
### Draft a new release from GitHub

1. Create a new tag with the correct version from the new `release-<MAJOR.MINOR>` branch
2. Add the changelog on it and publish. Now, the code source is released !
2. Verify the Release Github Action. It should build the assets and publish in the draft release
3. You also need to manually add the changelog generated above on the release page and publish it. Now, the code source is released !

### Update the website docs (https://book.kubebuilder.io/quick-start.html)

Expand All @@ -38,7 +39,7 @@ the process was done to ensure that we have an aligned process under the org (si

### When the release be done and the website update: Announce the new release:

1. Publish the new release on the Slack channel, i.e:
1. Announce the new release on the Slack channel, i.e:

````
:announce: Kubebuilder v3.5.0 has been released!
Expand All @@ -47,11 +48,13 @@ For more info, see the release page: https://github.com/kubernetes-sigs/kubebuil
:tada: Thanks to all our contributors!
````

2. An announcement email is sent to `kubebuilder@googlegroups.com` with the subject `[ANNOUNCE] Kubebuilder $VERSION is released`
2. Announce the new release via email is sent to `kubebuilder@googlegroups.com` with the subject `[ANNOUNCE] Kubebuilder $VERSION is released`

## What to do if things goes wrong? How to release from my local env as a workaround?

As a workaround we can release from locally by:
As a workaround we can release from locally by:

PS.: _This workaround uses the google cloud. Note that we move the binary CLI release from google cloud to use Github Actions instead_

1. Download google container builder: https://github.com/GoogleCloudPlatform/cloud-build-local
2. Verify that you can use the cloud-build-local CLI tool
Expand Down
2 changes: 1 addition & 1 deletion build/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ steps:
git checkout $${BRANCH_NAME}
git branch --set-upstream-to=origin/$${BRANCH_NAME}
git tag -d ${TAG_NAME}
- name: "goreleaser/goreleaser:v1.9.2"
- name: "goreleaser/goreleaser:v1.11.2"
entrypoint: "bash"
args: ["build/build_kubebuilder.sh"]
env:
Expand Down
2 changes: 1 addition & 1 deletion build/cloudbuild_local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Release tar will be in ./cloudbuild

steps:
- name: "goreleaser/goreleaser:v1.9.2"
- name: "goreleaser/goreleaser:v1.11.2"
entrypoint: "bash"
env: ["SNAPSHOT=1"]
args: ["build/build_kubebuilder.sh"]
2 changes: 1 addition & 1 deletion build/cloudbuild_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Release tar will be in ./cloudbuild

steps:
- name: "goreleaser/goreleaser:v1.9.2"
- name: "goreleaser/goreleaser:v1.11.2"
entrypoint: "bash"
env: ["SNAPSHOT=1"]
args: ["build/build_kubebuilder.sh"]
Expand Down
2 changes: 1 addition & 1 deletion designs/code-generate-image-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ status: implementable
## Summary

This proposal defines a new plugin which allow users get the scaffold with the
required code to have a project that will deploy and manage an image on the cluster following the the guidelines and what have been considered as good practices.
required code to have a project that will deploy and manage an image on the cluster following the guidelines and what have been considered as good practices.

## Motivation

Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
- [controller-gen CLI](./reference/controller-gen.md)
- [completion](./reference/completion.md)
- [Artifacts](./reference/artifacts.md)

- [Platform Support](platform.md)
- [Configuring EnvTest](./reference/envtest.md)

- [Metrics](./reference/metrics.md)
Expand Down
65 changes: 65 additions & 0 deletions docs/book/src/component-config-tutorial/api-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,68 @@ mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), options)
With that out of the way, we can get on to defining our new config!

[tutorial-source]: https://github.com/kubernetes-sigs/kubebuilder/tree/master/docs/book/src/component-config-tutorial/testdata/project

Create the file `/config/manager/controller_manager_config.yaml` with the following content:

```yaml
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
kind: ControllerManagerConfig
health:
healthProbeBindAddress: :8081
metrics:
bindAddress: 127.0.0.1:8080
webhook:
port: 9443
leaderElection:
leaderElect: true
resourceName: ecaf1259.tutorial.kubebuilder.io
# leaderElectionReleaseOnCancel defines if the leader should step down volume
# when the Manager ends. This requires the binary to immediately end when the
# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
# speeds up voluntary leader transitions as the new leader don't have to wait
# LeaseDuration time first.
# In the default scaffold provided, the program ends immediately after
# the manager stops, so would be fine to enable this option. However,
# if you are doing or is intended to do any operation such as perform cleanups
# after the manager stops then its usage might be unsafe.
# leaderElectionReleaseOnCancel: true
```

Update the file `/config/manager/kustomization.yaml` by adding at the bottom the following content:

```yaml
generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: manager-config
files:
- controller_manager_config.yaml
```

Update the file `default/kustomization.yaml` by adding under the patchesStrategicMerge: the following patch:

# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
- manager_config_patch.yaml

Update the file `default/manager_config_patch.yaml` by adding under the spec: the following patch:

```yaml
spec:
template:
spec:
containers:
- name: manager
args:
- "--config=controller_manager_config.yaml"
volumeMounts:
- name: manager-config
mountPath: /controller_manager_config.yaml
subPath: controller_manager_config.yaml
volumes:
- name: manager-config
configMap:
name: manager-config
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.18 as builder
FROM golang:1.19 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.24.1
ENVTEST_K8S_VERSION = 1.25.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -119,7 +119,7 @@ KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/k
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }
test -s $(LOCALBIN)/kustomize || { curl -Ss $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }

.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
Expand Down
Loading

0 comments on commit 5b33042

Please sign in to comment.