Skip to content

OCPBUGS-62611: Fix editing secrets with mixed text and binary data#15820

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
TheRealJon:OCPBUGS-62611
Jan 12, 2026
Merged

OCPBUGS-62611: Fix editing secrets with mixed text and binary data#15820
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
TheRealJon:OCPBUGS-62611

Conversation

@TheRealJon
Copy link
Member

When a secret contained both text and binary values, the edit form would fail due to a runtime error. The stringData initialization was returning null when any binary field was detected, breaking text field handling.

Now binary fields are skipped during stringData initialization while text fields are preserved, allowing proper editing of mixed-type secrets.

🤖 Generated with Claude Code

When a secret contained both text and binary values, the edit form would
fail due to a runtime error. The stringData initialization was returning
null when any binary field was detected, breaking text field handling.

Now binary fields are skipped during stringData initialization while text
fields are preserved, allowing proper editing of mixed-type secrets.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 8, 2025
@openshift-ci-robot
Copy link
Contributor

@TheRealJon: This pull request references Jira Issue OCPBUGS-62611, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

When a secret contained both text and binary values, the edit form would fail due to a runtime error. The stringData initialization was returning null when any binary field was detected, breaking text field handling.

Now binary fields are skipped during stringData initialization while text fields are preserved, allowing proper editing of mixed-type secrets.

🤖 Generated with Claude Code

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added component/core Related to console core functionality approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 8, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Walkthrough

A reduce callback in SecretFormWrapper.tsx previously returned null when encountering binary values, potentially corrupting the accumulator. The fix returns the accumulator unchanged for binary values instead of null, while preserving existing Base64 decoding logic for non-binary values.

Changes

Cohort / File(s) Change Summary
Bug Fix in Binary Value Handling
frontend/public/components/secrets/create-secret/SecretFormWrapper.tsx
Modified reduce callback to return accumulator unchanged when encountering binary values instead of returning null, preventing premature termination or corruption of the accumulation object.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the fix correctly handles binary values without side effects
  • Confirm the change doesn't introduce regressions in decoding logic for non-binary values
  • Check if test coverage exists for binary value scenarios in secret form handling
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 370e6b0 and 601c171.

📒 Files selected for processing (1)
  • frontend/public/components/secrets/create-secret/SecretFormWrapper.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/public/components/secrets/create-secret/SecretFormWrapper.tsx
🔇 Additional comments (1)
frontend/public/components/secrets/create-secret/SecretFormWrapper.tsx (1)

60-68: Critical fix correctly resolves runtime error.

The change on line 63 fixes a critical bug where returning null for binary values would corrupt the reduce accumulator, causing subsequent iterations to fail when attempting acc[key] = ... on line 65. Returning acc unchanged correctly skips binary entries while preserving text field decoding, enabling editing of secrets with mixed text and binary data.


Comment @coderabbitai help to get the list of available commands and usage tips.

@TheRealJon
Copy link
Member Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 8, 2025
@openshift-ci-robot
Copy link
Contributor

@TheRealJon: This pull request references Jira Issue OCPBUGS-62611, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from yapei December 8, 2025 17:01
@TheRealJon
Copy link
Member Author

/retest

Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

👍
/lgtm

@jhadvig
Copy link
Member

jhadvig commented Dec 15, 2025

/retest

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

openshift-ci bot commented Dec 15, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, TheRealJon

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

The pull request process is described here

Details 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

@TheRealJon
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

@openshift-ci-robot openshift-ci-robot added jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. and removed jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jan 1, 2026
@openshift-ci-robot
Copy link
Contributor

@openshift-bot: This pull request references Jira Issue OCPBUGS-62611, which is invalid:

  • expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "4.21.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

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 openshift-eng/jira-lifecycle-plugin repository.

@TheRealJon
Copy link
Member Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 5, 2026
@openshift-ci-robot
Copy link
Contributor

@TheRealJon: This pull request references Jira Issue OCPBUGS-62611, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@Leo6Leo
Copy link
Contributor

Leo6Leo commented Jan 5, 2026

/verified by @Leo6Leo

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jan 5, 2026
@openshift-ci-robot
Copy link
Contributor

@Leo6Leo: This PR has been marked as verified by @Leo6Leo.

Details

In response to this:

/verified by @Leo6Leo

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 24830e3 and 2 for PR HEAD 601c171 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD d00353d and 1 for PR HEAD 601c171 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 9c70ba0 and 0 for PR HEAD 601c171 in total

@openshift-ci-robot
Copy link
Contributor

/hold

Revision 601c171 was retested 3 times: holding

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 6, 2026
@TheRealJon
Copy link
Member Author

/retest

@logonoff
Copy link
Member

/unhold
/retest

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 11, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 12, 2026

@TheRealJon: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit d300abc into openshift:main Jan 12, 2026
8 checks passed
@openshift-ci-robot
Copy link
Contributor

@TheRealJon: Jira Issue Verification Checks: Jira Issue OCPBUGS-62611
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-62611 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

When a secret contained both text and binary values, the edit form would fail due to a runtime error. The stringData initialization was returning null when any binary field was detected, breaking text field handling.

Now binary fields are skipped during stringData initialization while text fields are preserved, allowing proper editing of mixed-type secrets.

🤖 Generated with Claude Code

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.22.0-0.nightly-2026-01-14-031657

@TheRealJon
Copy link
Member Author

/jira backport release-4.21
/jira backport release-4.20
/jira backport release-4.19

@openshift-ci-robot
Copy link
Contributor

@TheRealJon: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.21

Details

In response to this:

/jira backport release-4.21
/jira backport release-4.20
/jira backport release-4.19

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

@TheRealJon: Missing required branches for backport chain:

  • openshift-4.21 OR release-4.21,
Details

In response to this:

/jira backport release-4.21
/jira backport release-4.20
/jira backport release-4.19

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

@TheRealJon: Missing required branches for backport chain:

  • release-4.20 OR openshift-4.20,
Details

In response to this:

/jira backport release-4.21
/jira backport release-4.20
/jira backport release-4.19

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-cherrypick-robot

@openshift-ci-robot: new pull request created: #16060

Details

In response to this:

@TheRealJon: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.21

In response to this:

/jira backport release-4.21
/jira backport release-4.20
/jira backport release-4.19

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 openshift-eng/jira-lifecycle-plugin repository.

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.

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. component/core Related to console core functionality jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants