Skip to content

Commit

Permalink
updated ginkgo to ginkgo/v2
Browse files Browse the repository at this point in the history
Signed-off-by: laxmikantbpandhare <[email protected]>

updated kb version to get ginkgo/v2 changes

Signed-off-by: laxmikantbpandhare <[email protected]>

added changelog

Signed-off-by: laxmikantbpandhare <[email protected]>

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 <[email protected]>

updated logic

Signed-off-by: laxmikantbpandhare <[email protected]>

updated milecule test

Signed-off-by: laxmikantbpandhare <[email protected]>

removed ginkgo old version and updated ansible molecule test

Signed-off-by: laxmikantbpandhare <[email protected]>

updated the changes with the help of Bryce and Jesus

Signed-off-by: laxmikantbpandhare <[email protected]>

updated manager.yaml removes space

Signed-off-by: laxmikantbpandhare <[email protected]>

removed --component-config=true from webhook testcase as well

Signed-off-by: laxmikantbpandhare <[email protected]>

updated testdata and added changelog with migration guide

Signed-off-by: laxmikantbpandhare <[email protected]>

lint error for header in migration guide

Signed-off-by: laxmikantbpandhare <[email protected]>

added pipe | in changelog
  • Loading branch information
laxmikantbpandhare committed Oct 14, 2022
1 parent ead5efa commit 5d1e0cc
Show file tree
Hide file tree
Showing 313 changed files with 1,859 additions and 1,755 deletions.
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.
Now, this PR made changes that 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.
kind: "change"
breaking: false
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.
```
err = kbutil.InsertCode(
filepath.Join(ma.ctx.Dir, "config", "default", "manager_auth_proxy_patch.yaml"),
"- \"--leader-election-id=advanced-molecule-operator\"",
managerAuthArgs)
```
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.
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. But, in this case, it will add `--leader-elect` to the files to the `manager.yaml` file
kind: "change"
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
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. 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`,
```
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.
```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
```
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.
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.
kind: "change"
breaking: false
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.
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.
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

0 comments on commit 5d1e0cc

Please sign in to comment.