Skip to content

Commit

Permalink
Merge branch 'master' into steve/fix-extending-cli-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sklarsa committed Jul 8, 2023
2 parents 3f106fa + 141bb6c commit da53ed5
Show file tree
Hide file tree
Showing 310 changed files with 5,167 additions and 5,921 deletions.
9 changes: 8 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
# Workflow files stored in the
Expand Down Expand Up @@ -47,3 +46,11 @@ updates:
directory: "testdata/project-v4"
schedule:
interval: "weekly"

# Maintain dependencies for go in external plugin sample
- package-ecosystem: "gomod"
directory: "docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1"
schedule:
interval: "weekly"
labels:
- "ok-to-test"
11 changes: 1 addition & 10 deletions .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,9 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.19"
go-version: '~1.20'
- name: Execute go-apidiff
uses: joelanford/go-apidiff@v0.6.0
with:
compare-imports: true
print-compatible: true
- name: Report failure
uses: nashmaniac/create-issue-action@v1.1
# 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 }}
11 changes: 1 addition & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,14 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '~1.20'
- name: Clone the code
uses: actions/checkout@v3
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
only-new-issues: true # Show only new issues if it's a pull request
- name: Report failure
uses: nashmaniac/create-issue-action@v1.1
# 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: 🐛 Lint failed for ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: kind/bug
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

yamllint:
runs-on: ubuntu-latest
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@v4
with:
go-version: '~1.19'
go-version: '~1.20'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
11 changes: 1 addition & 10 deletions .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@v4
with:
go-version: '1.19'
go-version: '~1.20'
- 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 All @@ -27,12 +27,3 @@ jobs:
run: make check-testdata
- name: Verify docs update
run: make check-docs
- name: Report failure
uses: nashmaniac/create-issue-action@v1.1
# 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: 🐛 Testadata verification failed for ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: kind/bug
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
18 changes: 0 additions & 18 deletions .github/workflows/unit-tests-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,10 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
# the go/v2 cannot be updated and is scaffold with golang 1.13
# (version used by its dep version of the controller-runtime)
# however, we are unable to downgrade the version here
# because we will face errors
# So we are keeping the latest version where it works
# and highlighting that must be fixed
# Therefore, we probably will deprecate go/v2 soon since we cannot upgrade it
# to use the versions of controller-runtime > v0.9
# and controller-tools > v0.6 as k8s > 1.21 then it might not be valid we spend effort on this fix
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
run: sudo rm -f /usr/local/bin/kustomize
- name: Perform the test
run: make test-legacy
- name: Report failure
uses: nashmaniac/create-issue-action@v1.1
# 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: 🐛 Unit tests failed on ${{ matrix.os }} for ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: kind/bug
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
13 changes: 2 additions & 11 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.19"
go-version: '~1.20'
# 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
run: sudo rm -f /usr/local/bin/kustomize
- name: Perform the test
run: make test
- name: Report failure
uses: nashmaniac/create-issue-action@v1.1
uses: nashmaniac/create-issue-action@v1.2
# 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:
Expand Down Expand Up @@ -59,12 +59,3 @@ jobs:
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage-all.out
- name: Report failure
uses: nashmaniac/create-issue-action@v1.1
# 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: 🐛 Coverage report failed for ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: kind/bug
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ issues:
exclude-rules:
- linters: [gosec]
path: "test/e2e/*"
- path: "hack/docs/*"
linters:
- lll
- gosec

linters-settings:
govet:
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.16+.
- [go](https://golang.org/dl/) version v1.20+.
- [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
10 changes: 5 additions & 5 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ aliases:
# active folks who can be contacted to perform admin-related
# tasks on the repo, or otherwise approve any PRs.
kubebuilder-admins:
- pwittrock
- camilamacedo86
- jmrodri
- varshaprasad96

# non-admin folks who can approve any PRs in the repo
Expand All @@ -15,16 +13,18 @@ aliases:
# 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:
- joelanford
- rashmigottipati
- everettraven
- Kavinjsir

# folks who may have context on ancient history,
# but are no longer directly involved
kubebuilder-emeritus-approvers:
- adirio
- directxman12
- droot
- mengqiy
- estroz
- adirio
- jmrodri
- joelanford
- mengqiy
- pwittrock
2 changes: 1 addition & 1 deletion build/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ builds:
- darwin_amd64
- darwin_arm64
env:
- KUBERNETES_VERSION=1.26.1
- KUBERNETES_VERSION=1.27.1
- CGO_ENABLED=0

# Only binaries of the form "kubebuilder_${goos}_${goarch}" will be released.
Expand Down
15 changes: 7 additions & 8 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,16 @@ func main() {
"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.NewBundle(golang.DefaultNameQualifier, plugin.Version{Number: 3},
deprecateMessageGoV3Bundle,
kustomizecommonv1.Plugin{},
golangv3.Plugin{},
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
gov4Bundle, _ := plugin.NewBundle(golang.DefaultNameQualifier, plugin.Version{Number: 4},
"",
kustomizecommonv2alpha.Plugin{},
golangv4.Plugin{},
gov4Bundle, _ := plugin.NewBundleWithOptions(plugin.WithName(golang.DefaultNameQualifier),
plugin.WithVersion(plugin.Version{Number: 4}),
plugin.WithPlugins(kustomizecommonv2alpha.Plugin{}, golangv4.Plugin{}),
)

fs := machinery.Filesystem{
Expand Down
2 changes: 1 addition & 1 deletion docs/book/install-and-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ${cmd} /tmp/mdbook.${ext}
chmod +x /tmp/mdbook

echo "grabbing the latest released controller-gen"
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.3
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.0

# make sure we add the go bin directory to our path
gobin=$(go env GOBIN)
Expand Down
3 changes: 2 additions & 1 deletion docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@

- [Generating CRDs](./reference/generating-crd.md)
- [Using Finalizers](./reference/using-finalizers.md)
- [Raising Events](./reference/raising-events.md)
- [Watching Resources](./reference/watching-resources.md)
- [Resources Managed by the Operator](./reference/watching-resources/operator-managed.md)
- [Externally Managed Resources](./reference/watching-resources/externally-managed.md)
Expand Down Expand Up @@ -124,7 +125,7 @@
- [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-alpha](./plugins/kustomize-v2-alpha.md)
- [kustomize/v2](./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
12 changes: 12 additions & 0 deletions docs/book/src/component-config-tutorial/api-changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changing things up

<aside class="note warning">
<h1>Component Config is deprecated</h1>

The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
Moreover, it has undergone breaking changes and is no longer functioning as intended.
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).

Please, be aware that it will force Kubebuilder remove this option soon in future release.

</aside>

This tutorial will show you how to create a custom configuration file for your
project by modifying a project generated with the `--component-config` flag
passed to the `init` command. The full tutorial's source can be found
Expand Down
12 changes: 12 additions & 0 deletions docs/book/src/component-config-tutorial/config-type.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Adding a new Config Type

<aside class="note warning">
<h1>Component Config is deprecated</h1>

The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
Moreover, it has undergone breaking changes and is no longer functioning as intended.
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).

Please, be aware that it will force Kubebuilder remove this option soon in future release.

</aside>

To scaffold out a new config Kind, we can use `kubebuilder create api`.

```bash
Expand Down
12 changes: 12 additions & 0 deletions docs/book/src/component-config-tutorial/custom-type.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Using a Custom Type

<aside class="note warning">
<h1>Component Config is deprecated</h1>

The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
Moreover, it has undergone breaking changes and is no longer functioning as intended.
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).

Please, be aware that it will force Kubebuilder remove this option soon in future release.

</aside>

<aside class="note warning">

<h1>Built-in vs Custom Type</h1>
Expand Down
12 changes: 12 additions & 0 deletions docs/book/src/component-config-tutorial/define-config.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Defining your Config

<aside class="note warning">
<h1>Component Config is deprecated</h1>

The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
Moreover, it has undergone breaking changes and is no longer functioning as intended.
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).

Please, be aware that it will force Kubebuilder remove this option soon in future release.

</aside>

Now that you have a component config base project we need to customize the
values that are passed into the controller, to do this we can take a look at
`config/manager/controller_manager_config.yaml`.
Expand Down
12 changes: 12 additions & 0 deletions docs/book/src/component-config-tutorial/define-custom-config.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Defining your Custom Config

<aside class="note warning">
<h1>Component Config is deprecated</h1>

The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
Moreover, it has undergone breaking changes and is no longer functioning as intended.
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).

Please, be aware that it will force Kubebuilder remove this option soon in future release.

</aside>

Now that you have a custom component config we change the
`config/manager/controller_manager_config.yaml` to use the new GVK you defined.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
# Ignore build and test binaries.
bin/
testbin/
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
*.dll
*.so
*.dylib
bin
testbin/*
bin/*
Dockerfile.cross

# Test binary, build with `go test -c`
Expand All @@ -21,6 +20,7 @@ Dockerfile.cross

# editor and IDE paraphernalia
.idea
.vscode
*.swp
*.swo
*~
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
Loading

0 comments on commit da53ed5

Please sign in to comment.