Add extensive tests and improve policy configuration handling
Some checks failed
Go / build-and-release (push) Has been cancelled

Introduce comprehensive tests for policy validation logic, including owner and policy admin scenarios. Update `HandlePolicyConfigUpdate` to differentiate permissions for owners and policy admins, enforcing stricter field restrictions and validation flows.
This commit is contained in:
2025-12-02 07:51:59 +00:00
parent dd8027478c
commit 70944d45df
8 changed files with 1627 additions and 46 deletions

View File

@@ -37,7 +37,7 @@ func TestKind3TagRoundTrip(t *testing.T) {
// Verify all tags have key "p"
pTagCount := 0
for _, tg := range *ev1.Tags {
if tag != nil && tag.Len() >= 2 {
if tg != nil && tg.Len() >= 2 {
key := tg.Key()
if len(key) == 1 && key[0] == 'p' {
pTagCount++
@@ -63,7 +63,7 @@ func TestKind3TagRoundTrip(t *testing.T) {
// Verify all tags still have key "p"
pTagCount2 := 0
for _, tg := range *ev2.Tags {
if tag != nil && tag.Len() >= 2 {
if tg != nil && tg.Len() >= 2 {
key := tg.Key()
if len(key) == 1 && key[0] == 'p' {
pTagCount2++