mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-20 16:19:33 +00:00
Add TestBitFlipCorruptObjectDeletion to exercise the decoder error path for KEP-3926 using Secrets (protobuf encoding). Unlike the existing TestAllowUnsafeMalformedObjectDeletionFeature which tests transformer errors (wrong encryption key), this test uses identity encryption and corrupts stored bytes directly in etcd, triggering "undecodable" errors at the protobuf decoder layer. The informer is given an extended timeout (2 minutes) after deletion to recover from the exponential backoff accumulated during the corruption window. The reflector's backoff caps at [30s, 60s) with jitter, so 2 minutes provides sufficient leeway. The gate=false subtest is skipped because writing corrupt bytes directly to etcd emits a watch event that the cacher cannot decode, breaking its watch. Without the feature gate, the subsequent re-list aborts on the first decode error (abortOnFirstError aggregator), so the cacher never recovers and GET requests hang. This differs from the encryption-config swap tests where no etcd data changes and no watch event is emitted. This is a known issue to be addressed separately.