Ved Ratan
367156f60b
[Chore] Bump to Go 1.20 ( #6683 )
...
* changed go version 1.19->1.20
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* updated go version in actions
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* bumped golangci-lint
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* fix
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* fix conflicts
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* fix
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* fixed some linter issues
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* fixed some linter issues
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* possible fix
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* fix
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* small fix
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
* fix
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
---------
Signed-off-by: Ved Ratan <vedratan8@gmail.com>
Signed-off-by: Ved Ratan <82467006+VedRatan@users.noreply.github.com>
2023-04-03 11:40:47 +00:00
Charles-Edouard Brétéché
1e30aacbd9
fix: replace more refect.DeepEqual ( #6674 )
...
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-24 10:01:49 +00:00
Charles-Edouard Brétéché
4475a0adca
refactor: engine pattern package and add duration support ( #5958 )
...
* refactor: engine pattern package and add duration support
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
* fix
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
* logger
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-01-10 14:07:26 +01:00
cleverhu
62cc95e721
fix AllNotIn operator ( #5636 )
...
Signed-off-by: cleverhu <shouping.hu@daocloud.io>
Signed-off-by: cleverhu <shouping.hu@daocloud.io>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-12-13 09:52:16 +00:00
Charles-Edouard Brétéché
fc1a4601a7
refactor: introduce wildcard utils package ( #4406 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-08-25 05:23:01 +00:00
Charles-Edouard Brétéché
144985ee5a
chore: fix golangcilint timeout ( #4388 )
...
* chore: fix golangcilint timeout
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix commit sha
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* add .gitattributes
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-08-24 21:08:24 +08:00
Anutosh Bhat
d92e16526f
Added appropriate logging levels to log.Info() calls wherever necessary ( #4341 )
...
* Added appropriate logging levels to log.Info() calls wherever necessary
Signed-off-by: anutosh491 <andersonbhat491@gmail.com>
* Changed logging levels to 2
Signed-off-by: anutosh491 <andersonbhat491@gmail.com>
Signed-off-by: anutosh491 <andersonbhat491@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-08-18 13:24:59 +00:00
Charles-Edouard Brétéché
5aaf2d8770
chore: make kyverno api import aliases consistent ( #3939 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-17 13:12:43 +02:00
Charles-Edouard Brétéché
0099ef54ad
chore: enable gofmt and gofumpt linters ( #3931 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-17 06:19:03 +00:00
Charles-Edouard Brétéché
c12f94d6d4
chore: enble gci linter ( #3930 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-05-17 07:56:48 +02:00
Charles-Edouard Brétéché
f508e9a0b8
chore: add unconvert linter ( #3867 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-10 20:28:45 +01:00
Charles-Edouard Brétéché
97e5e64fd4
chore: enable whitespace linter ( #3864 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-05-10 17:01:29 +00:00
Sambhav Kothari
25badfe4fb
Fix regression in wildcard matches in In/AnyIn operators ( #3686 )
...
Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-04-26 18:03:05 +00:00
Charles-Edouard Brétéché
cbf93ff004
fix: pass logger by value ( #3666 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-04-25 11:51:49 +00:00
silenceper
d97258654f
fix wildcards in value arrays ( #3486 )
...
Signed-off-by: silenceper <silenceper@gmail.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-04-01 10:42:07 +00:00
shuting
d1bf3d4742
clean up dependencies ( #3469 )
...
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-03-25 08:40:25 +00:00
Vyankatesh Kudtarkar
0a5aad39cf
Fix foreach validations precondition issue ( #3228 )
...
* fix foreach validations precondition issue
* added test-cases
2022-02-18 09:11:41 +00:00
Sambhav Kothari
a1daf167e7
Fix parsing of resources in preconditions ( #3108 )
...
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-01-31 08:18:31 -08:00
Anushka Mittal
3089edafa4
Extend new operators ( #2788 )
...
* extending new operators
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* Changes in file names
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* tests added
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* removed print statements
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* Changes to reduce code redundancy
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* Minor corrections in anyin and allin
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* added correction for anynotin and allnotin
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
2022-01-04 17:37:00 +00:00
Abhinav Sinha
2cd988a153
Added validation for Condition Operators ( #2864 )
...
* Added validation for Condition Operators
Signed-off-by: Abhinav Sinha <zeborg3@gmail.com>
* Updated description of `Condition.Operator` with all current valid condition operators`
Signed-off-by: Abhinav Sinha <zeborg3@gmail.com>
* Added `ConditionOperators` map and updated existing `ConditionOperator` type references
Signed-off-by: Abhinav Sinha <zeborg3@gmail.com>
2021-12-28 15:12:31 +00:00
Naman Lakhwani
898520b7cf
add semver_compare
JMESPath function ( #2846 )
...
* add semver_compare JMESPath function
Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
* adding tests for semver_compare
Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
* enabling version compaision via regular operators
Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
* adding tests for version compaision via regular operators
Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
* removing unnecessary switch cases
Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2021-12-21 08:12:35 -08:00
Anushka Mittal
94395ac243
Wildcard values ( #2692 )
...
* wildcard-support
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* Added unit tests
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* improvements in anyin and allin
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
2021-11-15 15:02:46 +01:00
Anushka Mittal
497514fd94
Fixes in new operators ( #2704 )
...
* fixes in operators to in many-to-one comparison
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* corrected allnotin
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* correction for duplicates
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
2021-11-12 11:15:16 +01:00
Jose Armesto
831a9826d1
Restructure project to follow standards ( #2632 )
...
Signed-off-by: Jose Armesto <github@armesto.net>
2021-10-29 18:13:20 +02:00
Marcus Noble
1966c82c6d
Fix various go lint issues ( #2639 )
...
* Fix various go lint issues
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
* Fix if mistake
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
* Simplified returns
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-10-29 17:06:03 +02:00
Marcus Noble
604c0408c6
Refactored operator tests to use test cases ( #2620 )
...
Identified several situations where operators didn't return the expected result (mainly around different types) so fixed those to make all tests cases pass.
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-10-29 10:54:51 +02:00
Anushka Mittal
08a3087100
New operators ( #2543 )
...
* added anyin operator
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* allin, anynotin, allnotin added
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* added operator handler info
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* fixes typos and variable names
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* reusing code from in.go in new operators
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* Added more test cases for new operators
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* updated openapiv3schema
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* matching logic
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
* added deprecated tag for In and NotIn
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
2021-10-26 17:29:42 -07:00
Marcus Noble
913bbd567a
Handle durations with standard comparison operators ( #2569 )
...
* Handle durations with standard comparison operators
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
* Fix error strings
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
* Added CLI tests for duration operations
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
* Added tests with different units
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-10-22 12:41:25 -07:00
Marcus Noble
509f561d67
Added support for comparing resource quantities
...
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-10-19 15:22:26 +01:00
Bricktop
2d0df77963
Format error messages correctly ( #2519 )
...
* Format error messages correctly
Signed-off-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
* No punctuation at the end or errors
Signed-off-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
* Replace loop with simple if
Signed-off-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
* Fix more errors
Signed-off-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
2021-10-12 14:29:20 -07:00
treydock
8204028009
Add DurationOperator to handle duration comparison operations ( #2214 )
...
Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
2021-07-30 13:11:52 -07:00
Max Goncharenko
903963c26d
add special variable substitution logic for preconditions ( #1930 )
...
* add special variable substitution logic for preconditions
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* handle NotFoundVariable error in proper way
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* remove excess log; fix grammar
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* removed isPrecondition flag; added test case for empty deny string; fixed related issue
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* fix test case
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* fix go lint
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* fix tests
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
2021-07-28 09:54:50 -07:00
Vineeth Reddy
eeb4e4ff0f
turn preconditions error to info log ( #1926 )
...
* turn preconditions error to info log
Signed-off-by: vineethvanga18 <reddy.8@iitj.ac.in>
* minor change
Signed-off-by: vineethvanga18 <reddy.8@iitj.ac.in>
* further changes
Signed-off-by: vineethvanga18 <reddy.8@iitj.ac.in>
* resolve conflicts
Signed-off-by: vineethvanga18 <reddy.8@iitj.ac.in>
* add precondition flag
Signed-off-by: vineethvanga18 <reddy.8@iitj.ac.in>
* NotFoundError -> Info
Signed-off-by: vineethvanga18 <reddy.8@iitj.ac.in>
2021-07-07 17:37:44 +05:30
Arsh Sharma
7e9be24d90
updating minio verison ( #1956 )
2021-06-09 19:16:26 -07:00
Shuting Zhao
7502e5da98
fix variable substitution in NumericOperatorHandler
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-03-18 13:40:14 -07:00
Joshua Snider
9377f70840
Change isNotIn
...
Signed-off-by: Joshua Snider <jsnider@mtu.edu>
2021-03-16 14:26:41 -04:00
Arsh Sharma
1dfcef1cc8
fix: changed logic for In and NotIn for sets ( #1704 )
...
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
2021-03-15 12:59:24 -07:00
Arsh Sharma
86879bd267
feat(operators): supporting subset checking ( #1613 )
...
* fix(operators): supporting subset checking
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* fix(operators): removed print statement
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* test(operators): added test file for in
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* fix(operators): fixed switching
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* tests(operators): completed tests for In and NotIn
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* chore(operators): code cleanup
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* chore(operators): added comments for tests
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* fix(operators): changed logic based on new definitions
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* test: updated NotIn tests
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
2021-02-26 10:53:54 -08:00
Arsh Sharma
596bc9ba6f
feat(operators): support subset checking for in and notin ( #1555 )
...
* feat(operators): support subset checking for in and notin
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* feat(operators): fixed NotIn function
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
2021-02-10 13:05:36 -08:00
Yashvardhan Kukreja
6b3ab3fe23
added: generic NumericOperator to handle numeric operations for kyverno policies ( #1536 )
...
Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
2021-02-05 19:49:23 -08:00
Jim Bugwadia
ed232ba118
add test case
2020-12-23 15:57:12 -08:00
Shuting Zhao
bf0128726a
fix bug in configmap lookup - wrong return value for invalidType
2020-11-30 12:57:26 -08:00
Jim Bugwadia
251129d09b
fix wildcard match
2020-11-29 00:35:33 -08:00
Jim Bugwadia
27f9516eb2
allow wildcards in condition values
2020-11-28 23:38:44 -08:00
Jim Bugwadia
e67779eeb5
allow wildcards in condition values
2020-11-28 23:29:15 -08:00
Shuting Zhao
b9fb926ddb
fixes for golint ./...
2020-11-17 13:07:30 -08:00
Jim Bugwadia
7e9b08baeb
Feature/make operators case insensitive ( #1217 )
...
* fix typo
* make operators case insensitive
* fix case statement
2020-10-29 15:00:22 -07:00
Shuting Zhao
cdc5190c56
update nirmata/kyverno to kyverno/kyverno
2020-10-07 11:12:31 -07:00
Shuting Zhao
b8b1d81df0
handles array parsing in configmap value
2020-09-22 18:26:52 -07:00
Mohan B E
51ac382c6c
Feature/configmaps var 724 ( #1118 )
...
* added configmap data substitution for foreground mutate and validate
* added configmap data substitution for foreground mutate and validate fmt
* added configmap lookup for background
* added comments to resource cache
* added configmap data lookup in preConditions
* added parse strings in In operator and configmap lookup docs
* added configmap lookup docs
* modified configmap lookup docs
2020-09-22 14:11:49 -07:00