Prateek Pandey
ef421a33ed
fix: allow delete of clone target resource with synchronize false ( #5161 )
...
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
2022-11-10 17:13:24 +05:30
shuting
fe7ea67f47
reset resource version on update ( #5157 )
...
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-10-27 13:35:42 +05:30
Prateek Pandey
2078f0dfd2
fix: allow delete of target resource with synchronize false ( #5081 )
...
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
2022-10-20 19:41:57 +00:00
Prateek Pandey
7735ac3f83
fix: handle resource cleanup when policy is deleted ( #5021 )
...
* fix: handle delete UR when policy is deleted
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
* fix cleanup
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
* use selector to list the update request
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
2022-10-20 17:48:27 +00:00
Prateek Pandey
2bd6c62b55
fix: use default retry with retryfunc for a conflict ( #4973 )
...
DefaultRetry is the recommended retry for a conflict
where multiple clients are making changes to the same resource
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-10-17 08:18:52 +00:00
Charles-Edouard Brétéché
209bab2059
refactor: more context less chans ( #4764 )
...
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-10-03 09:19:01 +00:00
yinka
688b4fb8e3
add package logger in files ( #4766 )
...
* add package logger in files
Signed-off-by: damilola olayinka <holayinkajr@gmail.com>
* add package logger to initContainer and other files
Signed-off-by: damilola olayinka <holayinkajr@gmail.com>
* helm docs
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* helm default values
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* release notes
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Signed-off-by: damilola olayinka <holayinkajr@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-10-02 19:45:03 +00:00
Prateek Pandey
38c252952d
feat: add matchlabel selector support with multiple clone ( #4713 )
...
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
2022-09-28 17:44:38 +02:00
Charles-Edouard Brétéché
42a2df56c1
refactor: add a couple of constants in api ( #4640 )
...
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-09-19 09:11:12 +00:00
Prateek Pandey
1cacd0173d
feat: allow cloning multiple resource from a namespace ( #4384 )
2022-09-08 04:47:09 +00:00
Charles-Edouard Brétéché
a95d61b9d7
refactor: client wrappers ( #4519 )
...
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-09-07 12:01:43 +08:00
Mritunjay Kumar Sharma
c07f6bd8a8
refactor: to remove generate cleanup controller ( #4041 )
...
- refactored cleanup controller
- handle delete policy
Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>
2022-09-01 09:39:06 +00:00
shuting
3bf3dcc1af
Add the metric "kyverno_client_queries_total" ( #4359 )
...
* Add metric "kyverno_kube_client_queries_total"
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* publish metric for missing queries
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* Refactor the way Kyverno registers QPS metric
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* Move clientsets to a dedicated folder
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* Wrap Kyverno client and policyreport client to register client query metric
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* address linter comments
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* address linter comments
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* Switch to use wrapper clients
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-08-31 11:33:47 +05:30
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é
421b490c56
feat: use tombstone helper ( #4273 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-08-03 16:17:07 +00:00
Jim Bugwadia
943c3a1929
use failurePolicy to block or allow requests, on policy errors ( #4183 )
...
* use failurePolicy to block or allow requests, on policy errors
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* add warnings
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* codegen
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix linter issues
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* add unit tests
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* handle network errors
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix linter issues
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix test
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix title conversion
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix path in generated file
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix test
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix fake metrics
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix tests
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* add check for klog flag initialization
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* check for flag reinitialization
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* check for flag reinitialization
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix spelling
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix flag init
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2022-08-02 20:24:02 +05:30
Jim Bugwadia
4aa0767728
add applyRules to control whether one or all rules are applied ( #4196 )
...
* add ruleSelector
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix selector logic for skipped rules
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* change names
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix generated paths
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix linter issues
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* add image variable to context when rule processing starts
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix messages
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* update generate rules
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix tests
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-07-29 15:02:26 +08:00
Byron Ibarra
f8a79be9a5
Fix UpdateRequest labeling (from pull #4199 ) ( #4212 )
...
Signed-off-by: Byron Ibarra V <bibarrav@falabella.cl>
2022-07-13 03:08:15 +05:30
shuting
cd2d89bf55
Wait for informers' cache to be synced before starting controllers ( #4155 )
...
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-06-28 04:55:52 +00:00
shuting
8260820a16
Fix labels with invalid charrs ( #4034 )
...
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-05-30 05:21:08 +00:00
Charles-Edouard Brétéché
dae3dad027
refactor: used typed admission request in ur ( #4022 )
...
* refactor: add policy event listener in ur controller (#4012 )
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
(cherry picked from commit cd1fa030ee
)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* refactor: used typed admission request in ur
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* refactor: used typed admission request in ur
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* Handle the error properly
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
Co-authored-by: ShutingZhao <shuting@nirmata.com>
2022-05-29 07:27:14 +00:00
Shubham Nazare
165c5d9fc3
feat: Extend CLI to cover generate policies ( #3456 )
...
- Change in namespace for test-generate example
- Change cloneResource to cloneSourceResource
- Add support for namespaced Policy and fix log messages
- Add test-generate in Makefile and an example of namespaced Policy
- Fix namespaced policy issue and add comments
- Refactor according to new generate controller
- Add json tag to GeneratedResource field of RuleResponse struct
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Co-authored-by: Prateek Pandey <prateek.pandey@nirmata.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-05-25 14:26:22 +00:00
Charles-Edouard Brétéché
4a6d5f7864
refactor: move policy deletion code from policy controller to ur controller ( #4013 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-24 21:05:11 +02:00
Charles-Edouard Brétéché
cd1fa030ee
refactor: add policy event listener in ur controller ( #4012 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-24 22:41:17 +08:00
Charles-Edouard Brétéché
b967d7388b
chore: remove unused ur errors ( #4011 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: Prateek Pandey <prateek.pandey@nirmata.com>
2022-05-24 13:59:12 +00:00
Charles-Edouard Brétéché
73fdbd3e76
refactor: ur cleaner controller ( #3974 )
...
* fix: move ur controller filtering in reconciler
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: mark ur retry on conflict
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: test data
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: add filter back in update ur handler
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: added some logs about attempts and increased backoff
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: reconciliation logic
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: Test_Generate_Synchronize_Flag
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: small nits
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* refactor: interface and logger
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: remove useless Control and ControlInterface
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: use GetObjectWithTombstone helper
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: reoder methods
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: is not found check
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: move check in reconcile code
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: stop mutating cached resource in ur controller (#4003 )
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
(cherry picked from commit dac733755b
)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-05-24 13:30:00 +00:00
Charles-Edouard Brétéché
e47176d695
refactor: background controllers cleanup ( #4001 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-24 10:27:26 +00:00
Charles-Edouard Brétéché
dac733755b
fix: stop mutating cached resource in ur controller ( #4003 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-24 11:25:37 +02:00
Charles-Edouard Brétéché
1712dfa947
refactor: move label helper utils from policy package to background package ( #3996 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-24 13:11:12 +05:30
Charles-Edouard Brétéché
5340c5608c
fix: ur is nil in ur controller ( #3986 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-23 11:19:27 +05:30
Charles-Edouard Brétéché
c1df363a0e
fix: release ur when handler pod is gone ( #3973 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-20 17:43:00 +08:00
Charles-Edouard Brétéché
1936d86623
fix: move ur controller filtering in reconciler ( #3964 )
...
* fix: move ur controller filtering in reconciler
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: mark ur retry on conflict
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: test data
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: add filter back in update ur handler
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: added some logs about attempts and increased backoff
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: reconciliation logic
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: Test_Generate_Synchronize_Flag
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* fix: small nits
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-20 00:06:56 +08:00
Charles-Edouard Brétéché
c988d519b4
fix: mark ur retry on conflict ( #3961 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-18 06:07:13 +00:00
Charles-Edouard Brétéché
41a3f6c388
chore: make kyverno informers and listers import aliases consistent ( #3958 )
...
* chore: make kyverno api import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make apimachinery api import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make dclient api import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make clients import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make kube informers and listers import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make kyverno informers and listers import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-05-18 04:02:31 +00:00
Charles-Edouard Brétéché
840307fc69
chore: enable ifshort linter ( #3945 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-17 18:55:13 +00:00
Vyankatesh Kudtarkar
bee9f4df55
fix panic issue for ur ( #3953 )
2022-05-17 16:57:47 +00:00
shuting
e7ccbb68d8
Cleanup URs on trigger deletion ( #3955 )
...
* Clean URs on trigger deletion
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* Make kyverno api import aliases consistent
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* Fix gofumpt error
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* Remove unused code
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-05-17 16:10:47 +00:00
Charles-Edouard Brétéché
572a76ce33
chore: make kube informers and listers import aliases consistent ( #3957 )
...
* chore: make kyverno api import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make apimachinery api import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make dclient api import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make clients import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make kube informers and listers import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-17 17:51:03 +02:00
Charles-Edouard Brétéché
666bcb3c15
chore: make k8s api import aliases consistent ( #3950 )
...
* chore: make kyverno api import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* chore: make apimachinery api import aliases consistent
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-17 22:14:31 +08: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
Prateek Pandey
a6718819c5
fix: use patch to update handler status in UR ( #3928 )
...
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
2022-05-17 16:21:53 +08:00
Prateek Pandey
8aebe3d06a
fix: handle UR delete once trigger namespace deleted ( #3934 )
...
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
2022-05-17 06:56:12 +00: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é
d7a3ba596d
chore: enable errname linter ( #3926 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-16 18:51:31 +08:00
shuting
7d7a23e74a
Cleanup the UR for mutate policies once it's completed ( #3912 )
...
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-05-16 09:24:17 +05:30
Dhaval Shah
fce35b91d2
[Bugbash] Kceu22 bugbash/fix staticcheck warnings ( #3917 )
...
* cleanup: error string formating
Fixes Staticcheck ST1005
KubeCon EU 2022 BugBash
Signed-off-by: Dhaval Shah <30974879+dhavalgshah@users.noreply.github.com>
* cleanup: merge var declaration with assignment
Fixes staticcheck S1021
Kubecon EU 2022 Bugbash
Signed-off-by: Dhaval Shah <30974879+dhavalgshah@users.noreply.github.com>
* cleanup normalize yoda condition to simple compare
fixes staticcheck ST1017
Signed-off-by: Dhaval Shah <30974879+dhavalgshah@users.noreply.github.com>
* cleanup: remove extraneous err param on executeTest
err is not used anywhere except to throw Fatal inside execureTest()
fix staticcheck SA4009
Signed-off-by: Dhaval Shah <30974879+dhavalgshah@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Sambhav Kothari <sambhavs.email@gmail.com>
Signed-off-by: Dhaval Shah <30974879+dhavalgshah@users.noreply.github.com>
* fix: match validation error message to actual errors
Signed-off-by: Dhaval Shah <30974879+dhavalgshah@users.noreply.github.com>
* cleanup: more of normalize validation error messages
Signed-off-by: Dhaval Shah <30974879+dhavalgshah@users.noreply.github.com>
* cleanup: additional error message formatting fixes
Signed-off-by: Dhaval Shah <30974879+dhavalgshah@users.noreply.github.com>
Co-authored-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-05-14 22:04:35 +01:00
Charles-Edouard Brétéché
2064a69b8a
refactor: make config vars private ( #3823 )
...
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-11 06:14:30 +00: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
shuting
5532203091
Handle errors properly for mutate and generate on existing resources ( #3863 )
...
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Prateek Pandey <prateek.pandey@nirmata.com>
2022-05-10 16:36:50 +00:00