Skip to content

Commit

Permalink
chore: adding generateVAP field on template (#427)
Browse files Browse the repository at this point in the history
* fix: setting default value for enforcement action

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* fixing tests for create schema

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* fixing unit tests

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* adding generateVAP field

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* moving generateVAP within k8scel source

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* addressin nits

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* removing faulty path

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* refactoring assumeVAP func

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* adding to-do for constraint VAPB generation override

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* always enforcing webhook

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* removing assumption code

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* fixing lint

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* removing generate default

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* removing generate default

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* fixing lint

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

* removing not used test parameters

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>

---------

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
  • Loading branch information
JaydipGabani committed Jul 1, 2024
1 parent 5368a3b commit e11e1b0
Show file tree
Hide file tree
Showing 16 changed files with 152 additions and 406 deletions.
45 changes: 30 additions & 15 deletions constraint/deploy/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ spec:
- name: v1
schema:
openAPIV3Schema:
description: ConstraintTemplate is the Schema for the constrainttemplates API
description: ConstraintTemplate is the Schema for the constrainttemplates
API
properties:
apiVersion:
description: |-
Expand Down Expand Up @@ -75,7 +76,8 @@ spec:
items:
properties:
engine:
description: 'The engine used to evaluate the code. Example: "Rego". Required.'
description: 'The engine used to evaluate the code. Example:
"Rego". Required.'
type: string
source:
description: The source code for the template. Required.
Expand Down Expand Up @@ -110,7 +112,8 @@ spec:
properties:
errors:
items:
description: CreateCRDError represents a single error caught during parsing, compiling, etc.
description: CreateCRDError represents a single error caught
during parsing, compiling, etc.
properties:
code:
type: string
Expand All @@ -124,7 +127,8 @@ spec:
type: object
type: array
id:
description: a unique identifier for the pod that wrote the status
description: a unique identifier for the pod that wrote the
status
type: string
observedGeneration:
format: int64
Expand All @@ -143,7 +147,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: ConstraintTemplate is the Schema for the constrainttemplates API
description: ConstraintTemplate is the Schema for the constrainttemplates
API
properties:
apiVersion:
description: |-
Expand Down Expand Up @@ -201,7 +206,8 @@ spec:
items:
properties:
engine:
description: 'The engine used to evaluate the code. Example: "Rego". Required.'
description: 'The engine used to evaluate the code. Example:
"Rego". Required.'
type: string
source:
description: The source code for the template. Required.
Expand Down Expand Up @@ -236,7 +242,8 @@ spec:
properties:
errors:
items:
description: CreateCRDError represents a single error caught during parsing, compiling, etc.
description: CreateCRDError represents a single error caught
during parsing, compiling, etc.
properties:
code:
type: string
Expand All @@ -250,7 +257,8 @@ spec:
type: object
type: array
id:
description: a unique identifier for the pod that wrote the status
description: a unique identifier for the pod that wrote the
status
type: string
observedGeneration:
format: int64
Expand All @@ -269,7 +277,8 @@ spec:
- name: v1beta1
schema:
openAPIV3Schema:
description: ConstraintTemplate is the Schema for the constrainttemplates API
description: ConstraintTemplate is the Schema for the constrainttemplates
API
properties:
apiVersion:
description: |-
Expand Down Expand Up @@ -327,7 +336,8 @@ spec:
items:
properties:
engine:
description: 'The engine used to evaluate the code. Example: "Rego". Required.'
description: 'The engine used to evaluate the code. Example:
"Rego". Required.'
type: string
source:
description: The source code for the template. Required.
Expand Down Expand Up @@ -362,7 +372,8 @@ spec:
properties:
errors:
items:
description: CreateCRDError represents a single error caught during parsing, compiling, etc.
description: CreateCRDError represents a single error caught
during parsing, compiling, etc.
properties:
code:
type: string
Expand All @@ -376,7 +387,8 @@ spec:
type: object
type: array
id:
description: a unique identifier for the pod that wrote the status
description: a unique identifier for the pod that wrote the
status
type: string
observedGeneration:
format: int64
Expand Down Expand Up @@ -409,7 +421,8 @@ spec:
scope: Cluster
versions:
- deprecated: true
deprecationWarning: externaldata.gatekeeper.sh/v1alpha1 is deprecated. Use externaldata.gatekeeper.sh/v1beta1 instead.
deprecationWarning: externaldata.gatekeeper.sh/v1alpha1 is deprecated. Use externaldata.gatekeeper.sh/v1beta1
instead.
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -444,7 +457,8 @@ spec:
description: Timeout is the timeout when querying the provider.
type: integer
url:
description: URL is the url for the provider. URL is prefixed with https://.
description: URL is the url for the provider. URL is prefixed with
https://.
type: string
type: object
type: object
Expand Down Expand Up @@ -484,7 +498,8 @@ spec:
description: Timeout is the timeout when querying the provider.
type: integer
url:
description: URL is the url for the provider. URL is prefixed with https://.
description: URL is the url for the provider. URL is prefixed with
https://.
type: string
type: object
type: object
Expand Down
7 changes: 5 additions & 2 deletions constraint/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/open-policy-agent/frameworks/constraint

go 1.18
go 1.21

toolchain go1.22.2

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
Expand Down Expand Up @@ -80,8 +82,9 @@ require (
go.opentelemetry.io/otel/trace v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
Expand Down
Loading

0 comments on commit e11e1b0

Please sign in to comment.