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

🐛 Running an upgrade without a source fails #2431

Closed
mauromorales opened this issue Apr 4, 2024 · 6 comments
Closed

🐛 Running an upgrade without a source fails #2431

mauromorales opened this issue Apr 4, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@mauromorales
Copy link
Member

I don't see the point of having kairos-agent upgrade if it doesn't work unless you pass a source

Kairos version:

[kairos@fedora ~]$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="38 (Container Image)"
ID=fedora
VERSION_ID=38
VERSION_CODENAME=""
PLATFORM_ID="platform:f38"
PRETTY_NAME="Fedora Linux 38 (Container Image)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:38"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f38/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=38
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=38
SUPPORT_END=2024-05-14
VARIANT="Container Image"
VARIANT_ID=container
KAIROS_VERSION="v3.0.3"
KAIROS_FLAVOR_RELEASE="38"
KAIROS_REGISTRY_AND_ORG="quay.io/kairos"
KAIROS_ID="kairos"
KAIROS_ID_LIKE="kairos-core-fedora-38"
KAIROS_ARTIFACT="kairos-fedora-38-core-amd64-generic-v3.0.3"
KAIROS_RELEASE="v3.0.3"
KAIROS_BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues"
KAIROS_SOFTWARE_VERSION_PREFIX="k3s"
KAIROS_NAME="kairos-core-fedora-38"
KAIROS_PRETTY_NAME="kairos-core-fedora-38 v3.0.3"
KAIROS_IMAGE_REPO="quay.io/kairos/fedora:38-core-amd64-generic-v3.0.3"
KAIROS_MODEL="generic"
KAIROS_TARGETARCH="amd64"
KAIROS_GITHUB_REPO="kairos-io/kairos"
KAIROS_VERSION_ID="v3.0.3"
KAIROS_FLAVOR="fedora"
KAIROS_VARIANT="core"
KAIROS_HOME_URL="https://github.com/kairos-io/kairos"
KAIROS_IMAGE_LABEL="38-core-amd64-generic-v3.0.3"

CPU architecture, OS, and Version:

amd64

Describe the bug

[root@fedora kairos]# kairos-agent upgrade
2024-04-04T12:59:26Z INF Kairos Agent version=v2.8.8
2024-04-04T12:59:26Z INF Kairos System version=v3.0.3
2024-04-04T12:59:26Z INF creating a runtime
2024-04-04T12:59:26Z INF detecting boot state
2024-04-04T12:59:26Z INF Boot Mode boot_mode=active_boot
2024-04-04T12:59:26Z INF Boot in uki mode result=false
[   60.929866] EXT4-fs (vda3): mounted filesystem 769d0d37-7f1a-44ba-ba2d-b5dd9fcba7db r/w with ordered data mode. Quota mode: none.
[   60.932696] EXT4-fs (vda3): unmounting filesystem 769d0d37-7f1a-44ba-ba2d-b5dd9fcba7db.
sanitizing the upgrade spec: undefined upgrade source
[root@fedora kairos]# echo $?
1

Expected behavior

command doesn't even start if a flag is required

Logs

Additional context

@mauromorales mauromorales added bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed labels Apr 4, 2024
@jimmykarily jimmykarily removed the triage Add this label to issues that should be triaged and prioretized in the next planning call label Apr 15, 2024
@jimmykarily jimmykarily moved this to In Progress 🏃 in 🧙Issue tracking board Apr 15, 2024
@jimmykarily jimmykarily moved this from In Progress 🏃 to Todo 🖊 in 🧙Issue tracking board Apr 15, 2024
@Itxaka Itxaka self-assigned this Apr 15, 2024
@Itxaka Itxaka moved this from Todo 🖊 to In Progress 🏃 in 🧙Issue tracking board Apr 15, 2024
@Itxaka
Copy link
Member

Itxaka commented Apr 15, 2024

Unfortunately, this is kind of correct as we need to check the different sources coming from different places before being able to fail without a source:

2024-04-15T09:58:17Z INF Kairos Agent version=v2.8.10
2024-04-15T09:58:17Z INF Kairos System version=v3.0.4-6-ga52683c-dirty
2024-04-15T09:58:17Z INF creating a runtime
2024-04-15T09:58:17Z INF detecting boot state
2024-04-15T09:58:17Z INF Boot Mode boot_mode=active_boot
2024-04-15T09:58:17Z INF Boot in uki mode result=false
sanitizing the upgrade spec: undefined upgrade source

This needs to check:

  • source flag
  • cloud configs
  • upgrade events

before being able to determine that there is not an upgrade source specified.

@mauromorales what was your idea on how this should behave? At the start? This is practically the start, it just gets all the config and such and then builds the spec and fails if it doesnt have an upgrade source, which Its the earliest we can do it IMO. If we only had the source flag then yeah we could fail earlier.

@mauromorales
Copy link
Member Author

@Itxaka IMO it should not run but just show the help so you know that the --source flag is required

@Itxaka
Copy link
Member

Itxaka commented Apr 15, 2024

@mauromorales well, the thing is the source flag is NOT required as you can have the source come form the config files for example, or from an event, so the flag in there is to OVERRIDE the values on the config files (I think it goes flag>config in precedence) so we cannot fail earlier.

@mauromorales
Copy link
Member Author

@Itxaka ahhhh shooot, now I get it, sorry ... hmm, but it feels like then upgrade is actually multiple commands in one in that case. Because specially events, they don't need to have a pretty interface, and IMO the failed output here does not tell me I have those 3 options to set the source. But let's close for now because changing that would impact other consumers I guess

@github-project-automation github-project-automation bot moved this from In Progress 🏃 to Done ✅ in 🧙Issue tracking board Apr 15, 2024
@Itxaka
Copy link
Member

Itxaka commented Apr 15, 2024

I would not close it. Indeed it seems like the message could be much nicer and clearer on where the issue is. I will try as small patch to identify the error and print something nicer that points to a fix for the error

@mauromorales mauromorales reopened this Apr 15, 2024
@github-project-automation github-project-automation bot moved this from Done ✅ to Under review 🔍 in 🧙Issue tracking board Apr 15, 2024
@Itxaka
Copy link
Member

Itxaka commented Apr 15, 2024

kairos-io/kairos-agent#293 for better output message

@Itxaka Itxaka closed this as completed Apr 15, 2024
@github-project-automation github-project-automation bot moved this from Under review 🔍 to Done ✅ in 🧙Issue tracking board Apr 15, 2024
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

No branches or pull requests

3 participants