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

Fix fallback when Kubernetes versions list is unavailable #7515

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

mook-as
Copy link
Contributor

@mook-as mook-as commented Sep 19, 2024

If we previously had Kubernetes enabled, then the user deletes the k3s-versions.json cache and we fail to download a new one, we would previously fall over hard. This makes it so we automatically disable Kubernetes in that situation (and add a diagnostic so the user has a chance of figuring out what was wrong).

Fixes #7484

TypeScript can't compute the type of the payload correctly without using a
normal discriminated union; this doesn't look as nice, but at least it
seems to work.

Signed-off-by: Mark Yen <mark.yen@suse.com>
If Rancher Desktop was previously started with a version, but the user
wipes the `k3s-versions.json` cache and we fail to download a new copy,
handle the error and disable Kubernetes instead of throwing an error.  To
make sure the user is aware of the issue, also pop a diagnostic to describe
the situation.

Signed-off-by: Mark Yen <mark.yen@suse.com>
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

The only issue I have is that the diagnostic doesn't show up right away: I see the bubble with (1) diagnostic, and only when I click on it will it turn into (2) diagnostics: one for being offline, and one for turning of Kubernetes.

If I already open the diagnostics before Kubernetes is being started, then I only see the (1) offline diagnostics. I have to move away and back to the page to see the second one.

I think this is fine, given how rare this situation is, but if it is simple to fix, then maybe do it.

@mook-as
Copy link
Contributor Author

mook-as commented Sep 23, 2024

I think that's a separate issue about us not refreshing diagnostics in the background at all (though we still execute them); see also #3005. If we fix it the fix would likely be generic.

@mook-as mook-as merged commit f70fcb4 into rancher-sandbox:main Sep 23, 2024
17 checks passed
@mook-as mook-as deleted the k3s-no-versions-fallback branch September 23, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No container engine client available
2 participants