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

Setting readOnlyRootFilesystem overrides any pre-existing securityContext #708

Closed
olim7t opened this issue Sep 18, 2024 · 0 comments · Fixed by #709
Closed

Setting readOnlyRootFilesystem overrides any pre-existing securityContext #708

olim7t opened this issue Sep 18, 2024 · 0 comments · Fixed by #709
Assignees
Labels
bug Something isn't working

Comments

@olim7t
Copy link
Contributor

olim7t commented Sep 18, 2024

If CassandraDatacenter.spec.readOnlyRootFilesystem is set, we build a completely new securityContext in construct_podtemplatespec.go:

	if dc.ReadOnlyFs() {
		cassContainer.SecurityContext = &corev1.SecurityContext{
			ReadOnlyRootFilesystem: ptr.To[bool](true),
		}
	}

However, this ignores the fact that other securityContext options might have been already provided via CassandraDatacenter.spec.podTemplateSpec.
We should amend the existing context (if present) instead of overriding it.

┆Issue is synchronized with this Jira Story by Unito
┆Issue Number: CASS-67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: No status
1 participant