You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have controller which we upgraded from v1alpha1 to v4 and everything works fine. We changed storageversion in _types.go and now it is in V4.
Everything is working fine but when we are adding new field in _types.go present in v4 and after compilation when we are passing values through yaml to these new field, the value sin controller are coming as empty or null.
What did you expect to see?
Values of the newly added variable must pass to controller.
What did you see instead? Under which circumstances?
Values are not getting passed to controller.
Environment
Operator type:
/language go
Kubernetes cluster type:
$ operator-sdk version
operator-sdk version operator-sdk version: "v1.37.0", commit: "819984d4c1a51c8ff2ef6c23944554148ace0752", kubernetes version: "1.29.0", go version: "go1.21.13", GOOS: "linux", GOARCH: "amd64"
$ go version (if language is Go)
go version go1.23.2 linux/amd64
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.0", GitCommit:"cb303e613a121a29364f75cc67d3d580833a7479", GitTreeState:"clean", BuildDate:"2021-04-08T16:31:21Z", GoVersion:"go1.16.1", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"29", GitVersion:"v1.29.3+2.el8", GitCommit:"5052cd42d1115a389d3fbbc1105dd36c7e4d1cb7", GitTreeState:"clean", BuildDate:"2024-05-15T16:08:37Z", GoVersion:"go1.21.8", Compiler:"gc", Platform:"linux/amd64"} WARNING: version difference between client (1.21) and server (1.29) exceeds the supported minor version skew of +/-1
The text was updated successfully, but these errors were encountered:
I debugged this issue and found that webhook was causing the problem. We had v1apha1 api version and we added the support for apiversion V4. We also had the webhooks for v1alpha1 and v4 but when we are running controllers and created the app object for api version v4, we observed that v1alpha1 webhook is passing the crd instance and somehow the values of the new fields are becoming null.
We now completely switched to the V4 webhooks and removed the default/validation/update/delete webhook from v1alpha1. I am wondering what is the best strategy when users upgrade the api version to handle the webhooks? Is there any documentation in operator-sdk for the same?
Bug Report
What did you do?
We have controller which we upgraded from v1alpha1 to v4 and everything works fine. We changed
storageversion
in _types.go and now it is in V4.Everything is working fine but when we are adding new field in _types.go present in v4 and after compilation when we are passing values through yaml to these new field, the value sin controller are coming as empty or null.
What did you expect to see?
Values of the newly added variable must pass to controller.
What did you see instead? Under which circumstances?
Values are not getting passed to controller.
Environment
Operator type:
/language go
Kubernetes cluster type:
$ operator-sdk version
operator-sdk version operator-sdk version: "v1.37.0", commit: "819984d4c1a51c8ff2ef6c23944554148ace0752", kubernetes version: "1.29.0", go version: "go1.21.13", GOOS: "linux", GOARCH: "amd64"
$ go version
(if language is Go)go version go1.23.2 linux/amd64
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.0", GitCommit:"cb303e613a121a29364f75cc67d3d580833a7479", GitTreeState:"clean", BuildDate:"2021-04-08T16:31:21Z", GoVersion:"go1.16.1", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"29", GitVersion:"v1.29.3+2.el8", GitCommit:"5052cd42d1115a389d3fbbc1105dd36c7e4d1cb7", GitTreeState:"clean", BuildDate:"2024-05-15T16:08:37Z", GoVersion:"go1.21.8", Compiler:"gc", Platform:"linux/amd64"} WARNING: version difference between client (1.21) and server (1.29) exceeds the supported minor version skew of +/-1
The text was updated successfully, but these errors were encountered: