-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Managing different versions of CRD in the operator-idk controller #6324
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
Comments
@akularaja In k8s clusters on creation of a resource, the apiserver stores it on a persistent storage called In general, if you have multiple versions, only one should be marked as |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Type of question
General operator-related help
Question
What did you do?
I have setup a new Operator for this CRD called
foo
. I followed the steps in the Go tutorial, so everything with regards to the Controller is the same as in that tutorial.foo
has two versions,v1alpha1
andv2beta1
. There are some drastic changes between these version.v2beta1
has a complete different Spec and Status. Currently, we have another service (another controller that was written from scratch, not using the operator-idk) that operates on thev1alpha
version.I recently added this new
v2beta1
version, and I am in the process of setting up the controller using the operator-idk to reconcile on this version.It seems that the
scheme
,GroupVersion
and all that is setup properly when creating theManager
and setting up the controller.In the Kube cluster, I have two Foo resources created and deployed,
foo1
andfoo2
. The former is av1alpha1
version and the latter isv2beta1
In the
Reconcile
method, when I do the following:It retrieves
foo1
which is ofv1alpha1
version. Another weird thing is that when I doIt prints
v2beta1
.What did you expect to see?
I expect that in the
Reconcile
method, when I do:I only retrieve the
v2beta1
version of thefoo
resources.What did you see instead? Under which circumstances?
I am seeing that my
Get
call is retrieving bothv1alpha1
andv2beta1
versions.Environment
Operator type:
/language go
Kubernetes cluster type:
vanilla
$ operator-sdk version
operator-idk version: "v1.26.0", commit: "cbeec475e4612e19f1047ff7014342afe93f60d2", kubernetes version: "v1.25.0", go version: "go1.19.4", GOOS: "darwin", GOARCH: "arm64"
$ go version
(if language is Go)go version go1.18.10 darwin/arm64
$ kubectl version
Client Version: v1.24.4
Additional context
The text was updated successfully, but these errors were encountered: