Skip to content

Commit

Permalink
Merge branch 'kubernetes-sigs:master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
PG2000 committed May 17, 2024
2 parents 3c1e543 + a6600a1 commit 3b2da55
Show file tree
Hide file tree
Showing 580 changed files with 1,514 additions and 22,669 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.21"
go-version: "~1.22"
- name: Execute go-apidiff
uses: joelanford/go-apidiff@v0.8.2
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.21'
go-version: '~1.22'
- name: Remove pre-installed kustomize
run: sudo rm -f /usr/local/bin/kustomize
- name: Run make test for project-v4-with-deploy-image
Expand All @@ -34,18 +34,18 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.21'
go-version: '~1.22'
- name: Clone the code
uses: actions/checkout@v4
- name: Run linter
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.57
working-directory: testdata/project-v4-with-deploy-image
args: --config .golangci.yml ./...
skip-cache: true # first lint action will handle
- name: Run linter
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.57
working-directory: testdata/project-v4-multigroup-with-deploy-image
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.21'
go-version: '~1.22'
- name: Clone the code
uses: actions/checkout@v4
- name: Run linter
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.57

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '~1.21'
go-version: '~1.22'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-sample-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.21'
go-version: '~1.22'

- name: Create kind cluster
run: kind create cluster
Expand All @@ -26,7 +26,7 @@ jobs:
sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH
sed -i '27s/^#//' $KUSTOMIZATION_FILE_PATH
sed -i '42s/^#//' $KUSTOMIZATION_FILE_PATH
sed -i '46,143s/^#//' $KUSTOMIZATION_FILE_PATH
sed -i '46,142s/^#//' $KUSTOMIZATION_FILE_PATH
- name: Test
run: |
Expand Down
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@v5
with:
go-version: '~1.21'
go-version: '~1.22'
- 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 @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.21'
go-version: '~1.22'
# 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 @@ -52,7 +52,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.22"
- name: Generate the coverage output
run: make test-coverage
- name: Send the coverage output
Expand Down
2 changes: 1 addition & 1 deletion 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.21+.
- [go](https://golang.org/dl/) version v1.22+.
- [docker](https://docs.docker.com/install/) version 17.03+.
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) version v1.11.3+.
- [kustomize](https://github.com/kubernetes-sigs/kustomize/blob/master/site/content/en/docs/Getting%20started/installation.md) v3.1.0+
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ test-e2e-ci: ## Run the end-to-end tests (used in the CI)`

.PHONY: test-book
test-book: ## Run the cronjob tutorial's unit tests to make sure we don't break it
cd ./docs/book/src/cronjob-tutorial/testdata/project && make test
cd ./docs/book/src/component-config-tutorial/testdata/project && make test
# TODO: Uncomment when we bump controller-runtime
# See: https://github.com/kubernetes-sigs/kubebuilder/issues/3917
# cd ./docs/book/src/cronjob-tutorial/testdata/project && make test
cd ./docs/book/src/multiversion-tutorial/testdata/project && make test
cd ./docs/book/src/getting-started/testdata/project && make test

.PHONY: test-license
test-license: ## Run the license check
Expand Down
2 changes: 1 addition & 1 deletion OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ aliases:

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

# 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:
- rashmigottipati
- everettraven
- Kavinjsir

# folks who may have context on ancient history,
# but are no longer directly involved
Expand Down
5 changes: 4 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ as argument the architecture and the SO that should be used, e.g:

For further information see the [README](https://github.com/kubernetes-sigs/kubebuilder/blob/tools-releases/README.md).

### To build the `kube-rbac-proxy` images:
### (Deprecated) - To build the `kube-rbac-proxy` images:

**Note:** We no longer build and promote those images. For more info
see: https://github.com/kubernetes-sigs/kubebuilder/discussions/3907

These images are built from the project [brancz/kube-rbac-proxy](https://github.com/brancz/kube-rbac-proxy).
The projects built with Kubebuilder creates a side container with `kube-rbac-proxy` to protect the Manager.
Expand Down
31 changes: 4 additions & 27 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/cli"
cfgv2 "sigs.k8s.io/kubebuilder/v3/pkg/config/v2"
cfgv3 "sigs.k8s.io/kubebuilder/v3/pkg/config/v3"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin"
kustomizecommonv1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v1"
kustomizecommonv2alpha "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
kustomizecommonv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang"

//nolint:staticcheck
declarativev1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/declarative/v1"
deployimagev1alpha1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/deploy-image/v1alpha1"
golangv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v2"
golangv3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3"
golangv4 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v4"
grafanav1alpha1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/v1alpha"
)
Expand All @@ -43,24 +39,10 @@ func init() {
}

func main() {

const deprecateMessageGoV3Bundle = "This version is deprecated." +
"The `go/v3` cannot scaffold projects using kustomize versions v4x+" +
" and cannot fully support Kubernetes 1.25+." +
"It is recommended to upgrade your project to the latest versions available (go/v4)." +
"Please, check the migration guide to learn how to upgrade your project"

// Bundle plugin which built the golang projects scaffold by Kubebuilder go/v3
gov3Bundle, _ := plugin.NewBundleWithOptions(plugin.WithName(golang.DefaultNameQualifier),
plugin.WithVersion(plugin.Version{Number: 3}),
plugin.WithDeprecationMessage(deprecateMessageGoV3Bundle),
plugin.WithPlugins(kustomizecommonv1.Plugin{}, golangv3.Plugin{}),
)

// Bundle plugin which built the golang projects scaffold by Kubebuilder go/v4 with kustomize alpha-v2
// Bundle plugin which built the golang projects scaffold by Kubebuilder go/v4 with kustomize v2
gov4Bundle, _ := plugin.NewBundleWithOptions(plugin.WithName(golang.DefaultNameQualifier),
plugin.WithVersion(plugin.Version{Number: 4}),
plugin.WithPlugins(kustomizecommonv2alpha.Plugin{}, golangv4.Plugin{}),
plugin.WithPlugins(kustomizecommonv2.Plugin{}, golangv4.Plugin{}),
)

fs := machinery.Filesystem{
Expand All @@ -75,19 +57,14 @@ func main() {
cli.WithCommandName("kubebuilder"),
cli.WithVersion(versionString()),
cli.WithPlugins(
golangv2.Plugin{},
golangv3.Plugin{},
golangv4.Plugin{},
gov3Bundle,
gov4Bundle,
&kustomizecommonv1.Plugin{},
&kustomizecommonv2alpha.Plugin{},
&kustomizecommonv2.Plugin{},
&declarativev1.Plugin{},
&deployimagev1alpha1.Plugin{},
&grafanav1alpha1.Plugin{},
),
cli.WithPlugins(externalPlugins...),
cli.WithDefaultPlugins(cfgv2.Version, golangv2.Plugin{}),
cli.WithDefaultPlugins(cfgv3.Version, gov4Bundle),
cli.WithDefaultProjectVersion(cfgv3.Version),
cli.WithCompletion(),
Expand Down
4 changes: 2 additions & 2 deletions docs/book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ command = "./litgo.sh"
command = "./markerdocs.sh"

[context.environment]
environment = { GO_VERSION = "1.21" }
environment = { GO_VERSION = "1.22" }

[context.deploy-preview.environment]
environment = { GO_VERSION = "1.21" }
environment = { GO_VERSION = "1.22" }

16 changes: 1 addition & 15 deletions docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@

- [Deployment and Testing](./multiversion-tutorial/deployment.md)

- [Tutorial: Component Config](./component-config-tutorial/tutorial.md)

- [Changing things up](./component-config-tutorial/api-changes.md)
- [Defining your Config](./component-config-tutorial/define-config.md)

- [Using a custom type](./component-config-tutorial/custom-type.md)

- [Adding a new Config Type](./component-config-tutorial/config-type.md)
- [Updating main](./component-config-tutorial/updating-main.md)
- [Defining your Custom Config](./component-config-tutorial/define-custom-config.md)

---

- [Migrations](./migrations.md)
Expand Down Expand Up @@ -125,16 +114,13 @@

- [Available Plugins](./plugins/available-plugins.md)
- [To scaffold a project](./plugins/to-scaffold-project.md)
- [go/v2 (Deprecated)](./plugins/go-v2-plugin.md)
- [go/v3 (Deprecated)](./plugins/go-v3-plugin.md)
- [go/v4 (Default init scaffold)](./plugins/go-v4-plugin.md)
- [To add optional features](./plugins/to-add-optional-features.md)
- [declarative/v1 (Deprecated)](./plugins/declarative-v1.md)
- [grafana/v1-alpha](./plugins/grafana-v1-alpha.md)
- [deploy-image/v1-alpha](./plugins/deploy-image-plugin-v1-alpha.md)
- [To be extended for others tools](./plugins/to-be-extended.md)
- [kustomize/v1 (Deprecated)](./plugins/kustomize-v1.md)
- [kustomize/v2](./plugins/kustomize-v2.md)
- [kustomize/v2 (Default init scaffold with go/v4)](./plugins/kustomize-v2.md)
- [Extending the CLI](./plugins/extending-cli.md)
- [Creating your own plugins](./plugins/creating-plugins.md)
- [Testing your own plugins](./plugins/testing-plugins.md)
Expand Down
Loading

0 comments on commit 3b2da55

Please sign in to comment.