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

Redirect error stream to null when checking nm-cloud systemd unit #8815

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

manuelbuil
Copy link
Contributor

@manuelbuil manuelbuil commented Nov 13, 2023

Proposed Changes

Redirect error stream to /dev/null in the command: /bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service'

Types of Changes

Bugfix

Verification

Deploy k3s in an OS which does not include the systemd unit: nm-cloud-setup.service. You should see in journalctl the log:

Nov 13 11:56:32 terraform-mbuil-vm0 systemd[1]: Starting Lightweight Kubernetes...
Nov 13 11:56:32 terraform-mbuil-vm0 sh[15779]: + /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service
Nov 13 11:56:32 terraform-mbuil-vm0 k3s[15783]: time="2023-11-13T11:56:32Z" level=info msg="Acquiring lock file /var/lib/rancher/k3s/data/.lock"
Nov 13 11:56:32 terraform-mbuil-vm0 k3s[15783]: time="2023-11-13T11:56:32Z" level=info msg="Preparing data dir /var/lib/rancher/k3s/data/9a3b96173d04b44c653fcd84c279f9b2928cb7fe6305a455e6db8914b9a1f949"

Instead of:

Nov 13 11:56:32 terraform-mbuil-vm0 systemd[1]: Starting Lightweight Kubernetes...
Nov 13 11:56:32 terraform-mbuil-vm0 sh[15779]: + /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service
Nov 13 11:56:32 terraform-mbuil-vm0 sh[2188]: Failed to get unit file state for nm-cloud-setup.service: No such file or directory
Nov 13 11:56:32 terraform-mbuil-vm0 k3s[15783]: time="2023-11-13T11:56:32Z" level=info msg="Acquiring lock file /var/lib/rancher/k3s/data/.lock"
Nov 13 11:56:32 terraform-mbuil-vm0 k3s[15783]: time="2023-11-13T11:56:32Z" level=info msg="Preparing data dir /var/lib/rancher/k3s/data/9a3b96173d04b44c653fcd84c279f9b2928cb7fe6305a455e6db8914b9a1f949"

i.e. the log Failed to get unit file state for nm-cloud-setup.service: No such file or directory doesnto exist anymore

If the OS includes the systemd unit: nm-cloud-setup.service k3s will fail to start

Testing

Linked Issues

#8714

User-Facing Change

Remove confusing "nm-cloud-setup.service: No such file or directory" journalctl log

Further Comments

@manuelbuil manuelbuil requested a review from a team as a code owner November 13, 2023 12:13
install.sh Outdated Show resolved Hide resolved
@manuelbuil manuelbuil force-pushed the removeConfusion branch 2 times, most recently from ac423fa to a731529 Compare November 14, 2023 11:48
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3f23723) 46.74% compared to head (29f5c54) 47.16%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8815      +/-   ##
==========================================
+ Coverage   46.74%   47.16%   +0.42%     
==========================================
  Files         150      147       -3     
  Lines       15837    12699    -3138     
==========================================
- Hits         7403     5990    -1413     
+ Misses       7232     5558    -1674     
+ Partials     1202     1151      -51     
Flag Coverage Δ
e2etests 47.16% <ø> (?)
inttests ?
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

install.sh Show resolved Hide resolved
@manuelbuil manuelbuil force-pushed the removeConfusion branch 2 times, most recently from a626075 to 1151512 Compare November 15, 2023 06:40
Signed-off-by: Manuel Buil <mbuil@suse.com>
@manuelbuil
Copy link
Contributor Author

Postponed to January release

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

Successfully merging this pull request may close these issues.

3 participants