Skip to content

Conversation

zimnx
Copy link
Contributor

@zimnx zimnx commented Aug 8, 2025

Description of the change:

When generating ConfigMap keys from OLM bundle filenames, colons (:) were being replaced with tildes (~). However, ~ is not a valid character for ConfigMap keys, leading to errors like:

binaryData[scylladb~controller~aggregate-to-operator_rbac.authorization.k8s.io_v1_clusterrole.yaml]: Invalid value: "...": a valid config key must consist of alphanumeric characters, '-', '_' or '.' (regex: '[-._a-zA-Z0-9]+')

This commit fixes the issue by replacing : with hyphens (-) instead, which are allowed in ConfigMap keys. For example:

  • Before: scylladb:controller:aggregate-to-operator...scylladb~controller~aggregate-to-operator... (invalid)
  • After: scylladb:controller:aggregate-to-operator...scylladb-controller-aggregate-to-operator... (valid)

Motivation for the change:

This ensures all generated ConfigMap keys conform to Kubernetes naming requirements.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

Closes #1741

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 8, 2025
Copy link
Contributor

openshift-ci bot commented Aug 8, 2025

Hi @zimnx. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@zimnx zimnx changed the title Fix invalid ConfigMap key by replacing Fix invalid ConfigMap key Aug 8, 2025
When generating ConfigMap keys from OLM bundle filenames, colons (`:`) were being replaced with tildes (`~`). However, `~` is not a valid character for ConfigMap keys, leading to errors like:
```
binaryData[scylladb~controller~aggregate-to-operator_rbac.authorization.k8s.io_v1_clusterrole.yaml]: Invalid value: "...": a valid config key must consist of alphanumeric characters, '-', '_' or '.' (regex: '[-._a-zA-Z0-9]+')
```

This commit fixes the issue by replacing `:` with hyphens (`-`) instead, which are allowed in ConfigMap keys. For example:

* Before: `scylladb:controller:aggregate-to-operator...` →  `scylladb~controller~aggregate-to-operator...` (invalid)
* After:  `scylladb:controller:aggregate-to-operator...` →  `scylladb-controller-aggregate-to-operator...` (valid)

This ensures all generated ConfigMap keys conform to Kubernetes naming requirements.
@zimnx zimnx force-pushed the fix-cm-invalid-character branch from 46a74a1 to 5813ca9 Compare August 8, 2025 13:52
@zimnx zimnx changed the title Fix invalid ConfigMap key Fix invalid ConfigMap key translation Aug 8, 2025
@zimnx
Copy link
Contributor Author

zimnx commented Aug 13, 2025

@grokspawn
@rashmigottipati

Kind reminder about this PR, thanks!

@grokspawn
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 18, 2025
@grokspawn
Copy link
Contributor

Thanks for the PR, @zimnx!

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 18, 2025
Copy link
Contributor

openshift-ci bot commented Aug 18, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit b5c503a into operator-framework:master Aug 18, 2025
11 checks passed
@zimnx zimnx deleted the fix-cm-invalid-character branch August 19, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConfigMapWriter use keys having forbidden characters
2 participants