Skip to content

Commit

Permalink
Merge branch 'kubernetes-sigs:master' into sajiyah#2897
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajiyah-Salat committed May 19, 2023
2 parents cd7883e + a6fca17 commit de00a5d
Show file tree
Hide file tree
Showing 643 changed files with 4,942 additions and 20,856 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"
24 changes: 3 additions & 21 deletions .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,20 @@ on:
pull_request:

jobs:
check_docs_only:
name: check_docs_only
runs-on: ubuntu-18.04
outputs:
skip: ${{ steps.check_docs_only.outputs.skip }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: check_docs_only
# Since PR's are squashed prior to merging to the branch checked out (default branch),
# HEAD^ will resolve to the previous point in history.
run: |
REF="HEAD^"
[[ -z "${{ github.base_ref }}" ]] || REF=$(git show-ref ${{ github.base_ref }} | head -1 | cut -d' ' -f2)
echo "::set-output name=skip::$(test/check-docs-only.sh $REF)"
go-apidiff:
name: Verify API differences
runs-on: ubuntu-latest
needs: check_docs_only
# 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) && needs.check_docs_only.outputs.skip != 'true'
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
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:
Expand Down
26 changes: 4 additions & 22 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,16 @@ on:
pull_request:

jobs:
check_docs_only:
name: check_docs_only
runs-on: ubuntu-18.04
outputs:
skip: ${{ steps.check_docs_only.outputs.skip }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: check_docs_only
# Since PR's are squashed prior to merging to the branch checked out (default branch),
# HEAD^ will resolve to the previous point in history.
run: |
REF="HEAD^"
[[ -z "${{ github.base_ref }}" ]] || REF=$(git show-ref ${{ github.base_ref }} | head -1 | cut -d' ' -f2)
echo "::set-output name=skip::$(test/check-docs-only.sh $REF)"
lint:
name: golangci-lint
runs-on: ubuntu-latest
needs: check_docs_only
# 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'
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Setup Go
uses: actions/setup-go@v3
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
Expand All @@ -56,4 +38,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Run yamllint make target
run: make yamllint
run: make yamllint
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v3
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
4 changes: 2 additions & 2 deletions .github/workflows/testdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
- name: Clone the code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
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 Down
11 changes: 1 addition & 10 deletions .github/workflows/unit-tests-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,8 @@ jobs:
- name: Clone the code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
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
Expand Down
29 changes: 5 additions & 24 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,6 @@ on:
pull_request:

jobs:
check_docs_only:
name: check_docs_only
runs-on: ubuntu-18.04
outputs:
skip: ${{ steps.check_docs_only.outputs.skip }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: check_docs_only
# Since PR's are squashed prior to merging to the branch checked out (default branch),
# HEAD^ will resolve to the previous point in history.
run: |
REF="HEAD^"
[[ -z "${{ github.base_ref }}" ]] || REF=$(git show-ref ${{ github.base_ref }} | head -1 | cut -d' ' -f2)
echo "::set-output name=skip::$(test/check-docs-only.sh $REF)"
test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -31,16 +14,15 @@ jobs:
os:
- ubuntu-latest
- macos-latest
needs: check_docs_only
# 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'
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
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
Expand All @@ -61,15 +43,14 @@ jobs:
name: Code coverage
needs:
- test
- check_docs_only
runs-on: ubuntu-latest
# 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'
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: "1.19"
- name: Generate the coverage output
Expand Down
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
8 changes: 4 additions & 4 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 @@ -23,8 +21,10 @@ aliases:
# folks who may have context on ancient history,
# but are no longer directly involved
kubebuilder-emeritus-approvers:
- adirio
- directxman12
- droot
- mengqiy
- estroz
- adirio
- jmrodri
- 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
22 changes: 15 additions & 7 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,23 @@ import (

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.NewBundle(golang.DefaultNameQualifier, plugin.Version{Number: 3},
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 Expand Up @@ -75,7 +83,7 @@ func main() {
),
cli.WithPlugins(externalPlugins...),
cli.WithDefaultPlugins(cfgv2.Version, golangv2.Plugin{}),
cli.WithDefaultPlugins(cfgv3.Version, gov3Bundle),
cli.WithDefaultPlugins(cfgv3.Version, gov4Bundle),
cli.WithDefaultProjectVersion(cfgv3.Version),
cli.WithCompletion(),
)
Expand Down
6 changes: 3 additions & 3 deletions designs/extensible-cli-and-scaffolding-plugins-phase-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ The following scenarios shows what `kubebuilder` will send/receive to the extern
* External plugin to `kubebuilder`:
* The plugin reads the `PluginRequest` through its `stdin` and processes the request based on the `Command` that was sent. If the `Command` doesn't match what the plugin supports, it writes back an error immediately without any further processing. If the `Command` matches what the plugin supports, it constructs a `PluginResponse` containing the `Command` that was executed by the plugin, and modified `Universe` based on the new files that were scaffolded by the external plugin, `Error` and `ErrorMsg` that add any error information, and writes the `PluginResponse` back to `kubebuilder` through `stdout`.

* Note: If `--help` flag is being passed from `kubebuilder` to the external plugin through `PluginRequest`, the plugin attaches its help text information in the `Help` field of the `PluginResponse`. Both `PluginRequest` and `PluginResponse` also contain `APIVersion` field to have compatible versioned schemas.
* Note: If `--help` flag is being passed from `kubebuilder` to the external plugin through `PluginRequest`, the plugin attaches its help text information in the `Metadata` field of the `PluginResponse`. Both `PluginRequest` and `PluginResponse` also contain `APIVersion` field to have compatible versioned schemas.

* Handling plugin failures across the chain:

Expand Down Expand Up @@ -212,9 +212,9 @@ type PluginResponse struct {
// Command holds the command that gets executed by the plugin such as init, create api, etc.
Command string `json:"command"`

// Help contains the plugin specific help text that the plugin returns to kubebuilder when it receives
// Metadata contains the plugin specific help text that the plugin returns to Kubebuilder when it receives
// `--help` flag from Kubebuilder.
Help string `json:"help,omitempty"`
Metadata plugin.SubcommandMetadata `json:"metadata"`

// APIVersion defines the versioned schema of the PluginResponse that will be written back to kubebuilder.
// Initially, this will be marked as alpha (v1alpha1).
Expand Down
2 changes: 1 addition & 1 deletion docs/book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title = "The Kubebuilder Book"
[output.html]
google-analytics = "UA-119864590-1"
curly-quotes = true
additional-css = ["theme/css/markers.css", "theme/css/custom.css"]
additional-css = ["theme/css/markers.css", "theme/css/custom.css", "theme/css/version-dropdown.css"]
git-repository-url = "https://github.com/kubernetes-sigs/kubebuilder"
edit-url-template = "https://github.com/kubernetes-sigs/kubebuilder/edit/master/docs/book/{path}"

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.1
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
2 changes: 1 addition & 1 deletion docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,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
2 changes: 1 addition & 1 deletion docs/book/src/component-config-tutorial/config-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Then, run `make build` to implement the interface for your API type, which would
<h1>Use --controller=false</h1>

You may notice this command from the `CronJob` tutorial although here we
explicity setting `--controller=false` because `ProjectConfig` is not
explicitly setting `--controller=false` because `ProjectConfig` is not
intended to be an API extension and cannot be reconciled.

</aside>
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 Down
Loading

0 comments on commit de00a5d

Please sign in to comment.