-
Notifications
You must be signed in to change notification settings - Fork 607
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
RealtimeAPI CRD #2366
base: master
Are you sure you want to change the base?
RealtimeAPI CRD #2366
Conversation
…s in the cortex operator
pkg/crds/controllers/serverless/realtimeapi_controller_helpers.go
Outdated
Show resolved
Hide resolved
We should also confirm the following 2 things:
|
# Conflicts: # cli/cmd/lib_apis.go # cli/cmd/lib_async_apis.go # cli/cmd/lib_realtime_apis.go # pkg/activator/helpers.go # pkg/operator/resources/asyncapi/api.go # pkg/operator/resources/asyncapi/status.go # pkg/operator/resources/realtimeapi/api.go # pkg/operator/resources/realtimeapi/status.go # pkg/operator/resources/resources.go # pkg/operator/schema/schema.go # pkg/types/spec/api.go # pkg/types/status/status.go
You removed the kubebuilder default annotations I had. Those were intentional and necessary for the controller to work well. Please revert |
@miguelvr the Kubebuilder default annotations were removed for a good reason. With them in there, there was a decent chance that if the user had set a value to 0 (say And couldn't just double-comment them because they would then appear in the description of each field, which is also bad. They are definitely necessary if we weren't to have the CLI/operator and if the user were to create the RealtimeAPI resource(s) directly, yes. But until then, I'm not seeing a good reason for having them around, not as long as they also break the functionality. The controller seems to be working well, no issues with it (as of this moment). Where are these annotations required? |
There's no chance the user has to set anything because the operator defaults everything. By removing them, the controller does not work properly without the operator. This is not good for different reasons, but the main one is development. I spent quite a while figuring out the correct defaulting scheme |
Sure, the operator defaults, but that doesn't matter as long as it still sets the value to zero (whichever field that is). The outcome is that the functionality is broken. It just doesn't work. Tested it and it fails.
Where exactly does the controller not work properly? I have tested it and it seems to work well. Could you please provide a granular explanation as to where this is required?
Don't see why they would be required as long as we don't do require the users to create their realtimeapi deployments directly. Could you expand on this one? Pertaining to the above paragraph, we concluded last night that we wouldn't be expecting the user to create a realtimeapi resource directly using a subset of the available fields in the api spec. We expect the operator to be the sole creator of these resources (for now). This becomes important only when we'd expect the user to do this (i.e. if we were to remove the operator/cli). |
The controller is 100% independent from the "cortex operator" it shouldn't rely on specific defaults to be set. Therefore it needs to work by applying a Kubernetes manifest. This is how the development of the controller should look like. If there are no proper defaults set, the controller will try to access stuff that is expected to be set and it will lead to nil pointer dereferences. Tried this and saw it failing. Whatever you saw failing, it needs to be fixed with the correct annotations, not by removing all the defaulting ones |
In the case of zeros being allowed, then a pointer should be used to avoid the defaulting. |
checklist:
make test
andmake lint