Skip to content

Fix: preserve SendInitialEvents in ListOptions for K8s v0.36.0 compatibility#1836

Merged
sameerforge merged 2 commits into
carvel-dev:developfrom
sameerforge:topic/sameerkh/fix-watchlist-client
Jun 17, 2026
Merged

Fix: preserve SendInitialEvents in ListOptions for K8s v0.36.0 compatibility#1836
sameerforge merged 2 commits into
carvel-dev:developfrom
sameerforge:topic/sameerkh/fix-watchlist-client

Conversation

@sameerforge

@sameerforge sameerforge commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Fixes carvel-dev/kapp-controller/issues#1837

Summary

Fixes a 422 Unprocessable Entity validation error triggered by the upgrade to Kubernetes libraries v0.36.0+. Additionally updates golang.org/x/crypto to the latest version.

Background

The upgrade of embedded Kubernetes libraries to v0.36.0 enabled the WatchList feature gate by default. This change forces strict validation on watch requests, specifically requiring the SendInitialEvent field to be set when ResourceVersionMatch is NotOlderThan.

The Issue

The custom translation logic in the packaging API handlers was silently dropping the SendInitialEvents pointer during the conversion from internalversion.ListOptions to metav1.ListOptions. This resulted in the K8s API server rejecting requests with a 422 Unprocessable Entity error, breaking pipelines.

The Fix

  • Registry Handlers: Explicitly map the SendInitialEvents pointer in internalToMetaListOpts within both the Package and PackageMetadata REST registry handlers. Added unit tests to verify that these options are correctly propagated to the client.
  • Dependencies: Bumped golang.org/x/crypto to the latest version in both the root go.mod and cli/go.mod to ensure compatibility and security.

Test Coverage

  • Added TestWatchListOptionsConversion (Package) ✅
  • Added TestPackageMetadataWatchListOptionsConversion (PackageMetadata) ✅
  • Verified local test suite execution: PASS ✅

Validation & Compatibility Matrix

To ensure absolute backward compatibility and stability across our support window following the v0.36.0 library upgrades, the complete test suite (Unit, Validation, and E2E integration tests) was successfully executed against the following Kubernetes environments:

Test Job Target Platform Resolved K8s Version Status
test-gh / Run all tests link Minikube (Docker) v1.32.13 ✅ Passed
test-gh / Run all tests link Minikube (Docker) v1.33.12 ✅ Passed
test-gh / Run all tests link Minikube (Docker) v1.34.8 ✅ Passed
test-gh / Run all tests link Minikube (Docker) v1.35.5 ✅ Passed
test-gh / Run all tests link Minikube (Docker) v1.36.1 ✅ Passed
Kind Cluster E2E tests link Kind (kinder) v1.36.x ✅ Passed

This comprehensive multi-version verification guarantees that kapp-controller safely supports legacy enterprise baselines while remaining completely ready for cutting-edge native v1.36 control planes.

…ibility

Signed-off-by: Sameer <sameer.khan@broadcom.com>
Signed-off-by: Sameer <sameer.khan@broadcom.com>
@sameerforge sameerforge changed the title fix: preserve SendInitialEvents in ListOptions for K8s v0.36.0 compat… Fix: preserve SendInitialEvents in ListOptions for K8s v0.36.0 compat… Jun 17, 2026
@sameerforge sameerforge changed the title Fix: preserve SendInitialEvents in ListOptions for K8s v0.36.0 compat… Fix: preserve SendInitialEvents in ListOptions for K8s v0.36.0 compatibility Jun 17, 2026
@sameerforge sameerforge requested a review from praveenrewar June 17, 2026 08:08
@sameerforge

Copy link
Copy Markdown
Contributor Author

Validation & Compatibility Matrix

To ensure absolute backward compatibility and stability across our support window following the v0.36.0 library upgrades, the complete test suite (Unit, Validation, and E2E integration tests) was successfully executed against the following Kubernetes environments:

Test Job Target Platform Resolved K8s Version Status
test-gh / Run all tests link Minikube (Docker) v1.32.13 ✅ Passed
test-gh / Run all tests link Minikube (Docker) v1.33.12 ✅ Passed
test-gh / Run all tests link Minikube (Docker) v1.34.8 ✅ Passed
test-gh / Run all tests link Minikube (Docker) v1.35.5 ✅ Passed
test-gh / Run all tests link Minikube (Docker) v1.36.1 ✅ Passed
Kind Cluster E2E tests link Kind (kinder) v1.36.x ✅ Passed

This comprehensive multi-version verification guarantees that kapp-controller safely supports legacy enterprise baselines while remaining completely ready for cutting-edge native v1.36 control planes.

@praveenrewar praveenrewar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good mostly, could you validate this one thing and then we should be good to go.

Comment thread pkg/apiserver/registry/datapackaging/package_crd_rest.go
@sameerforge sameerforge merged commit 7219295 into carvel-dev:develop Jun 17, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this to Closed in Carvel Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Watch requests fail with 422 Unprocessable Entity after K8s v0.36.0 library upgrade due to missing SendInitialEvents propagation

3 participants