Skip to content

Commit

Permalink
(go/v3 and config-gen alpha command) Update controller-runtime dep fr…
Browse files Browse the repository at this point in the history
…om v0.11.2 to v0.12.1
  • Loading branch information
NikhilSharmaWe committed Jun 4, 2022
1 parent c7d57aa commit 98e8df7
Show file tree
Hide file tree
Showing 42 changed files with 303 additions and 336 deletions.
35 changes: 17 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ go 1.17

require (
github.com/cloudflare/cfssl v1.5.0 // for `kubebuilder alpha config-gen`
github.com/gobuffalo/flect v0.2.3
github.com/gobuffalo/flect v0.2.5
github.com/joelanford/go-apidiff v0.1.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.17.0
github.com/onsi/gomega v1.18.1
github.com/sirupsen/logrus v1.8.1
github.com/spf13/afero v1.6.0
github.com/spf13/cobra v1.2.1
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff
k8s.io/apimachinery v0.23.5 // for `kubebuilder alpha config-gen`
sigs.k8s.io/controller-runtime v0.11.2
sigs.k8s.io/controller-tools v0.8.0 // for `kubebuilder alpha config-gen`
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717
k8s.io/apimachinery v0.24.0 // for `kubebuilder alpha config-gen`
sigs.k8s.io/controller-runtime v0.12.1
sigs.k8s.io/controller-tools v0.9.0 // for `kubebuilder alpha config-gen`
sigs.k8s.io/kustomize/kyaml v0.13.6 // for `kubebuilder alpha config-gen`
sigs.k8s.io/yaml v1.3.0
)
Expand All @@ -37,7 +37,6 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/certificate-transparency-go v1.0.21 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
Expand All @@ -62,11 +61,11 @@ require (
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect
github.com/zmap/zcrypto v0.0.0-20200911161511-43ff0ea04f21 // indirect
github.com/zmap/zlint/v2 v2.2.1 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand All @@ -76,11 +75,11 @@ require (
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
k8s.io/api v0.23.5 // indirect
k8s.io/apiextensions-apiserver v0.23.5 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
k8s.io/api v0.24.0 // indirect
k8s.io/apiextensions-apiserver v0.24.0 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
)
125 changes: 66 additions & 59 deletions go.sum

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions pkg/cli/alpha/config-gen/testdata/componentconfig/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -96,12 +90,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
12 changes: 0 additions & 12 deletions pkg/cli/alpha/config-gen/testdata/default/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -96,12 +90,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
12 changes: 0 additions & 12 deletions pkg/cli/alpha/config-gen/testdata/disableauthproxy/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -96,12 +90,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
12 changes: 0 additions & 12 deletions pkg/cli/alpha/config-gen/testdata/enablecertmanager/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -96,12 +90,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ spec:
namespace: simple-system
name: webhook-service
path: /convert
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -105,12 +99,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
12 changes: 0 additions & 12 deletions pkg/cli/alpha/config-gen/testdata/enableprometheus/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -96,12 +90,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
12 changes: 0 additions & 12 deletions pkg/cli/alpha/config-gen/testdata/enablewebhooks/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -96,12 +90,6 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/golang/declarative/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
const (
// kbDeclarativePattern is the sigs.k8s.io/kubebuilder-declarative-pattern version
kbDeclarativePatternForV2 = "v0.0.0-20200522144838-848d48e5b073"
kbDeclarativePatternForV3 = "d0f104b6a96e152043e9c2d76229373a981ac96a"
kbDeclarativePatternForV3 = "fe5be9431eae158f86f9de23000a9a2ec06745fc"
)

var _ plugin.CreateAPISubcommand = &createAPISubcommand{}
Expand Down
20 changes: 13 additions & 7 deletions pkg/plugins/golang/v3/commons.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,39 +94,39 @@ manifests: controller-gen`
}

if err := util.ReplaceInFile("go.mod",
"k8s.io/api v0.23.5",
"k8s.io/api v0.24.0",
"k8s.io/api v0.21.2"); err != nil {
log.Warnf("unable to update the go.mod with k8s.io/api v0.21.2: %s", err)
}

if err := util.ReplaceInFile("go.mod",
"k8s.io/apimachinery v0.23.5",
"k8s.io/apimachinery v0.24.0",
"k8s.io/apimachinery v0.21.2"); err != nil {
log.Warnf("unable to update the go.mod with k8s.io/apimachinery v0.21.2: %s", err)
}

if err := util.ReplaceInFile("go.mod",
"k8s.io/client-go v0.23.5",
"k8s.io/client-go v0.24.0",
"k8s.io/client-go v0.21.2"); err != nil {
log.Warnf("unable to update the go.mod with k8s.io/client-go v0.21.2: %s", err)
}

// During the scaffolding phase, this gets added to go.mod file, running go mod tidy bumps back
// the version from 21.2 to the latest
if err := util.ReplaceInFile("go.mod",
"k8s.io/api v0.23.5",
"k8s.io/api v0.24.0",
"k8s.io/api v0.21.2"); err != nil {
log.Warnf("unable to update the go.mod with k8s.io/api v0.21.2: %s", err)
}

if err := util.ReplaceInFile("go.mod",
"k8s.io/apiextensions-apiserver v0.23.5",
"k8s.io/apiextensions-apiserver v0.24.0",
"k8s.io/apiextensions-apiserver v0.21.2"); err != nil {
log.Warnf("unable to update the go.mod with k8s.io/apiextensions-apiserver v0.21.2: %s", err)
}

if err := util.ReplaceInFile("go.mod",
"k8s.io/component-base v0.23.5",
"k8s.io/component-base v0.24.0",
"k8s.io/component-base v0.21.2"); err != nil {
log.Warnf("unable to update the go.mod with k8s.io/component-base v0.21.2: %s", err)
}
Expand All @@ -145,11 +145,17 @@ manifests: controller-gen`
}

if err := util.ReplaceInFile("go.mod",
"k8s.io/klog/v2 v2.30.0",
"k8s.io/klog/v2 v2.60.1",
"k8s.io/klog/v2 v2.9.0"); err != nil {
log.Warnf("unable to update the go.mod with k8s.io/klog/v2 v2.9.0: %s", err)
}

// Due to some indirect dependency changes with a bump in k8s packages from 0.23.x --> 0.24.x we need to
// clear out all indirect dependencies before we run `go mod tidy` so that the above changes get resolved correctly
if err := util.ReplaceRegexInFile("go.mod", `(require \(\n(\t.* \/\/ indirect\n)+\))`, ""); err != nil {
log.Warnf("unable to update the go.mod indirect dependencies: %s", err)
}

err = util.RunCmd("Update dependencies", "go", "mod", "tidy")
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/golang/v3/scaffolds/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (

const (
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
ControllerRuntimeVersion = "v0.11.2"
ControllerRuntimeVersion = "v0.12.1"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
ControllerToolsVersion = "v0.8.0"
// KustomizeVersion is the kubernetes-sigs/kustomize version to be used in the project
Expand Down
Loading

0 comments on commit 98e8df7

Please sign in to comment.