Skip to content

New Variables values are not passing to controller after upgrading V1alpha1 to V4 #6904

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

Open
psaini79 opened this issue Feb 12, 2025 · 3 comments
Labels
language/go Issue is related to a Go operator project

Comments

@psaini79
Copy link

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

@openshift-ci openshift-ci bot added the language/go Issue is related to a Go operator project label Feb 12, 2025
@psaini79
Copy link
Author

Please let me know if you need any file or logfile for the review.

@psaini79
Copy link
Author

psaini79 commented Apr 3, 2025

Any pointer or update on this?

@psaini79
Copy link
Author

psaini79 commented Apr 9, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/go Issue is related to a Go operator project
Projects
None yet
Development

No branches or pull requests

1 participant