Max Goncharenko
6d0ad5598e
Jmespath notfound error ( #1907 )
...
* return err, if variable path could not be resolved
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* fixed {{@}} behavior
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* fix json merge logic
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* add e2e tests for Flux use case
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
2021-07-01 22:56:50 -07:00
Max Goncharenko
6a0305674a
JMESPath custom functions ( #1772 )
...
* JMESPath: Support regex expressions
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* JMESPath: Add string functions
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* Removed {{$}} variable handling logic
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* Name all functions in snake case; Update error message; Fix {{@}} behavior
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-04-16 16:17:00 -07:00
Shuting Zhao
1cf8efd472
set default image registry and tag if not present
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-04-01 09:50:34 -07:00
shuting
c08843ef77
Add Images info to variables context ( #1725 )
...
* - remove supportMutateValidate; - refactor new context in the webhook
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* add ImageInfo to variables context
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* revert unexpected changes
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-03-23 10:34:03 -07:00
Jim Bugwadia
0d1f0b5897
Merge pull request #1636 from realshuting/1621_fix_configmap_variables
...
Substitute variables in context.configMap
2021-02-25 19:53:11 -08:00
Shuting Zhao
c4ebef7b0d
- support AllowMissingPathOnRemove and EnsurePathExistsOnAdd in patchesJSON6902
...
- upgrade to evanphx/json-patch/v5
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-25 15:25:07 -08:00
Shuting Zhao
d770d6680b
add request.namespace in the background process
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-22 17:22:23 -08:00
shuting
267be0815f
Bug fixes - policy validation, auto-generated rules, apiCall support in mutate and generate ( #1629 )
...
* Fix invalid policy reports generated for blocked resource
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix 1464 - copy context and preconditions to auto-gen rules
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix 1628 - add policy validations
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix 1593 - support apiCall in mutate and generate
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix test
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-22 12:08:26 -08:00
shuting
2f2d6c2e38
Upgrade client libraries to 0.20.2 ( #1547 )
...
* upgrade clients to 0.20.2
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* remove debug log
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix unit tests
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix e2e test
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-07 20:26:56 -08:00
Jim Bugwadia
0be7903c47
fix tests
...
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-02-02 00:20:03 -08:00
Jim Bugwadia
2bb812aa2d
redo changes reverted by merge
...
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-02-01 23:22:19 -08:00
Jim Bugwadia
e2f10c6f83
update validation logic
2020-12-23 15:10:07 -08:00
Jim Bugwadia
75bd8e28f5
also trim in context query
2020-11-24 17:53:19 -08:00
Jim Bugwadia
54f816c246
trim variable for context lookups
2020-11-24 17:48:54 -08:00
Shuting Zhao
b9fb926ddb
fixes for golint ./...
2020-11-17 13:07:30 -08:00
Shuting Zhao
cdc5190c56
update nirmata/kyverno to kyverno/kyverno
2020-10-07 11:12:31 -07:00
shravan
5461b63a25
744 removed uneeded comment
2020-05-13 10:27:08 +05:30
shravan
ee9b478f42
744 fixing broken tests
2020-05-06 01:08:49 +05:30
shravan
2bd484d5b8
744 fixing error message
2020-05-06 01:02:39 +05:30
shravan
1b2868620e
744 fixing tests and making sure policy with variables that are not request.object are not allowed in background mode
2020-05-06 00:29:40 +05:30
shravan
b0c7cdbc81
744 save commit
2020-05-05 19:19:47 +05:30
shravan
fc84eaaf3b
744 relocating userRequestInfo to top level variable
2020-04-29 21:02:21 +05:30
shravan
83ecd95945
744 added all request values to context
2020-04-15 21:17:14 +05:30
shivkumar dudhani
d327309d72
refactor logging
2020-03-17 16:25:34 -07:00
shivkumar dudhani
1b1ab78f77
logs & access
2020-03-17 11:05:20 -07:00
shivkumar dudhani
5cee543755
refactor variable substitution
2020-02-14 11:59:28 -08:00
shivkumar dudhani
34ad3a9a2b
generate rule processing refactoring
2020-02-10 12:44:20 -08:00
shubham
7a34378648
Adding log level 4 to "Loading variable" logs in context.go line no 124 and 139 ( #648 )
...
Type at pkg/policyviolation/namespacedev.go
2020-01-24 16:29:51 -08:00
Shivkumar Dudhani
8c1d79ab28
linter suggestions ( #655 )
...
* cleanup phase 1
* linter fixes phase 2
2020-01-24 12:05:53 -08:00
Shivkumar Dudhani
1171ac691b
cleanup phase 1 ( #653 )
2020-01-24 09:37:12 -08:00
Shuting Zhao
731fdb3e07
validate paths in variable substitution is present
2020-01-09 12:23:05 -08:00
Shivkumar Dudhani
3cf9141f4d
593 feature ( #594 )
...
* initial commit
* background policy validation
* correct message
* skip non-background policy process for add/update
* add Generate Request CR
* generate Request Generator Initial
* test generate request CR generation
* initial commit gr generator
* generate controller initial framework
* add crd for generate request
* gr cleanup controller initial commit
* cleanup controller initial
* generate mid-commit
* generate rule processing
* create PV on generate error
* embed resource type
* testing phase 1- generate resources with variable substitution
* fix tests
* comment broken test #586
* add printer column for state
* return if existing resource for clone
* set resync time to 2 mins & remove resource version check in update handler for gr
* generate events for reporting
* fix logs
* initial commit
* fix trailing quote in patch
* remove comments
* initial condition (equal & notequal)
* initial support for conditions
* initial support fo conditions in generate
* support precondition checks
* cleanup
* re-evaluate GR on namespace update using dynamic informers
* add status for generated resources
* display loaded variable SA
* support delete cleanup of generate request main resources
* fix log
* remove namespace from SA username
* support multiple variables per statement for scalar values
* fix fail variables
* add check for userInfo
* validation checks for conditions
* update policy
* refactor logs
* code review
* add openapispec for clusterpolicy preconditions
* Update documentation
* CR fixes
* documentation
* CR fixes
* update variable
* fix logs
* update policy
* pre-defined variables (serviceAccountName & serviceAccountNamespace)
* update test
2020-01-07 15:13:57 -08:00
Shivkumar Dudhani
ffd2179b03
538 ( #587 )
...
* initial commit
* background policy validation
* correct message
* skip non-background policy process for add/update
* add Generate Request CR
* generate Request Generator Initial
* test generate request CR generation
* initial commit gr generator
* generate controller initial framework
* add crd for generate request
* gr cleanup controller initial commit
* cleanup controller initial
* generate mid-commit
* generate rule processing
* create PV on generate error
* embed resource type
* testing phase 1- generate resources with variable substitution
* fix tests
* comment broken test #586
* add printer column for state
* return if existing resource for clone
* set resync time to 2 mins & remove resource version check in update handler for gr
* generate events for reporting
* fix logs
* cleanup
* CR fixes
* fix logs
2020-01-07 10:33:28 -08:00
Shivkumar Dudhani
5b8ab3842b
Support variable substitution ( #549 )
...
* initial commit
* variable substitution
* update tests
* update test
* refactor engine packages for validate & generate
* update vendor
* update toml
* support variable substitution in overlay mutation
* missing update
* fix indentation in logs
* store context values as single JSON document using merge patches.
* remove duplicate functions
* fix message string
* Handle processing of policies in background (#569 )
* remove condition check while generating mutation patch as conditions are verified in the first iteration
* initial commit
* background policy validation
* correct message
* skip non-background policy process for add/update
* fix order to correct policy registration
* update comment
Co-authored-by: shuting <shutting06@gmail.com>
* refactor
Co-authored-by: shuting <shutting06@gmail.com>
2019-12-30 17:08:50 -08:00