Skip to content

Commit 5e1fb9d

Browse files
Bump to Go 1.19, Ginkgo v2 & kubebuilder 3.7.1 (#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>
1 parent 240be20 commit 5e1fb9d

File tree

313 files changed

+1879
-1755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+1879
-1755
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: install
4646
uses: actions/setup-go@v2
4747
with:
48-
go-version: 1.18
48+
go-version: 1.19
4949

5050
- name: gpg init
5151
if: github.event_name != 'pull_request'

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/setup-go@v2
3030
with:
31-
go-version: 1.18
31+
go-version: 1.19
3232
- uses: actions/checkout@v2
3333
with:
3434
fetch-depth: 0

.github/workflows/test-ansible.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/setup-go@v2
3030
with:
31-
go-version: 1.18
31+
go-version: 1.19
3232
- uses: actions/checkout@v2
3333
with:
3434
fetch-depth: 0
@@ -43,7 +43,7 @@ jobs:
4343
steps:
4444
- uses: actions/setup-go@v2
4545
with:
46-
go-version: 1.18
46+
go-version: 1.19
4747
- uses: actions/checkout@v2
4848
with:
4949
fetch-depth: 0

.github/workflows/test-go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
steps:
3232
- uses: actions/setup-go@v2
3333
with:
34-
go-version: 1.18
34+
go-version: 1.19
3535
- uses: actions/checkout@v2
3636
with:
3737
fetch-depth: 0
@@ -46,7 +46,7 @@ jobs:
4646
steps:
4747
- uses: actions/setup-go@v2
4848
with:
49-
go-version: 1.18
49+
go-version: 1.19
5050
- uses: actions/checkout@v2
5151
with:
5252
fetch-depth: 0

.github/workflows/test-helm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/setup-go@v2
3030
with:
31-
go-version: 1.18
31+
go-version: 1.19
3232
- uses: actions/checkout@v2
3333
with:
3434
fetch-depth: 0

.github/workflows/test-sample-go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/setup-go@v2
3030
with:
31-
go-version: 1.18
31+
go-version: 1.19
3232
- uses: actions/checkout@v2
3333
with:
3434
fetch-depth: 0

.github/workflows/test-sanity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/setup-go@v2
3030
with:
31-
go-version: 1.18
31+
go-version: 1.19
3232
id: go
3333
- uses: actions/checkout@v2
3434
with:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
(ansible/v1) Modified ansible scaffolding in order to incorporate
6+
changes with Kubebuilder on `--component-config` flag changes.
7+
Previously, the changes with `--component-config` flag were not
8+
considered by default.
9+
10+
The following are the modifications:
11+
1. If the `--component-config` flag is passed then look for `- /manager`
12+
in `manager.yaml` in order to add leader election id. If the component
13+
config flag is not passed then check for `--leader-elect` flag.
14+
2. In `manager_proxy_patch.yaml` file, look for `memory: 64Mi`
15+
if the component flag is passed flag is passed. If not then look
16+
for `--leader-elect`.
17+
3. Repeat the same logic for replacing the port number from the file.
18+
4. At the end, update the `manager.yaml` file to avoid lint errors.
19+
kind: "change"
20+
breaking: false
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
This PR bumped Kubebuilder to 3.7.1, with this version comes the addition of the `--component-config` flag.
6+
7+
This flag is passed through `operator-sdk init` command.
8+
If this flag is passed through the command line as an argument then only the
9+
`controller_manager_config.yaml` file will be scaffolded in the
10+
manifest.
11+
If it is not passed then it will not scaffold out this file.
12+
The command for passing the flag is:
13+
operator-sdk init --domain example.com --repo github.com/example/memcached-operator --component-config
14+
kind: "change"
15+
breaking: false
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
Modified go version to 1.19 and Kubebuilder to 3.7.1. The `config-gen` is
6+
completely removed from Kubebuilder. As part of this bump, the
7+
website content of SDK was updated where the doc is referring to
8+
`config-gen`.
9+
kind: "change"
10+
breaking: false
11+
migration:
12+
header: Kubebuilder bump brought changes that modified the `Makefile` scaffolding and also `multiarch` chanegs are also included.
13+
body: |
14+
1. Makefile content is updated as shown below.
15+
16+
```sh
17+
`KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out`,
18+
```
19+
20+
2. Add support for building binary in multiple platforms.
21+
22+
Add the below content to the Makefile.
23+
24+
```sh
25+
# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
26+
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
27+
# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
28+
# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
29+
# - 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)
30+
# To properly provided solutions that supports more than one platform you should use this option.
31+
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
32+
.PHONY: docker-buildx
33+
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
34+
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
35+
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
36+
- docker buildx create --name project-v3-builder
37+
docker buildx use project-v3-builder
38+
- docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross
39+
- docker buildx rm project-v3-builder
40+
rm Dockerfile.cross
41+
```
42+
3. (go/v3) Bump dependencies in go.mod file
43+
44+
```go
45+
github.com/onsi/ginkgo/v2 v2.1.4
46+
github.com/onsi/gomega v1.19.0
47+
github.com/prometheus/client_golang v1.12.2
48+
k8s.io/api v0.25.0
49+
k8s.io/apimachinery v0.25.0
50+
k8s.io/client-go v0.25.0
51+
sigs.k8s.io/controller-runtime v0.13.0
52+
```
53+
- description: >
54+
Updated ginkgo to ginkgo/v2 in all of the files.
55+
kind: "change"
56+
breaking: false
57+
- description: >
58+
Updated:
59+
- ginko to `ginko/v2`
60+
- `io/ioutil` packages to either `io` or `os` since its not longer supported in go1.19
61+
kind: "change"
62+
breaking: false

0 commit comments

Comments
 (0)