forked from operator-framework/operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump to Go 1.19, Ginkgo v2 & kubebuilder 3.7.1 (operator-framework#6047)
* updated ginkgo to ginkgo/v2 Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> updated kb version to get ginkgo/v2 changes Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> added changelog Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> By() cleause used outside and it was throwing error updated go.mod depedencies too many arguments InstallCertManager and UnInstallCertManager update kb go.mod updated --leader-elec skip in the changes kb changes fort envtest updated testdata update go version 1.19 and component config added to moulecule test updated go version in github actions and docker sdk images updated io/ioutil updated all io/ioutil to io or os as it is deprecated modified code for component config check modified code for component config check resolve conflicts make generate updated Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> updated logic Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> updated milecule test Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> removed ginkgo old version and updated ansible molecule test Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> updated the changes with the help of Bryce and Jesus Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> updated manager.yaml removes space Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> removed --component-config=true from webhook testcase as well Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> updated testdata and added changelog with migration guide Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> lint error for header in migration guide Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> added pipe | in changelog * modified changelog Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com> Signed-off-by: laxmikantbpandhare <laxmikantpandhare@gmail.com>
- Loading branch information
1 parent
240be20
commit 5e1fb9d
Showing
313 changed files
with
1,879 additions
and
1,755 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# entries is a list of entries to include in | ||
# release notes and/or the migration guide | ||
entries: | ||
- description: > | ||
(ansible/v1) Modified ansible scaffolding in order to incorporate | ||
changes with Kubebuilder on `--component-config` flag changes. | ||
Previously, the changes with `--component-config` flag were not | ||
considered by default. | ||
The following are the modifications: | ||
1. If the `--component-config` flag is passed then look for `- /manager` | ||
in `manager.yaml` in order to add leader election id. If the component | ||
config flag is not passed then check for `--leader-elect` flag. | ||
2. In `manager_proxy_patch.yaml` file, look for `memory: 64Mi` | ||
if the component flag is passed flag is passed. If not then look | ||
for `--leader-elect`. | ||
3. Repeat the same logic for replacing the port number from the file. | ||
4. At the end, update the `manager.yaml` file to avoid lint errors. | ||
kind: "change" | ||
breaking: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# entries is a list of entries to include in | ||
# release notes and/or the migration guide | ||
entries: | ||
- description: > | ||
This PR bumped Kubebuilder to 3.7.1, with this version comes the addition of the `--component-config` flag. | ||
This flag is passed through `operator-sdk init` command. | ||
If this flag is passed through the command line as an argument then only the | ||
`controller_manager_config.yaml` file will be scaffolded in the | ||
manifest. | ||
If it is not passed then it will not scaffold out this file. | ||
The command for passing the flag is: | ||
operator-sdk init --domain example.com --repo github.com/example/memcached-operator --component-config | ||
kind: "change" | ||
breaking: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# entries is a list of entries to include in | ||
# release notes and/or the migration guide | ||
entries: | ||
- description: > | ||
Modified go version to 1.19 and Kubebuilder to 3.7.1. The `config-gen` is | ||
completely removed from Kubebuilder. As part of this bump, the | ||
website content of SDK was updated where the doc is referring to | ||
`config-gen`. | ||
kind: "change" | ||
breaking: false | ||
migration: | ||
header: Kubebuilder bump brought changes that modified the `Makefile` scaffolding and also `multiarch` chanegs are also included. | ||
body: | | ||
1. Makefile content is updated as shown below. | ||
```sh | ||
`KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out`, | ||
``` | ||
2. Add support for building binary in multiple platforms. | ||
Add the below content to the Makefile. | ||
```sh | ||
# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple | ||
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to: | ||
# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/ | ||
# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/ | ||
# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=<myregistry/image:<tag>> than the export will fail) | ||
# To properly provided solutions that supports more than one platform you should use this option. | ||
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le | ||
.PHONY: docker-buildx | ||
docker-buildx: test ## Build and push docker image for the manager for cross-platform support | ||
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile | ||
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross | ||
- docker buildx create --name project-v3-builder | ||
docker buildx use project-v3-builder | ||
- docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross | ||
- docker buildx rm project-v3-builder | ||
rm Dockerfile.cross | ||
``` | ||
3. (go/v3) Bump dependencies in go.mod file | ||
```go | ||
github.com/onsi/ginkgo/v2 v2.1.4 | ||
github.com/onsi/gomega v1.19.0 | ||
github.com/prometheus/client_golang v1.12.2 | ||
k8s.io/api v0.25.0 | ||
k8s.io/apimachinery v0.25.0 | ||
k8s.io/client-go v0.25.0 | ||
sigs.k8s.io/controller-runtime v0.13.0 | ||
``` | ||
- description: > | ||
Updated ginkgo to ginkgo/v2 in all of the files. | ||
kind: "change" | ||
breaking: false | ||
- description: > | ||
Updated: | ||
- ginko to `ginko/v2` | ||
- `io/ioutil` packages to either `io` or `os` since its not longer supported in go1.19 | ||
kind: "change" | ||
breaking: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# entries is a list of entries to include in | ||
# release notes and/or the migration guide | ||
entries: | ||
- description: > | ||
(helm/v1) Modified helm scaffolding in order to incorporate changes | ||
with Kubebuilder on `--component-config` flag changes. Previously, | ||
the changes with `--component-config` flag were not considered by | ||
default. | ||
The following are the modifications: | ||
1. If the `--component-config` flag is passed then look for `- /manager` | ||
in `manager.yaml` in order to add leader election id. If the component | ||
config flag is not passed then check for `--leader-elect` flag. | ||
2. In `manager_proxy_patch.yaml` file, look for `memory: 64Mi` | ||
if the component flag is passed flag is passed. If not then look | ||
for `--leader-elect`. | ||
3. Repeat the same logic for replacing the port number from the file. | ||
4. At the end, update the `manager.yaml` file to avoid lint errors. | ||
kind: "change" | ||
breaking: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.