Skip to content

🐛 OCPBUGS-85508: fix chunked storage ChunkSize to fit within Kubernetes Secret limit#2702

Open
joelanford wants to merge 1 commit into
operator-framework:mainfrom
joelanford:fix-OCPBUGS-85508
Open

🐛 OCPBUGS-85508: fix chunked storage ChunkSize to fit within Kubernetes Secret limit#2702
joelanford wants to merge 1 commit into
operator-framework:mainfrom
joelanford:fix-OCPBUGS-85508

Conversation

@joelanford
Copy link
Copy Markdown
Member

@joelanford joelanford commented May 13, 2026

Description

The chunked Helm release storage driver set ChunkSize to exactly 1MB (1,048,576 bytes),
which is also the Kubernetes Secret data limit. The index Secret stores both the first chunk
(Data["chunk"]) and a JSON list of extra chunk names (Data["extraChunks"]), so any release
requiring chunking exceeded the 1MB limit and failed:

Secret "sh.helm.release.v1.odf-operator.v1" is invalid:
  data: Too long: may not be more than 1048576 bytes

Jira: https://redhat.atlassian.net/browse/OCPBUGS-85508

This PR:

  • Reduces ChunkSize from 1024 * 1024 to (1024 - 8) * 1024, leaving 8KB headroom for the extraChunks field
  • Increases MaxReadChunks and MaxWriteChunks from 10 to 11 to maintain total capacity above the previous theoretical maximum
  • Adds an envtest-based regression test that stores a max-capacity release (filling all 11 chunks) through the real chunked storage driver against a real API server, then verifies the round-trip and that the first 10 chunks are at ChunkSize
  • Adds static tests to guard against future regressions in total capacity, chunk limits, and read/write symmetry

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

🤖 Generated with Claude Code via /jira:solve OCPBUGS-85508

Copilot AI review requested due to automatic review settings May 13, 2026 17:28
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 13, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 0e609d2
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6a04c406e23f8f00082fe4b1
😎 Deploy Preview https://deploy-preview-2702--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@joelanford joelanford changed the title OCPBUGS-85508: fix chunked storage ChunkSize to fit within Kubernetes Secret limit 🐛 OCPBUGS-85508: fix chunked storage ChunkSize to fit within Kubernetes Secret limit May 13, 2026
@joelanford joelanford marked this pull request as ready for review May 13, 2026 17:32
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2026
@openshift-ci openshift-ci Bot requested review from ankitathomas and tmshort May 13, 2026 17:32
Copy link
Copy Markdown
Contributor

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

This PR fixes Helm release chunked Secret storage exceeding the Kubernetes 1MiB Secret .data limit by reducing per-chunk size and adjusting chunk count limits, and adds regression tests to prevent the issue from returning.

Changes:

  • Reduce ChunkSize for chunked Secret storage to leave headroom for the index Secret’s extraChunks field.
  • Increase MaxReadChunks/MaxWriteChunks to preserve (and slightly increase) total storage capacity.
  • Add envtest-based and static regression tests around chunk sizing, capacity, and read/write symmetry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
internal/operator-controller/action/storagedriver.go Introduces a shared chunked Secret config with smaller ChunkSize and higher chunk limits, applied when constructing the Helm storage driver.
internal/operator-controller/action/storagedriver_test.go Adds regression coverage for capacity invariants and an envtest round-trip that exercises max-capacity chunking behavior.
internal/operator-controller/action/action_test.go Adds package-level envtest TestMain to provide a real API server for the new storage driver integration test.

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

Comment thread internal/operator-controller/action/storagedriver_test.go
Comment thread internal/operator-controller/action/storagedriver_test.go
Comment thread internal/operator-controller/action/storagedriver_test.go
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.07%. Comparing base (869124a) to head (0e609d2).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2702      +/-   ##
==========================================
- Coverage   68.10%   68.07%   -0.03%     
==========================================
  Files         145      145              
  Lines       10700    10698       -2     
==========================================
- Hits         7287     7283       -4     
- Misses       2885     2886       +1     
- Partials      528      529       +1     
Flag Coverage Δ
e2e 36.84% <100.00%> (-0.30%) ⬇️
experimental-e2e 52.54% <100.00%> (+0.08%) ⬆️
unit 53.77% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joelanford joelanford force-pushed the fix-OCPBUGS-85508 branch from 3a30af1 to 03de71e Compare May 13, 2026 18:20
Copilot AI review requested due to automatic review settings May 13, 2026 18:27
@joelanford joelanford force-pushed the fix-OCPBUGS-85508 branch from 03de71e to 1fc83a2 Compare May 13, 2026 18:27
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread internal/operator-controller/action/storagedriver_test.go
Comment thread internal/operator-controller/action/storagedriver_test.go
@joelanford joelanford force-pushed the fix-OCPBUGS-85508 branch from 1fc83a2 to 0e0f97b Compare May 13, 2026 18:32
… limit

OCPBUGS-85508

The chunked Helm release storage driver set ChunkSize to exactly 1MB
(1,048,576 bytes), which is the Kubernetes Secret data limit. The index
Secret stores both the first chunk and a JSON list of extra chunk names
(extraChunks), so any release requiring chunking exceeded the limit:

  Secret "sh.helm.release.v1.odf-operator.v1" is invalid:
    data: Too long: may not be more than 1048576 bytes

Reduce ChunkSize to (1024-8)*1024 (1,040,384 bytes), leaving 8KB of
headroom for the extraChunks field, and increase MaxReadChunks and
MaxWriteChunks from 10 to 11 to maintain total capacity above the
previous theoretical maximum.
@joelanford joelanford force-pushed the fix-OCPBUGS-85508 branch from 0e0f97b to 0e609d2 Compare May 13, 2026 18:33
Copilot AI review requested due to automatic review settings May 13, 2026 18:33
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread internal/operator-controller/action/storagedriver_test.go
Comment thread internal/operator-controller/action/action_test.go
@tmshort
Copy link
Copy Markdown
Contributor

tmshort commented May 13, 2026

/approve

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 13, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tmshort

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2026
@grokspawn
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 13, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants