-
Notifications
You must be signed in to change notification settings - Fork 1.5k
enhance: add support for streaming lists #7190
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
base: main
Are you sure you want to change the base?
Conversation
4b0d5df
to
c0df24d
Compare
Added the Config wiring to enable using this feature. Checking the server for feature gate enablement seems a bit hackish - a raw request against /metrics and then scraping for the feature and a 1 value - so I'd like to just leave this as the only mechanism initially. I would also leave off any built-in mechanism to use a watch list under the covers for a regular list operation. @manusa @rohanKanojia having two similar constructors on Config seems dangerous (it caused me a little trouble here). Are you good with having a static method for the JsonCreator? We can even javadoc that as something that should not be called directly. @csviri is there anything you would like to see done here? |
703d4cc
to
8849767
Compare
Hi @shawkins , look good to me, thank you!
I guess you mean this: It is true that it is hacky, maybe we can experiment with it as the next iteration. Later if this would be enabled on K8S by default could be enabled based on version I guess. Wonder if this listing should be extended by simple list eventually:
That could be also beneficial. |
Using the version would be much preferred. I guess in a rare case you could still disable the feature gate in a late release, so users could still be on the hook for manually toggling the Config value.
To match the current behavior we need to return a typed KubernetesResourceList<T>.
|
The multiple config constructors are there for backwards compatibility and to support autoconfigure. The ConfigXxxTests should verify that the current expectations still work. The static JsonCreator should be a no go since there seems to be users with bizarre uses of Config, it's been a source of trouble for a while. We tried to reduce complexity as much as possible here, but it's the legacy users that have made this impossible to simplify even more. What kind of troubles are you facing? Note there's also SundrioConfig (plus ConfigBuilder and ConfigFluent) that must be changed accordingly for the complete builder functionality to work |
Can you elaborate more the backwards compatibility? Since both need modified anytime a new config item is added, how are they to stay compatible? Do you mean for example that if there is a new config item added that there should be 4 constructors instead of 2?
It relates to the last statement. We have two similar constructors. One with n parameters and one with n+1. If I am using the one with n+1 parameters, and the project adds new constructors to accomodate a new option, there will now either be:
Depending on where in the parameter list the new thing is added there, and whether I'm using typed arguments, my usage of the old n+1 parameter constuctor may either be pointing to the wrong method or may be ambiguous. I also don't see any path where we use a value for shouldSetDefaultValues other than true. Can you elaborate on how that is being used?
I can certainly decouple this change from this pr, but what's here now seems very difficult to maintain.
Can you elaborate on what that would be? Are we supporting subclasses to Config where users want to have their own overridable constructor behavior? Is there an issue / discussion where we could talk about longer run alternatives, such as using some kind of overridable init method method rather than constructors to handle some of this. |
I can't recall exactly the scenarios. Also, it seems that at some point the public constructor wasn't JavaDoced appropriately. Users SHOULD NOT use the Config class constructor. They should rely on the Config builder instead or at most with the static Config creator methods.
No, that shouldn't be the case anymore (that was the case in v6) -however the JavaDoc problem still remains 🤦- At this point, the single constructor should be updated, the SundrioConfig, ConfigBuilder and ConfigFluent should be updated too.
We should only have a single public constructor for Config, all Config instances should be created via builders or static methods. This is probably the confusing part, likely because I didn't update the JavaDoc 😓
I really can't recall at the moment, there should definitely be a test to verify this.
Yes, OpenShiftConfig is one example.
new ConfigBuilder().withWhatever().build() should be the approach, Config should really remain hidden from the users. |
See if #7204 will work for you. |
This seems to simplify things on the Config class by setting all the fields in the base Sundrio class. From my side, I'm fine. It doesn't seem to break anything so feel free to mark it as ready and I'll merge |
@manusa rebased to pick up the config changes. |
1ea3cc4
to
be3ac49
Compare
closes: fabric8io#5081 Signed-off-by: Steve Hawkins <[email protected]>
Adds support for informers to use watch / streaming lists. This is currently enabled via Reflector.setStreamingList
TODO:
I'm leaning toward doing the latter two and not doing this automatically for now.
additional validation
If you set a Limit or other continuation related fields it will simply be ignored- I don't think we have to take responsiblity for thisother api methods, see Add support for informer watching without pagination #5081 (comment)
closes: #5081
Description
Type of change
test, version modification, documentation, etc.)
Checklist