Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <[email protected]>
  • Loading branch information
Frank Jogeleit committed Nov 9, 2023
1 parent e296bfe commit f2c24d3
Show file tree
Hide file tree
Showing 6 changed files with 325 additions and 412 deletions.
209 changes: 93 additions & 116 deletions backend/go.mod

Large diffs are not rendered by default.

489 changes: 206 additions & 283 deletions backend/go.sum

Large diffs are not rendered by default.

20 changes: 13 additions & 7 deletions backend/pkg/engine/mocks/toggles.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ package mocks
import "github.com/kyverno/kyverno/pkg/toggle"

type toggles struct {
protectManagedResources bool
forceFailurePolicyIgnore bool
enableDeferredLoading bool
protectManagedResources bool
forceFailurePolicyIgnore bool
enableDeferredLoading bool
generateValidatingAdmissionPolicy bool
}

func Toggles(protectManagedResources, forceFailurePolicyIgnore, enableDeferredLoading bool) toggle.Toggles {
func Toggles(protectManagedResources, forceFailurePolicyIgnore, enableDeferredLoading, generateValidatingAdmissionPolicy bool) toggle.Toggles {
return toggles{
protectManagedResources: protectManagedResources,
forceFailurePolicyIgnore: forceFailurePolicyIgnore,
enableDeferredLoading: enableDeferredLoading,
protectManagedResources: protectManagedResources,
forceFailurePolicyIgnore: forceFailurePolicyIgnore,
enableDeferredLoading: enableDeferredLoading,
generateValidatingAdmissionPolicy: generateValidatingAdmissionPolicy,
}
}

Expand All @@ -27,3 +29,7 @@ func (t toggles) ForceFailurePolicyIgnore() bool {
func (t toggles) EnableDeferredLoading() bool {
return t.enableDeferredLoading
}

func (t toggles) GenerateValidatingAdmissionPolicy() bool {
return t.generateValidatingAdmissionPolicy
}
13 changes: 7 additions & 6 deletions backend/pkg/engine/models/flags.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package models

type Flags struct {
Exceptions Exceptions `json:"exceptions"`
Cosign Cosign `json:"cosign"`
Registry Registry `json:"registry"`
ProtectManagedResources ProtectManagedResources `json:"protectManagedResources"`
ForceFailurePolicyIgnore ForceFailurePolicyIgnore `json:"forceFailurePolicyIgnore"`
EnableDeferredLoading EnableDeferredLoading `json:"enableDeferredLoading"`
Exceptions Exceptions `json:"exceptions"`
Cosign Cosign `json:"cosign"`
Registry Registry `json:"registry"`
ProtectManagedResources ProtectManagedResources `json:"protectManagedResources"`
ForceFailurePolicyIgnore ForceFailurePolicyIgnore `json:"forceFailurePolicyIgnore"`
EnableDeferredLoading EnableDeferredLoading `json:"enableDeferredLoading"`
GenerateValidatingAdmissionPolicy GenerateValidatingAdmissionPolicy `json:"generateValidatingAdmissionPolicy"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package models

type GenerateValidatingAdmissionPolicy struct {
Enabled bool `json:"enabled"`
}
1 change: 1 addition & 0 deletions backend/pkg/engine/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (p *Processor) Run(
p.params.Flags.ProtectManagedResources.Enabled,
p.params.Flags.ForceFailurePolicyIgnore.Enabled,
p.params.Flags.EnableDeferredLoading.Enabled,
p.params.Flags.GenerateValidatingAdmissionPolicy.Enabled,
))
if violations := validatePolicies(policies); len(violations) > 0 {
return nil, PolicyViolationError{Violations: violations}
Expand Down

0 comments on commit f2c24d3

Please sign in to comment.