-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Since it is a child component depending upon the Given that a 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 commentThe 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. |
||
|
||
const { | ||
apps: { isFetching: appsFetching }, | ||
charts: { isFetching: chartsFetching }, | ||
|
@@ -91,12 +93,15 @@ function UpgradeForm({ | |
useEffect(() => { | ||
dispatch( | ||
actions.charts.fetchChartVersions({ | ||
context: { cluster: cluster, namespace: repoNamespace }, | ||
context: { | ||
cluster: packageCluster ?? cluster, | ||
namespace: repoNamespace, | ||
}, | ||
plugin: pluginObj, | ||
identifier: packageId, | ||
} as AvailablePackageReference), | ||
); | ||
}, [dispatch, cluster, repoNamespace, packageId, pluginObj]); | ||
}, [dispatch, packageCluster, repoNamespace, packageId, cluster, pluginObj]); | ||
|
||
useEffect(() => { | ||
if (deployed.values && !modifications) { | ||
|
@@ -122,7 +127,7 @@ function UpgradeForm({ | |
dispatch( | ||
actions.charts.fetchChartVersion( | ||
{ | ||
context: { cluster: cluster, namespace: repoNamespace }, | ||
context: { cluster: packageCluster, namespace: repoNamespace }, | ||
plugin: pluginObj, | ||
identifier: packageId, | ||
} as AvailablePackageReference, | ||
|
@@ -131,7 +136,7 @@ function UpgradeForm({ | |
); | ||
}, [ | ||
dispatch, | ||
cluster, | ||
packageCluster, | ||
repoNamespace, | ||
packageId, | ||
deployed.chartVersion?.version?.pkgVersion, | ||
|
@@ -160,7 +165,7 @@ function UpgradeForm({ | |
dispatch( | ||
actions.charts.fetchChartVersion( | ||
{ | ||
context: { cluster: cluster, namespace: repoNamespace }, | ||
context: { cluster: packageCluster, namespace: repoNamespace }, | ||
plugin: pluginObj, | ||
identifier: packageId, | ||
} as AvailablePackageReference, | ||
|
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.
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)
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 :PThere 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 :)