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

refactor: optimize flags and SetLabel #9762

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

dsseng
Copy link
Member

@dsseng dsseng commented Nov 19, 2024

Do not do string lookups in repetitive calls. We do not support changing SELinux status during runtime, so once we read this we can assume status does not change.

Also avoid unneeded FS writes when appropriate label is already set on file.

Signed-off-by: Dmitry Sharshakov [email protected]

internal/pkg/selinux/selinux.go Outdated Show resolved Hide resolved
Do not do string lookups in repetitive calls. We do not support changing SELinux status during runtime, so once we read this we can assume status does not change.

Also avoid unneeded FS writes when appropriate label is already set on file.

Signed-off-by: Dmitry Sharshakov <[email protected]>
@dsseng
Copy link
Member Author

dsseng commented Nov 21, 2024

/m

@talos-bot talos-bot merged commit 4caeae2 into siderolabs:main Nov 21, 2024
50 checks passed
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.

5 participants