Files
kubevela/pkg/controller/core.oam.dev
Brian Kane 0f5add7902 feat: implement config.enabled for Policy API redesign (Part 3)
Part 3 of Policy API Redesign - updated both tests and implementation:

**Test changes (policy_transforms_test.go):**
- Updated all 25 PolicyDefinition templates to use new API syntax
- Old: `enabled: true` at root level
- New: `config: { enabled: true }`

**Implementation changes (policy_transforms.go):**
- Added PolicyConfig struct with enabled and cacheDuration fields
- Updated extractEnabled() to support both new and old API:
  - Tries config.enabled first (new API)
  - Falls back to root enabled (old API, backwards compatible)
  - Defaults to true if neither exists

**Testing:**
- Tests now pass with new API syntax
- Backwards compatibility maintained for old API
- TDD approach: updated tests first, then implementation

**Next:**
- Part 4: Per-output-type refresh control (config.refresh)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-17 09:41:52 +00:00
..
2021-04-11 21:00:14 +08:00