-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
send error output when running systemctl reset-failed k3s to /dev/null #10486
send error output when running systemctl reset-failed k3s to /dev/null #10486
Conversation
Are you sure that this is the cause of the step showing as failed? Or is it because the command exits with a non-zero exit code? If it is the latter, then just redirecting the output will not actually solve your problem. |
My apologies, you're right. I landed on a generalized 'systemctl reset-failed' vs 'systemctl reset-failed k3s' I am using Github actions to clone k3s repo, scp it to my up-to-date Debian Bookworm machine, and run the install.sh. It uninstalls in the same fashion. Prior to using this sed command I was having inconsistent failures with the uninstall script, causing it to leave remains of the installation behind then cause the next run of the install.sh script to fail. name: k3s
on:
push:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clean up
uses: JimCronqvist/action-ssh@master
with:
hosts: 'user@host:22'
privateKey: ${{ secrets.KEY }}
command: if [[ -d /var/lib/k3s/ ]]; then rm -rf /var/lib/k3s/*; else mkdir /var/lib/k3s/; fi
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Clone
run: ls -althrs
- name: SCP Repo
uses: nogsantos/scp-deploy@master
with:
src: ./*
host: host
remote: /var/lib/k3s/
port: 22
user: root
key: ${{ secrets.KEY }}
- name: docker prune
uses: JimCronqvist/action-ssh@master
# continue-on-error: true
with:
hosts: 'user@host:22'
privateKey: ${{ secrets.KEY }}
command: yes | docker system prune -a;
- name: uninstall script
uses: JimCronqvist/action-ssh@master
# continue-on-error: true
with:
hosts: 'user@host:22'
privateKey: ${{ secrets.KEY }}
command: if [[ -f /usr/local/bin/k3s-uninstall.sh ]]; then sed -i -e 's/systemctl reset-failed k3s/systemctl reset-failed/g' /usr/local/bin/k3s-uninstall.sh && /usr/local/bin/k3s-uninstall.sh; fi;
- name: remove /var/lib/kubelet/
uses: JimCronqvist/action-ssh@master
# continue-on-error: true
with:
hosts: 'user@host:22'
privateKey: ${{ secrets.KEY }}
command: if [[ -d /var/lib/kubelet/ ]]; then rm -rf /var/lib/kubelet/; fi;
- name: remove k3s service
uses: JimCronqvist/action-ssh@master
# continue-on-error: true
with:
hosts: 'user@host:22'
privateKey: ${{ secrets.KEY }}
command: if [[ -f /etc/systemd/system/k3s.service ]]; then rm /etc/systemd/system/k3s.service && systemctl daemon-reload; fi;
- name: k3s install
uses: JimCronqvist/action-ssh@master
# continue-on-error: true
with:
hosts: 'user@host:22'
privateKey: ${{ secrets.KEY }}
command: if [[ -f /var/lib/k3s/k3s/install.sh ]]; then sed -i -e 's/systemctl reset-failed ${SYSTEM_NAME}/systemctl reset-failed/g' /var/lib/k3s/k3s/install.sh && /var/lib/k3s/k3s/install.sh; fi;
|
generalized reset-failed Signed-off-by: Koonts <[email protected]>
generalized reset-failed Signed-off-by: Koonts <[email protected]>
resolves Github actions failure Co-authored-by: Brad Davidson <[email protected]> Signed-off-by: Koonts <[email protected]>
resolves Github actions failure Co-authored-by: Brad Davidson <[email protected]> Signed-off-by: Koonts <[email protected]>
Your suggested changes worked great! |
You also need to update the sha256sum file when modifying the install script. |
You need to pull from our repo again, and then rebase on top of the master branch. And don't forget to sign your commits! |
generalized reset-failed Signed-off-by: Koonts <[email protected]>
generalized reset-failed Signed-off-by: Koonts <[email protected]>
resolves Github actions failure Co-authored-by: Brad Davidson <[email protected]> Signed-off-by: Koonts <[email protected]>
resolves Github actions failure Co-authored-by: Brad Davidson <[email protected]> Signed-off-by: Koonts <[email protected]>
…o install_script_reset-failed
I believe I have re-based and amended my commits correctly, please let me know if not I can make a new pr. |
Signed-off-by: Koonts <[email protected]>
…o install_script_reset-failed Signed-off-by: foxx <[email protected]>
…o install_script_reset-failed Signed-off-by: foxx <[email protected]>
Signed-off-by: Brad Davidson <[email protected]>
Signed-off-by: Jake Hyde <[email protected]>
Bumps [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) from 0.7.4 to 0.7.7. - [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md) - [Commits](hashicorp/go-retryablehttp@v0.7.4...v0.7.7) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-retryablehttp dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
Made with ❤️️ by updatecli
* chore: Bump Local Path Provisioner version Made with ❤️️ by updatecli --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Brad Davidson <[email protected]>
Made with ❤️️ by updatecli
* Move snapshot structs and functions into pkg/etcd/snapshot * Move s3 client code and functions into pkg/etcd/s3 * Refactor pkg/etcd to track snapshot and s3 moves * Add support for reading s3 client config from secret * Add minio client cache, since S3 client configuration can now be changed at runtime by modifying the secret, and don't want to have to create a new minio client every time we read config. * Add tests for pkg/etcd/s3 Signed-off-by: Brad Davidson <[email protected]>
…-io#10461) * For E2E upgrade test, determine the upgrade channel Signed-off-by: Derek Nola <[email protected]> * Fix typos Signed-off-by: Derek Nola <[email protected]> --------- Signed-off-by: Derek Nola <[email protected]>
…o install_script_reset-failed
It looks like you pulled our master branch into your PR branch. Hence all the extra commits here. You want to rebase YOUR branch on top of ours. |
Proposed Changes
Change line 868 in uninstall script block to add '2>/dev/null' to 'systemctl reset-failed ${SYSTEM_NAME}' on line 868 of install.sh, which is the section that creates the uninstall script.
![Screenshot from 2024-07-10 10-58-59](https://private-user-images.githubusercontent.com/37273704/347460346-96df1f44-bd43-4b3c-8b6b-5d343ea8be44.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3Njc0NjQsIm5iZiI6MTcyNDc2NzE2NCwicGF0aCI6Ii8zNzI3MzcwNC8zNDc0NjAzNDYtOTZkZjFmNDQtYmQ0My00YjNjLThiNmItNWQzNDNlYThiZTQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI3VDEzNTkyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVlNzA0MWJhYjU2NTczODExODUxMmYxZjRhZDVkMmE2Mjk0NzYxNmY4MThlNTZlMWI4ZmM2MDc2YTMwMGM1OGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MSuWcq5Hy7RP5mVBOJeSJZIhLp0FlPpH2LlIZ0dkMOE)
I am currently using sed to fix this and prevent build errors within Github Actions.
Types of Changes
send error output when running systemctl reset-failed k3s to /dev/null
Verification
Change will not effect functionality.
Testing
Change is not covered by unit testing. Tested manually to confirm change does not change install script or uninstall script functionality.
Linked Issues
n/a
User-Facing Change
none
Further Comments
no further comment. I'm totally fine with using sed here, I just feel as though others may have run into issues with this as well.