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

🐛 Adapt kairos upgrade list-releases command to handle new repositories #1999

Closed
4 tasks
mauromorales opened this issue Nov 10, 2023 · 7 comments · Fixed by #2081
Closed
4 tasks

🐛 Adapt kairos upgrade list-releases command to handle new repositories #1999

mauromorales opened this issue Nov 10, 2023 · 7 comments · Fixed by #2081
Assignees
Labels
bug Something isn't working

Comments

@mauromorales
Copy link
Member

mauromorales commented Nov 10, 2023

  • we don't let the provider return values, we handle everything in the agent. link1 link2 - What about other providers? Shouldn't they be able to return new versions with their own logic? We can simply use the same implementation in kairos-agent and provider-kairos and let other providers handle that as they want.
  • by default we filter from the existing attributes that the current image has, e.g. if it's amd64 we only show amd64 and so on for the rest of the attributes, which means we need a place to save model. Maybe the best is to keep it in os-release like we already do for most attributes
  • maybe an option to show all tags without smart filtering
  • ensure that the output can be used to copy paste and use in kairos-agent upgrade --source or some fancy selector

relates to #1998

@mauromorales mauromorales added the bug Something isn't working label Nov 10, 2023
@mauromorales mauromorales changed the title Adapt kairos upgrade list-releases command to handle new repositories 🐛 Adapt kairos upgrade list-releases command to handle new repositories Nov 10, 2023
@jimmykarily jimmykarily mentioned this issue Nov 10, 2023
20 tasks
@jimmykarily jimmykarily self-assigned this Nov 28, 2023
@jimmykarily
Copy link
Contributor

wip branch: https://github.com/kairos-io/kairos-sdk/tree/1999-introduce-versioneer

I will move all logic to golang so that we can implement other things like:

  • given an artifact name, what is the flavor?
  • given an artifact name, what is the next version of the same arch/model/etc
  • etc

@jimmykarily
Copy link
Contributor

We need this change: #2035

@jimmykarily
Copy link
Contributor

jimmykarily commented Dec 7, 2023

Sample output:

localhost:~ # ./kairos-agent upgrade list-releases --pre | more
Current image:
quay.io/kairos/opensuse:leap-15.5-standard-amd64-generic-v2.4.1-k3sv1.28.1-k3s1

Available releases with higher versions:
quay.io/kairos/opensuse:leap-15.5-standard-amd64-generic-v2.4.2-k3sv1.28.2-k3s1
quay.io/kairos/opensuse:leap-15.5-standard-amd64-generic-v2.4.2-rc2-k3sv1.28.2-k3s1
quay.io/kairos/opensuse:leap-15.5-standard-amd64-generic-v2.4.2-rc1-k3sv1.28.2-k3s1

or (when only k3s version is higher):

localhost:~ # ./kairos-agent upgrade list-releases --pre
Current image:
quay.io/kairos/opensuse:leap-15.5-standard-amd64-generic-v2.4.2-k3sv1.28.1-k3s1

Available releases with higher versions:
quay.io/kairos/opensuse:leap-15.5-standard-amd64-generic-v2.4.2-k3sv1.28.2-k3s1

@jimmykarily
Copy link
Contributor

The upgrade with no version passed must have been broken for a while:

localhost:/home/kairos # kairos-agent upgrade
INFO[2023-12-07T15:50:46Z] kairos-agent version v2.4.1                  
[  134.766809][ T1731] EXT4-fs (vda3): mounted filesystem with ordered data mode. Opts: (null). Quota mode: n.
sanitizing the upgrade spec: undefined upgrade source

because we sanitize the spec before we handle the empty source. I guess, since nobody complained, it's ok to deprecate that feature and always require a version.

@jimmykarily
Copy link
Contributor

Instead of re-implementing the ListReleases in provider-kairos, I will simply make it return an empty list. This makes the kairos-agent use it's own logic to find available releases, with the same result.

@mauromorales
Copy link
Member Author

because we sanitize the spec before we handle the empty source. I guess, since nobody complained, it's ok to deprecate that feature and always require a version.

Didn't Santosh mentioned they were using it? not sure in which version they are atm ... but I agree, probably it's not being relied on so it's safe to remove

jimmykarily added a commit to kairos-io/provider-kairos that referenced this issue Dec 8, 2023
to let the kairos-agent handle upgrades from now on. It used to be that
provider-kairos returned releases from the provider-kairos repository
but it's no longer the case. Everything is release in the
kairos-io/kairos repository and the new versioneer library of the
kairos-sdk (which is used in the kairos-agent) is capabable of handling
both "standard" and "core" images.

Part of: kairos-io/kairos#1999

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
@mauromorales
Copy link
Member Author

We need to make sure this does not break other provider upgrades because of the removal of the bus #2072

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants