Repository navigation
docs: show a realistic unencrypted_regex example - #254
Merged
isindir merged 1 commit intoSep 6, 2026
Merged
Conversation
The test fixture used the key names PLAIN_CONFIG_VALUE and SECRET_TOKEN. Those names show the mechanism, but they do not show why a user needs it. The fixture now holds five environment variables for one application: LOG_LEVEL, WEB_CONCURRENCY and OTEL_EXPORTER_OTLP_ENDPOINT stay in plain text, and DATABASE_URL and OPENAI_API_KEY are encrypted. This is the case the option is for: one application which has both types of value, in one file. The README shows the same example, with the rule in .sops.yaml instead of a command line flag. A rule in .sops.yaml is in one file which the team reviews, and nobody has to repeat the flag. The README also states that a value in stringData must stay quoted when it looks like a number. Co-authored-by: Cursor <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit message
docs: show a realistic unencrypted_regex exampleDescription
Follow up to #252. The example test does not make it clear why the feature is needed. The fixture used the key names
PLAIN_CONFIG_VALUEandSECRET_TOKEN, which show the mechanism but not the use case. Read on its own, it does look like something a ConfigMap solves.Suggested solution
The fixture now holds five environment variables for one application:
The first three stay in plain text and the last two are encrypted. This is the case the option is
for: one application with both types of value, in one file. A change to
WEB_CONCURRENCYis thenvisible in a diff, and the two secrets stay protected.
The README shows the same example, and it puts the rule in
.sops.yamlinstead of a command lineflag. This also answers your point about an incorrectly written regex: in
.sops.yamlthe allowlistis one line in one file which the team reviews, instead of a flag which somebody retypes for each
file.
The README also states that a value in
stringDatamust stay quoted when it looks like a number,because Kubernetes only accepts strings there.
Alternative solutions considered
A ConfigMap mounted next to the secret holds this data equally well, and for the data alone it is
the simpler answer. The difference for us is the file, not the data. The same variables also live in
.enc.envfiles for local development and CI, so one.sops.yamlrule covers both places. AConfigMap solves only the cluster side, and then a person who adds one environment variable must
decide first whether it is secret, edit a second file, and add another
envFrom.Additional context
No change to the operator or to the CRD. This is the fixture, the assertions and the README.
make testpasses, coverage 78.7%.AI generated code/design contribution
Yes. An AI assistant wrote the example, the README text and this description. I reviewed the change
and ran the tests.