Files
hwanandGitHub dc5674c12b Fix: enforce TraitDefinition conflictsWith at admission (#7303)
* fix: enforce TraitDefinition conflictsWith at admission

Validate attached traits in the Application webhook using
GetCapabilityDefinition so namespaced and revisioned TraitDefinitions
are resolved correctly. Keep the check outside ValidateComponents so it
still runs under sharding.

Signed-off-by: Junhuan Zheng <3373484735@qq.com>

* fix: address cubic review on trait conflict validation

Fail closed on definition lookup errors, compare API groups exactly for
*.group rules, and simplify conflict test object setup.

Signed-off-by: hwan <3373484735@qq.com>

* test: reuse baseObjects for crd conflict case

Avoid duplicating the TraitDefinition fixture list in the
crd-name conflict test case.

Signed-off-by: hwan <3373484735@qq.com>

* fix: convert conflict tests to Ginkgo and log lookup failures

Address maintainer feedback by rewriting trait conflict tests in
Ginkgo and logging TraitDefinition resolution errors when failing closed.

Signed-off-by: hwan <3373484735@qq.com>

* style: gofmt the trait conflict test var block

gofmt aligns the variable declarations in the ValidateTraitConflicts test block so the repo's reviewable check passes.

Signed-off-by: Junhuan Zheng <3373484735@qq.com>

---------

Signed-off-by: Junhuan Zheng <3373484735@qq.com>
Signed-off-by: hwan <3373484735@qq.com>
2026-08-13 11:34:20 +01:00
..