-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add checks for CNIBinDir ownership/permissions. #606
Add checks for CNIBinDir ownership/permissions. #606
Conversation
31878b7
to
a142d7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Some comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a more general note, this does not prevent or address the issue, it only raises the error message in k8s status
rather than getting cilium deployed.
I could see this causing more issues (e.g. gateway or ingress also failing to enable with errors). Perhaps we should just amend the required state? e.g. try to chown and chmod the directory?
dfb54da
to
f2ec833
Compare
Correct, that was what was suggested in this comment on the original issue, so I just went with it.
I had considered it, but was unsure whether the snap should liberally change the state of files on the host system. If you think this is something the k8s snap should/could be able to do, I can gladly update the PR to perform the chown/chmod's directly... |
f2ec833
to
4f05603
Compare
4f05603
to
2350838
Compare
2350838
to
620d156
Compare
Just updated, thanks! I initially made it part of the Cilium network setup since it was "closer" to where the Cilium chart deployment which failed due to the wrong ownership/permissions was being deployed, but it does indeed make more sense to handle this in the main k8sd setup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's OK, left some comments about the logging
620d156
to
c10fc83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the Go test, then we are good to merge
02c1a0c
to
256f239
Compare
Add checks/remediation steps for the ownership/permissions of the CNIBinDir during initial k8sd directories setup. Fixes: canonical#567 Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
256f239
to
77cb642
Compare
@bschimke95 I have managed to fix the previous logic bug but the tests are apparently being run as The only workaround I can think of is running the tests as root from the workflow ( |
Hey @aznashwan |
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
When the Cilium feature is enabled, add simple user/group/permissions checks on the configured CNIBinDir (/opt/cni/bin) before installing the Cilium Helm chart.
Fixes: #567