Skip to content

Schema.json drop 'required' for security contexts#17

Open
user170200 wants to merge 2 commits into
operaton:mainfrom
user170200:main
Open

Schema.json drop 'required' for security contexts#17
user170200 wants to merge 2 commits into
operaton:mainfrom
user170200:main

Conversation

@user170200
Copy link
Copy Markdown

Background

Platforms with security contexts (SCCs), such as Openshift (or OKD) require specific values for fsGroup or runAsUser.
The final values are namespace-dependent - a security feature of these platforms.
It would be rather messy to retrieve the dynamically required values from the platform and generate a custom value.yaml for each stage+namespace.

However, platforms using SCCs can set these values automatically, given they are non-present or set to NULL.

The Problem

The values.schema.json sets these properties as 'required'.
If they are set to null, each helm command must use the --skip-schema-validation or fail.

A possible solution

Dropping these fields to be 'required' - They can still be set, they still show up normally, but are nullable and support platforms with SCCs.

Copy link
Copy Markdown

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

Adjusts the Helm chart JSON schema to better support platforms (e.g., OpenShift/OKD with SCCs) where fsGroup/runAsUser may need to be omitted so the platform can default them per-namespace.

Changes:

  • Removes required constraints for podSecurityContext.fsGroup.
  • Removes required constraints for securityContext.capabilities.drop.
  • Removes required constraints for securityContext fields (capabilities, runAsNonRoot, runAsUser).

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

Comment thread charts/operaton/values.schema.json Outdated
Comment thread charts/operaton/values.schema.json Outdated
…security constraints only set them automatically IF they are null (non-present, breaking required)
@user170200
Copy link
Copy Markdown
Author

Verified the behavior described by CoPilot and applied the changes:

Let the fsGroup and runAsUser be of type: ["integer", "null"] instead.

Updated the commit to stay clean

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.

2 participants