containers / podman-desktop

Podman Desktop - A graphical tool for developing on containers and Kubernetes
https://podman-desktop.io
Apache License 2.0
4.52k stars 289 forks source link

Kubectl should not upgrade to older version #8253

Closed deboer-tim closed 1 month ago

deboer-tim commented 1 month ago

Bug description

As reported by a user through feedback, if you have kubectl 1.30 installed we currently recommend an 'upgrade' to 1.27:

Screenshot 2024-07-26 at 7 52 36 AM

Operating system

macOS 14.5

Installation Method

None

Version

next (development version)

Steps to reproduce

No response

Relevant log output

No response

Additional context

No response

axel7083 commented 1 month ago

The problem may occurs when a patch for an older version is released.

As of today (30 Jul 2024) the latest release a patch for version 1.27.X

image

The workflow to detect the latest release is the following:

getting the latest 10 releases

https://github.com/containers/podman-desktop/blob/61eefc784b4c191bb14242dc3ecb9cd905ca346c/extensions/kubectl-cli/src/kubectl-github-releases.ts#L43

filtering the pre-releases

https://github.com/containers/podman-desktop/blob/61eefc784b4c191bb14242dc3ecb9cd905ca346c/extensions/kubectl-cli/src/kubectl-github-releases.ts#L50

takes the first one https://github.com/containers/podman-desktop/blob/164e60633f067a1b32c2c8cc360a99d8b2d30236/extensions/kubectl-cli/src/download.ts#L40

This as some limitation, which has been shown here with this issue.

Solution proposal

We started using semvers in AI Lab and Podman Desktop for parsing versions. We could use it, as kubernetes is following a semantic version format, to get check for new version in the latest 10 we fetched.