-
Notifications
You must be signed in to change notification settings - Fork 706
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
fix(upgrade): Fetch package from its installed cluster #3525
fix(upgrade): Fetch package from its installed cluster #3525
Conversation
@@ -81,6 +81,8 @@ function UpgradeForm({ | |||
|
|||
const { availablePackageDetail, versions, schema, values, pkgVersion } = selected; | |||
|
|||
const packageCluster = availablePackageDetail?.availablePackageRef?.context?.cluster; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is a child component depending upon the AppUpgrade
view, I wonder whether we should get perform the changes in the view instead.
Given that a UpgradeForm
will always be rendered if the app
is defined, why not reducing the number of attributes being passed to this component?
But, perhaps we can just add this simple change and later on, review all the namespace/cluster being passed through. (I've added a note in our project board for having a discussion about it)
Also, the tests are failing, I think (not the e2e, but the dashboard_test).
As usual, thanks a lot for contributing to Kubeapps!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay interesting, yeah maybe putting it in the parent component would be best. I can give it another one over when I fix the tests.
cc676bc
to
3cc30a4
Compare
@aanthonyrizzo @antgamdia so looking at our {
"kubeappsCluster": "",
"kubeappsNamespace": "kubeapps",
"appVersion": "v2.3.4",
"authProxyEnabled": true,
"oauthLoginURI": "/",
"oauthLogoutURI": "/",
"authProxySkipLoginPage": true,
"featureFlags": {"invalidateCache":true,"kubeappsAPIsServer":true},
"clusters": ["default"],
"theme": "dark",
"remoteComponentsUrl": "https://cloud.coreweave.com/static/6befb660ea1eeca2b5e78d452e4a52d9b51aca5e.kubeapps.bundle.js"
} |
You're right. "Global cluster" (perhaps not the best word for it) stands for "the cluster on which Kubeapps is installed". This value is calculated here [1] (that is, the cluster configured without a cluster URL or the one marked with This is my local config, for example: appVersion: "DEVEL"
authProxyEnabled: false
authProxySkipLoginPage: false
clusters: ["default"]
customAppViews: []
kubeappsCluster: "default"
kubeappsNamespace: "kubeapps"
oauthLoginURI: "/oauth2/start"
oauthLogoutURI: "/oauth2/sign_out"
remoteComponentsUrl: ""
theme: "light" [1] https://github.com/kubeapps/kubeapps/blob/master/chart/kubeapps/templates/_helpers.tpl#L139 |
hey @antgamdia just FYI |
Nice so #3525 should be good to go now, hopefully that can get merged quickly @antgamdia - thanks for chiming in here! |
Awesome! Thanks for fixing it. Even if we try our best to test and ensure everything is working as expected, with this UI revamp to support multiple plugins we have still to polish up some edge cases. Also FYI, our CI ("just" the e2e tests) is failing right now. This matter needs to be discussed (more info at #3526), meaning the PR merge process (and the release 2.4.1) has to be postponed to the next week (Michael is on PTO this week). |
Yeah I've been poking around and I think there are a few places were some things can be refactored/cleaned up (possibly just renaming some variables and such). It also seems like there is some duplicated data which might be muddying the source of truth and causing some of these little edge case issues.
Okay awesome thank you for the update. Let me know if theres anything else I can do. (also not sure why but it seems its trying to push my images causing my tests to fail) |
6838601
to
ef65b23
Compare
ef65b23
to
6838601
Compare
6838601
to
60ef713
Compare
60ef713
to
6838601
Compare
@@ -75,7 +75,10 @@ function AppUpgrade() { | |||
dispatch( | |||
actions.charts.getDeployedChartVersion( | |||
{ | |||
context: { cluster: cluster, namespace: repoNamespace ?? "" }, | |||
context: { | |||
cluster: app?.availablePackageRef?.context?.cluster ?? cluster, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Anthony. Yes, this should definitely be defaulting to the cluster of the available package, rather than the cluster of the installed app. +1 from me. Is the other discussion below resolved Antonio?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, everything is ready to go, I think. Indeed, given how messy the upgrade view was becoming I gave it a shot and try to perform some improvements (#3540).
However, the scope of the change is much bigger and I don't think we should release with my PR, but with this simpler and laser-focus one.
Let me jump in and merge the latest changes in the main branch (which hopefully should fix the CI tests...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@antgamdia that PR is def gonna be a good improvement. There are a lot of rerenders that end up going all the way down the chain and they could be optimized and improve the performance of the page for sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of rerenders that end up going all the way down the chain
Yeah... in fact we have been facing some CI issues because of that (the dropdown was being re-rendered multiple times making our e2e engine chose the wrong version)
Let me jump in and merge the latest changes in the main branch (which hopefully should fix the CI tests...)
I've tried but no permissions to edit this PR, I think. Please, @aanthonyrizzo, pull the latest changes in master
and merge them into your branch. Let's see if tomorrow we can start tagging a release :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AH. Sorry we changed the ownership of the repo from my user to our organization. I just rebased so should be up to date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, perhaps it is why the CI is failing when building the images? Not sure, but maybe we should create another PR from this repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that could be. I'm going to be away for a bit but feel free to cherry pick the commits into another branch and merge :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, don't know, re-triggering it made the trick. CI things...
Merging! Thanks again for the contributions :)
6838601
to
7fec7dd
Compare
Description of the change
This PR addresses (what I think is a bug) regarding the fetching of Packages when upgrading.
Current behavior
When navigating to the upgrade form for deployments that are installed in the
"default"
cluster. The upgrade form fails to fetch the applicable package details if it is looking in the wrong cluster.New behavior
When fetching the package details, we use the cluster that is defined in the
AvailablePackageDetail
property when fetching the package. This should lead to correct fetching behavior.Benefits
Global packages that are installed in the
""
cluster but are deployed in the"default"
can now be upgraded.Possible drawbacks
I don't believe there are any.
Applicable issues
I did not create an issue since I was experimenting w/ solutions locally and seemed to have solved it.
Additional information
I believe this is a relatively impactful bug that is present in 05775ff and should be addressed before the next major release. I have not pinpointed the exact commit that broke this behavior.
@antgamdia @absoludity for visibility