Skip to content

Add comprehensive unit tests covering CRR #2348

@Kunal1522

Description

@Kunal1522

Description

The ContainerRecreateRequest (CRR) controller currently has no unit test coverage, despite containing complex reconciliation logic with multiple timeout scenarios, state transitions, and edge cases.

Current State

pkg/controller/containerrecreaterequest/
├── crr_controller.go         (333 lines - 0% test coverage)
├── crr_event_handler.go      (97 lines - 0% test coverage)
└── NO TEST FILES             ❌

Why This Matters

The CRR controller handles critical production scenarios:

  1. Timeout handling - Response timeout (1min), active deadline, TTL cleanup
  2. Pod lifecycle coordination - Handles pod deletion, UID mismatches during reconciliation
  3. Readiness gate management - Controls traffic flow during container restarts
  4. Finalizer cleanup - Prevents resource leaks
  5. Container status synchronization - Tracks restart progress

Proposed Solution

Add comprehensive unit tests covering

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions