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

Install script INSTALL_K3S_PR support does not work if CI has run more than once #10116

Closed
brandond opened this issue May 16, 2024 · 3 comments
Closed
Assignees
Milestone

Comments

@brandond
Copy link
Contributor

brandond commented May 16, 2024

If the action runs multiple times (say due to being restarted to address a flake), the RUN_ID expression may return multiple results:

k3s/install.sh

Lines 496 to 497 in 1d22b69

# Extract the Run ID from the build workflow and lookup artifacts associated with the run
RUN_ID=$(echo "$build_workflow" | jq -r ' .details_url' | awk -F'/' '{print $(NF-2)}')

#8 1.395 + RUN_ID='9118227575
#8 1.395 9118227594'
#8 1.396 ++ curl -s -H 'Authorization: Bearer xxx' 'https://api.github.com/repos/k3s-io/k3s/actions/runs/9118227575
#8 1.396 9118227594/artifacts'
#8 1.402 + artifacts=
@brandond
Copy link
Contributor Author

cc @dereknola

@brandond
Copy link
Contributor Author

no backports, since install script changes only go to master

@brandond brandond modified the milestones: Backlog, v1.30.2+k3s1 May 23, 2024
@ShylajaDevadiga ShylajaDevadiga self-assigned this May 28, 2024
@ShylajaDevadiga
Copy link
Contributor

Validated using PR number 10113 on master branch

Environment Details

Infrastructure
Cloud EC2 instance
Cluster Configuration:
Single node

Steps to validate

  1. export GITHUB_TOKEN
  2. Install install a merged commit where CI ran more than once
> curl -fL https://get.k3s.io | INSTALL_K3S_PR=10113 sh -s -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 35365  100 35365    0     0   124k      0 --:--:-- --:--:-- --:--:--  125k
[INFO]  Using PR 10113 as release
[INFO]  Downloading hash https://api.github.com/repos/k3s-io/k3s/actions/artifacts/1511389615/zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  120M  100  120M    0     0  26.2M      0  0:00:04  0:00:04 --:--:-- 28.3M
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Skipping installation of SELinux RPM
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Creating /usr/local/bin/ctr symlink to k3s
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO]  systemd: Starting k3s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done Issue
Development

No branches or pull requests

3 participants