Skip to content

Add Pod and Container security context overrides#74

Merged
GrigoryPervakov merged 1 commit intomainfrom
security-context
Feb 4, 2026
Merged

Add Pod and Container security context overrides#74
GrigoryPervakov merged 1 commit intomainfrom
security-context

Conversation

@GrigoryPervakov
Copy link
Member

Why

Pod and Container security context overrides were missing

What

Added the ability to override the securityContext on the Pod or Container level

Related Issues

Fixes: #68

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for security context overrides at both Pod and Container levels in KeeperCluster and ClickHouseCluster resources, addressing a gap in the API that prevented users from customizing security settings.

Changes:

  • Added SecurityContext fields to PodTemplateSpec and ContainerTemplateSpec structs in the API
  • Updated template generation logic to apply security context overrides when specified
  • Added test coverage to verify security context overrides are properly applied to StatefulSets

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
api/v1alpha1/common.go Added SecurityContext fields to PodTemplateSpec and ContainerTemplateSpec
api/v1alpha1/zz_generated.deepcopy.go Generated DeepCopy methods for new SecurityContext fields
internal/controller/keeper/templates.go Applied container and pod security context overrides in StatefulSet template
internal/controller/clickhouse/templates.go Applied container and pod security context overrides in StatefulSet template
internal/controller/keeper/controller_test.go Added test case to verify security context overrides are applied
internal/controller/clickhouse/controller_test.go Added test case to verify security context overrides are applied
docs/api_reference.md Updated documentation to reflect security context fields as overrides
config/crd/bases/clickhouse.com_keeperclusters.yaml Added CRD schema for SecurityContext fields
config/crd/bases/clickhouse.com_clickhouseclusters.yaml Added CRD schema for SecurityContext fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GrigoryPervakov GrigoryPervakov merged commit 3cc7380 into main Feb 4, 2026
14 checks passed
@GrigoryPervakov GrigoryPervakov deleted the security-context branch February 4, 2026 19:17
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.

securityContext cannot be defined in containerTemplate or podTemplate

1 participant