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

SecurityContext vs PodSecurityContext in the target allocator CR #2490

Closed
jaronoff97 opened this issue Jan 4, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working needs triage

Comments

@jaronoff97
Copy link
Contributor

Component(s)

operator

What happened?

Description

Right now, the securityContext for the TA is using the PodSecurityContext. This naming creates a problem. The PodSecurityContext object has these fields. The SecurityContext object has these fields. Unfortunately, there is a difference in these fields, here's the distinct set:

PODSECURITYCONTEXT

SupplementalGroups []int64 `json:"supplementalGroups,omitempty" protobuf:"varint,4,rep,name=supplementalGroups"`
FSGroup *int64 `json:"fsGroup,omitempty" protobuf:"varint,5,opt,name=fsGroup"`
Sysctls []Sysctl `json:"sysctls,omitempty" protobuf:"bytes,7,rep,name=sysctls"`
FSGroupChangePolicy *PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty" protobuf:"bytes,9,opt,name=fsGroupChangePolicy"`

SECURITYCONTEXT

Capabilities *Capabilities `json:"capabilities,omitempty" protobuf:"bytes,1,opt,name=capabilities"`
Privileged *bool `json:"privileged,omitempty" protobuf:"varint,2,opt,name=privileged"`
ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty" protobuf:"varint,6,opt,name=readOnlyRootFilesystem"`
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" protobuf:"varint,7,opt,name=allowPrivilegeEscalation"`
ProcMount *ProcMountType `json:"procMount,omitempty" protobuf:"bytes,9,opt,name=procMount"`

Although there is a difference here, I would argue that the current bug is that our fields are misnamed and this breaking change is actually a bug fix. I believe we should adjust the TA to embed the fields the same way the collector does in the current version.

Kubernetes Version

n/a

Operator version

n/a

Collector version

n/a

Environment information

n/a

Log output

n/a

Additional context

n/a

@jaronoff97
Copy link
Contributor Author

Closed by #2492, follow up todo in #2495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants