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

fix: add force to cni cleanup on boot service #785

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

ollypom
Copy link
Contributor

@ollypom ollypom commented Feb 1, 2024

Issue #, if available:

Description of changes:
When testing Finch 1.1 I was seeing the new finch-cleanup-on-boot.service service fail.

PS C:\Program Files\Finch> wsl -d lima-finch 
[systemd]
Failed Units: 2
  auditd.service
  finch-cleanup-on-boot.service

Inspecting the service you see:

[root@mymachine Finch]# journalctl -u finch-cleanup-on-boot
Feb 01 10:48:26 mymachine systemd[1]: Starting finch-cleanup-on-boot.service - Delete hanging data on boot...
Feb 01 10:48:26 mymachine sudo[938]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/rm /var/lib/cni/networks/bridge/**
Feb 01 10:48:26 mymachine sudo[938]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Feb 01 10:48:26 mymachine bash[939]: rm: cannot remove '/var/lib/cni/networks/bridge/**': No such file or directory
Feb 01 10:48:26 mymachine sudo[938]: pam_unix(sudo:session): session closed for user root
Feb 01 10:48:26 mymachine sudo[937]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/rm /var/lib/cni/results/bridge-finch-*
Feb 01 10:48:26 mymachine sudo[937]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Feb 01 10:48:26 mymachine bash[940]: rm: cannot remove '/var/lib/cni/results/bridge-finch-*': No such file or directory
Feb 01 10:48:26 mymachine sudo[937]: pam_unix(sudo:session): session closed for user root
Feb 01 10:48:26 mymachine systemd[1]: finch-cleanup-on-boot.service: Main process exited, code=exited, status=1/FAILURE
Feb 01 10:48:26 mymachine systemd[1]: finch-cleanup-on-boot.service: Failed with result 'exit-code'.
Feb 01 10:48:26 mymachine systemd[1]: Failed to start finch-cleanup-on-boot.service - Delete hanging data on boot.

So I have add the -rf flags to this command so that even if the files do not exist the systemd service will not fail.

Testing done:
I have manually tested this change by adding it to my own finch.yaml configuration, then stopping / removing the VM and re-initializing it.

  • I've reviewed the guidance in CONTRIBUTING.md

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Signed-off-by: Olly Pomeroy <opomer@amazon.co.uk>
@pendo324
Copy link
Member

pendo324 commented Feb 1, 2024

Thanks. One Windows test host is broken right now (will fix) but I think enough tests passed to merge.

@pendo324 pendo324 merged commit 9b2438b into runfinch:main Feb 1, 2024
19 of 21 checks passed
mharwani pushed a commit that referenced this pull request Feb 1, 2024
🤖 I have created a release *beep* *boop*
---


## [1.1.1](v1.1.0...v1.1.1)
(2024-02-01)


### Build System or External Dependencies

* **deps:** Bump submodules and dependencies
([#762](#762))
([4889527](4889527))


### Bug Fixes

* add force to cni cleanup on boot service
([#785](#785))
([9b2438b](9b2438b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants