Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to Go 1.19, Ginkgo v2 & kubebuilder 3.7.1 #6047

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: install
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19

- name: gpg init
if: github.event_name != 'pull_request'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand All @@ -43,7 +43,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand All @@ -46,7 +46,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-sample-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
id: go
- uses: actions/checkout@v2
with:
Expand Down
24 changes: 24 additions & 0 deletions changelog/fragments/ansible-scaffolding-changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Ansible scaffolding got modified in order to incorporate with Kubebuilder `--component-config` flag changes. Previously, it was scaffolding and doing some file changes without considering the `--component-config` flag.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
Now, this PR made changes that will consider the `--component-config` flag and modify the scaffolded file.

laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
1. If the `--component-config` flag is passed then look for `- /manager` in the file in order to add leader election id to the manager.yaml file. If flag is not passed then look for `--leader-elect`.
2. Same logic for manager proxy patch file, look for `memory: 64Mi` if the flag is passed. If a flag is not passed 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.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
kind: "change"
breaking: false
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
migration:
header: this change also modified ansible molecule test that was looking for `--leader-elect` in the file.
body: |
In the advance molecule test, modified code to behave properly with new `--component-config` flag changes.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved

```
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
err = kbutil.InsertCode(
filepath.Join(ma.ctx.Dir, "config", "default", "manager_auth_proxy_patch.yaml"),
"- \"--leader-election-id=advanced-molecule-operator\"",
managerAuthArgs)
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
```
10 changes: 10 additions & 0 deletions changelog/fragments/component-config-changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
This PR bumped Kubebuilder to a newer version and it got the recent PR changes for the `--component-config` flag.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved

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.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
If it is not passed then it will not scaffold out this file. But, in this case, it will add `--leader-elect` to the files to the `manager.yaml` file
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
kind: "change"
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
breaking: false
50 changes: 50 additions & 0 deletions changelog/fragments/ginkgoV2-go-kb-bump-changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Modified go version to 1.19 in all the places and Kubebuilder to k8s 1.25
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
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`.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
kind: "change"
breaking: false
migration:
header: Kubebuilder bump brought changes that modified the `Makefile` scaffolding and also `multiarch` chanegs are also included.
body: |
1. Updated the addTestE2eMaekefileTarget() target where Makefile content is used as below.

```sh
`KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out`,
```
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
2. Kubebuiler bump also added multiple architecture support changes to the Makefile whenre docker buildx is used. This change will support more than one platform.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved

```sh
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
```
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
3. Updated testdata `go.mod` file with the k8s 1.25 depedencies. In the go.mod file, ensure the following depedencies versions and run `go mod tidy`:

```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. The reason behind it is Kubebuilder updated to ginkgo/v2.
These changes raised one issue where the Labels field is used by ginkgo/v2. Same field name is already defined in SDK that was causing the issue. I updated the SDK field Labels to LabelsMap to avoid the issue caused due to the same name.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
kind: "change"
breaking: false
- description: >
Updated all the `io/ioutil` imported package to either `io` or `os`. `io/ioutil` got deprecated in 1.16 and no longer it is used. Updated all the files in SDK.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
kind: "change"
breaking: false
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 13 additions & 0 deletions changelog/fragments/helm-scaffolding-changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Helm scaffolding got modified in order to incorporate with Kubebuilder `--component-config` flag changes. Previously, it was scaffolding and doing some file changes without considering component-config flag.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
Now, this PR made changes which will consider the `--component-config` flag and modify the scaffolded file.

1. If the `--component-config` flag is passed then look for `- /manager` in the file in order to add leader election id to the manager.yaml file. If flag is not passed then look for `--leader-elect`.
2. Same logic for manager proxy patch file, look for `memory: 64Mi` if the flag is passed. If a flag is not passed 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.
laxmikantbpandhare marked this conversation as resolved.
Show resolved Hide resolved
kind: "change"
breaking: false
40 changes: 16 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/operator-framework/operator-sdk

