Skip to content
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

[fluxv2] Add defaultUpgradePolicy in the Fluxv2 #4424

Closed
antgamdia opened this issue Mar 15, 2022 · 7 comments · Fixed by #4456
Closed

[fluxv2] Add defaultUpgradePolicy in the Fluxv2 #4424

antgamdia opened this issue Mar 15, 2022 · 7 comments · Fixed by #4456
Assignees
Labels
component/plugin-flux Issue related to kubeapps plugin to manage Helm charts via Flux kind/feature An issue that reports a feature (approved) to be implemented
Projects

Comments

@antgamdia
Copy link
Contributor

Description:

As per the offline discussion we had, a short-term solution for allowing passing the version selection in Flux v2 would be just allowing the Fluxv2 to be configured with a plugin-wide config as we were doing in Carvel (see #4346 (comment))

Later on, we can start discussing long-term solutions like #4365, but it is not a priority right now, as the community's feedback is that this version selection is not extensively being used out there, so just adding a plugin-wide option would be enough for now.

@antgamdia antgamdia added kind/feature An issue that reports a feature (approved) to be implemented priority/medium component/plugin-flux Issue related to kubeapps plugin to manage Helm charts via Flux labels Mar 15, 2022
@antgamdia antgamdia added this to Committed in Kubeapps Mar 15, 2022
@gfichtenholt
Copy link
Contributor

Hi, I have a follow-up question:
Flux plugin implements a core API, like CreateInstalledPackage, where the caller may pass, among other things, a version reference. ref https://github.com/kubeapps/kubeapps/blob/90f135c82868a9c2599469eef9e3a0b03ac718d3/cmd/kubeapps-apis/proto/kubeappsapis/core/packages/v1alpha1/packages.proto#L826.
Let's say for the sake of argument the caller sends in a version reference that is not a specific version but rather looks like a semver expression: ">5 <9". That is a perfectly legal version semver expression. Let's also suppose the defaultUpgradePolicy for the plugin happens to be set to "minor". Based on looking at what carvel plugin currently does and what we'd expect from flux I think the result persisted in the CR will be something like ">=5.0.0 <6.0.0" which is very different from what the caller intended. If I have misunderstood something please point it out. Thanks

@absoludity
Copy link
Contributor

absoludity commented Mar 16, 2022

Curerntly the Kubeapps UI does not allow specifying a semver expression at all - how we deal with that when it does is more related to #4346 . Rather, the UX currently always sends the exact version. The carvel plugin currently assumes this and uses it together with the defaultUpgradePolicy to set the result in the CR (as in versionConstraintWithUpgradePolicy )

I think it's fine for the flux plugin to also assume this for now (ie. that it will currently receive a specific version). I realise you're not thinking about the Kubeapps UX specifically, so are thinking what it should do as an API right now, but that's exactly what we're currently deferring to #4346, AIUI. In fact, I'd say feel free to respond with a bad request, or unimplemented, if it's not, just to be explicit about this assumption in the code, until we work on #4346 .

That's my understanding. Is that what you would expect @antgamdia ?

@gfichtenholt
Copy link
Contributor

gfichtenholt commented Mar 16, 2022

Wow. Was very careful avoid any mention of current UI. I have a general purpose server that implements an API. Current kubeapps UI is just one caller. My question was really about the API semantics.
Can't really respond with an error, I have integration tests (i.e. another kind of client) that rely on this feature to test automatic flux upgrades, though I suppose I could now re-write these tests to use the defaultUpgradePolicy feature to do what I need...

@absoludity
Copy link
Contributor

Wow. Was very careful avoid any mention of current UI. I have a general purpose server that implements an API. Current kubeapps UI is just one caller. My question was really about the API semantics.

Yeah, I realise. The kubeapps-apis service has been designed so it can be used by other clients, but we do try to be pragmatic about ensuring we support the current Kubeapps UX as a priority.

Can't really respond with an error, I have integration tests (i.e. another kind of client) that rely on this feature to test automatic flux upgrades, though I suppose I could now re-write these tests to use the defaultUpgradePolicy feature to do what I need...

That's fine - I just meant you could do that if it's easier for you to focus on what we need now. But if you've already written integration tests where the received version reference can be an expression, I don't see an issue with it. In that case, I'd assume that if the version expression received by the server is already an expression, then you use it as is. The defaultUpgradePolicy is only relevant while our main client doesn't yet expose expressions, nor is it a priority to do so right now based on recent community feedback.

@gfichtenholt
Copy link
Contributor

gfichtenholt commented Mar 16, 2022

Oh ok. Would it be acceptable then if I see on the server side that the requested version happens to be a semver expression to ignore the default Upgrade policy in that case?

@absoludity
Copy link
Contributor

Yes, exactly.

@gfichtenholt
Copy link
Contributor

Yes, exactly.

👍

gfichtenholt added a commit to gfichtenholt/kubeapps that referenced this issue Mar 17, 2022
Kubeapps automation moved this from Committed to Done Mar 17, 2022
gfichtenholt added a commit that referenced this issue Mar 17, 2022
* attempt #2

* fix for [fluxv2] Add defaultUpgradePolicy in the Fluxv2 #4424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/plugin-flux Issue related to kubeapps plugin to manage Helm charts via Flux kind/feature An issue that reports a feature (approved) to be implemented
Projects
No open projects
Kubeapps
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants