Skip to content

Enable encryptedData to be omitted by setting key to null in template#1871

Open
meln5674 wants to merge 1 commit intobitnami-labs:mainfrom
meln5674:feat/template-omit-encrypted-data
Open

Enable encryptedData to be omitted by setting key to null in template#1871
meln5674 wants to merge 1 commit intobitnami-labs:mainfrom
meln5674:feat/template-omit-encrypted-data

Conversation

@meln5674
Copy link
Copy Markdown

Description of the change

Make SealedSecret.spec.template.data fields nullable. A null value indicates that the key should be omitted from the final secret.

Change is backwards compatible.

Benefits

Templated Secrets can be used in cases where the set of keys is significant, i.e. extraneous keys are not acceptable.

Possible drawbacks

None known.

Applicable issues

Additional information

@meln5674 meln5674 force-pushed the feat/template-omit-encrypted-data branch 2 times, most recently from 73882a6 to 0d6e2bb Compare January 30, 2026 19:43
@alvneiayu
Copy link
Copy Markdown
Collaborator

hi @meln5674

there are linter errors. Could you take it a look, please?

thanks

Álvaro

Signed-off-by: Andrew Melnick <meln5674.5674@gmail.com>
@meln5674 meln5674 force-pushed the feat/template-omit-encrypted-data branch from 0d6e2bb to 2e4a8df Compare February 16, 2026 00:09
@meln5674
Copy link
Copy Markdown
Author

@alvneiayu It would appear the import and tooling versions have diverged.

3 of the 4 lint findings are deprecated functions called in files I did not modify, but instead the functions themselves are deprecated in the new make generate output, which suggests a version of k8s.io/code-generator other than the one listed in the go.mod was used to generate the current versions. The version annotation on the generated CRD went from 0.15.0 to 0.20.0, which is further evidence of version drift. I also notice the version of sigs.k8s.io/controller-tools/cmd/controller-gen in the Makefile is not pinned to a specific version, and will not have reproducible outputs.

I should also mention, make generate on its own fails as it tries to use a package (cmd/validation-gen) not actually present in that version of that module. I had to use make lint CODEGEN_PKG="$GOPATH/pkg/mod/k8s.io/code-generator@v0.35.1" to get it to run at all.

According to the git history, the version of that module the last time the zz_deepcopy.go file was changed was 0.30.1, but resetting the go.mod version to that results in other errors.

I have fixed the one lint finding that was introduced by one of my changes and also ran make manifests which I neglected to do the first time, but beyond that, let me know how you would like me to proceed.

(As a piece of totally unsolicited advice, from one operator maintainer to another, putting needed tool versions in the go.mod via go get -tool, available since go 1.24, makes problems like this go away, as does running make generate and make manifests in CI and verifying the outputs have not changed)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.

@github-actions github-actions bot added the Stale label Mar 3, 2026
@meln5674
Copy link
Copy Markdown
Author

meln5674 commented Mar 8, 2026

Unstale. Awaiting response.

@github-actions github-actions bot removed the Stale label Mar 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.

@github-actions github-actions bot added the Stale label Mar 25, 2026
@meln5674
Copy link
Copy Markdown
Author

Unstale. Awaiting response.

@github-actions github-actions bot removed the Stale label Mar 26, 2026
@alvneiayu
Copy link
Copy Markdown
Collaborator

I will take it a look because other PRs are not having problems with the linters. Looks like something is bumped and it is causing the problem in this PR. I will take it a look ASAP. Thanks @meln5674

@alvneiayu alvneiayu added the triage Issues/PRs that need to be reviewed label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Issues/PRs that need to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selectively omit encryptedData keys when using templates

2 participants