go 1.18
go 1.19

require (
github.com/blang/semver/v4 v4.0.0
Expand All @@ -11,8 +11,8 @@ require (
github.com/kr/text v0.2.0
github.com/markbates/inflect v1.0.4
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.18.1
github.com/onsi/ginkgo/v2 v2.2.0
github.com/onsi/gomega v1.20.2
github.com/operator-framework/api v0.15.1-0.20220624132056-decf74800a17
github.com/operator-framework/helm-operator-plugins v0.0.12-0.20220616200420-1a695cb9f6a1
github.com/operator-framework/java-operator-plugins v0.6.0
Expand All @@ -22,16 +22,16 @@ require (
github.com/prometheus/client_golang v1.12.1
github.com/prometheus/client_model v0.2.0
github.com/sergi/go-diff v1.2.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/afero v1.6.0
github.com/spf13/cobra v1.4.0
github.com/sirupsen/logrus v1.9.0
github.com/spf13/afero v1.9.2
github.com/spf13/cobra v1.5.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.10.0
github.com/stretchr/testify v1.7.1
github.com/stretchr/testify v1.8.0
github.com/thoas/go-funk v0.8.0
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
golang.org/x/text v0.3.7
golang.org/x/tools v0.1.11
golang.org/x/tools v0.1.12
gomodules.xyz/jsonpatch/v3 v3.0.1
helm.sh/helm/v3 v3.9.0
k8s.io/api v0.24.2
Expand All @@ -43,7 +43,7 @@ require (
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
sigs.k8s.io/controller-runtime v0.12.2
sigs.k8s.io/controller-tools v0.9.2
sigs.k8s.io/kubebuilder/v3 v3.6.0
sigs.k8s.io/kubebuilder/v3 v3.7.1-0.20221011212440-eff842a46496
sigs.k8s.io/yaml v1.3.0
)

Expand Down Expand Up @@ -77,13 +77,12 @@ require (
github.com/bugsnag/panicwrap v1.2.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect
github.com/cloudflare/cfssl v1.5.0 // indirect
github.com/containerd/cgroups v1.0.2 // indirect
github.com/containerd/containerd v1.6.3 // indirect
github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.10.1 // indirect
github.com/containerd/ttrpc v1.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/distribution/v3 v3.0.0-20211118083504-a29a3c99a684 // indirect
Expand Down Expand Up @@ -113,7 +112,7 @@ require (
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gobuffalo/envy v1.6.5 // indirect
github.com/gobuffalo/flect v0.2.5 // indirect
github.com/gobuffalo/flect v0.3.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -124,9 +123,8 @@ require (
github.com/gomodule/redigo v1.8.2 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/cel-go v0.10.1 // indirect
github.com/google/certificate-transparency-go v1.0.21 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/go-containerregistry v0.8.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
Expand Down Expand Up @@ -175,7 +173,6 @@ require (
github.com/morikuni/aec v1.0.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
github.com/otiai10/copy v1.2.0 // indirect
Expand All @@ -195,16 +192,13 @@ require (
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/vbatts/tar-split v0.11.2 // indirect
github.com/weppos/publicsuffix-go v0.13.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect
github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940 // indirect
github.com/yvasiyarov/gorelic v0.0.7 // indirect
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20160601141957-9c099fbc30e9 // indirect
github.com/zmap/zcrypto v0.0.0-20200911161511-43ff0ea04f21 // indirect
github.com/zmap/zlint/v2 v2.2.1 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/contrib v0.20.0 // indirect
Expand All @@ -222,13 +216,12 @@ require (
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20220408190544-5352b0902921 // indirect
golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
gomodules.xyz/orderedmap v0.1.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand All @@ -237,10 +230,9 @@ require (
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiserver v0.24.2 // indirect
k8s.io/component-base v0.24.2 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
Expand Down
Loading