1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
Commit graph

253 commits

Author SHA1 Message Date
Sambhav Kothari
c4075af3d1
Improve CLI test times by instantiating openapi controller once (#3297)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-02-24 23:34:12 +08:00
Sambhav Kothari
e9e96e7b1c
Run E2E tests on all supported k8s versions (#3256) 2022-02-23 15:52:08 +00:00
Naman Lakhwani
a9c9b25bb5
latest will point to main (#3285)
Signed-off-by: Naman Lakhwani <namanlakhwani@gmail.com>

Co-authored-by: shuting <shuting@nirmata.com>
2022-02-23 15:30:49 +00:00
skuethe
016771acde
feat: add linux/s390x builds (#3277)
Signed-off-by: skuethe <56306041+skuethe@users.noreply.github.com>

Co-authored-by: shuting <shuting@nirmata.com>
2022-02-22 23:40:46 +08:00
Sambhav Kothari
8c7f037c72
Improve E2E test CI timings (#3250)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-02-17 17:47:35 -08:00
Sambhav Kothari
25c2ad11e4
Fix unused tagTest in helm chart tests (#3174)
Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-02-04 23:12:12 +00:00
treydock
4e0d8ca612
Update kyverno-policies chart with latest pod-security policies (#3126)
* Update kyverno-policies chart with latest pod-security policies
Fixes #3063
Fixes #2277

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Update README to have better example

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Use chart testing during e2e to test against ci values

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Fix e2e tests for Helm chart

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Fix Kyverno chart testing to actually test values, and fix networkpolicy template

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Update README for exclusion

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Allow adding 'other' policies via Helm

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Update Chart.yaml for kyverno-policies

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Bump minimum Kubernetes version in charts

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Update kyverno-policies chart readme

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Use version that should catch all pre-releases

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Use version that should catch all pre-releases (part 2)

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Use same logic to get git tag by using Makefile target for updating Helm values

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Prateek Pandey <prateekpandey14@gmail.com>
2022-02-04 14:47:36 +08:00
shuting
ae4d148318
Update dev image tag in Make targets (#3159)
* - update dev images tag; - update chart testing

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update to use dev tag when setting up e2e tests infra

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* default chart test image tag for busybox to latest

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* set image tag to latest for chart testing

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* correct tag

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove test tag in e2e.yaml

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-02-03 15:41:58 +08:00
Rob Best
7a8c19e0cb
Support registry keychain from cloud providers (#3036)
* Enable cloud provider registry keychains

It's desirable that Kyverno supports using workload identity and other
cloud provider metadata services for registry credentials.

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Always initialize registry keychain

This supports using docker configuration on disk and credentials from
cloud providers without having to specify image pull secrets.

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Get pull secrets from kyverno service account

It was previously using 'default'. I think it makes more sense to use
the service account that Kyverno actually runs with.

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Don't split empty pull secrets list

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Add KYVERNO_SVC_ACCOUNT to config manifests

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Don't retrieve secrets from service account

Signed-off-by: Rob Best <robertbest89@gmail.com>

* Reduce scope of keychain changes

Just enable cloud provider keychains.

Signed-off-by: Rob Best <robertbest89@gmail.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2022-01-26 07:28:36 +00:00
Naman Lakhwani
1580837526
refactoring github actions to remove duplication and enhancement for versioned sbom's (#2979)
* initial commit

Signed-off-by: Naman Lakhwani <namanlakhwani@gmail.com>

* adding docker-buildx-builder to makefile

Signed-off-by: Naman Lakhwani <namanlakhwani@gmail.com>

* reverting git describe in makefile

Signed-off-by: Naman Lakhwani <namanlakhwani@gmail.com>

* uploading sbom for each kyverno image

Signed-off-by: Naman Lakhwani <namanlakhwani@gmail.com>

* small nits

Signed-off-by: Naman Lakhwani <namanlakhwani@gmail.com>

* scanning image before pushing and removed cosign.pub

Signed-off-by: Naman Lakhwani <namanlakhwani@gmail.com>
2022-01-18 15:07:59 -08:00
Sambhav Kothari
1af9e48b0d
Add image data to validate image configs (#2946)
* Add image data to validate image configs

Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

* Add tests for image context

Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>

* Add e2e test cases for image size policy

Signed-off-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-01-17 04:06:44 +00:00
Naman Lakhwani
8350aadc58
Fix: CI job to release images (#2929)
* making required changes in images workflow

Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>

* making required changes in release workflow

Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>

Co-authored-by: shuting <shutting06@gmail.com>
2022-01-10 14:10:44 +00:00
Naman Lakhwani
760ec6830d
removing docker buildx (#2922)
Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
2022-01-06 16:09:32 +00:00
Naman Lakhwani
cda6310249
fix in image workflow (#2921)
Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
2022-01-06 22:48:20 +08:00
shuting
df105ff596
Improve endpoint check (#2902)
* improve endpoint checks

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update make target for the local build

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove debug log

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-01-05 07:47:42 +00:00
shuting
9631d1d196
fix buildversion for local build (#2887)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-01-03 20:40:55 +05:30
Abhinav Sinha
2076f07b9f
added support for --git-branch flag and directory in git path for kyverno test cmd (#2763)
* added support for --git-branch flag and directory in git path for kyverno test cmd

Signed-off-by: Abhinav Sinha <zeborg3@gmail.com>

* added cli tests

Signed-off-by: Abhinav Sinha <zeborg3@gmail.com>

* replaced hard-coded Makefile test-cmd branch names with var GIT_BRANCH

Signed-off-by: Abhinav Sinha <zeborg3@gmail.com>

* moved `test-cmd` job from Makefile to github workflow

Signed-off-by: Abhinav Sinha <zeborg3@gmail.com>

* added `release*` branch to `e2e` workflow

Signed-off-by: Abhinav Sinha <zeborg3@gmail.com>

Co-authored-by: shuting <shutting06@gmail.com>
2021-12-20 14:09:53 +08:00
shuting
f4614213e5
Test publishing dev-test images (#2848)
* publish dev-* images

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add LD_FLAGS_DEV

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add IMAGE_TAG_LATEST_DEV

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove test statement

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2021-12-17 02:46:59 +00:00
Jim Bugwadia
b17e76493e
tighten and clarify Kyverno roles and permissions (#2799)
* update roles and rolebindings

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* revert label and fix perms

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* update role

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* restrict role

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix whitespace

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix tests and roles

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* update tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* remove ingress extensions/v1beta1

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix chart

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix role

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* tighten and clarify Kyverno roles and permissions

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fake commit to trigger workflows

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* revert tests and update test role

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add newlines

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* remove update role

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* make fmt

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* remove invalid param

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* cleanup roles in Helm templates

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* remove `mutate` cluster role binding

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-12-10 04:34:06 +00:00
Prateek Pandey
911bebcf4d
[docs]: sync api docs with latest api changes (#2808)
Signed-off-by: prateekpandey14 <prateekpandey14@gmail.com>
2021-12-09 14:44:29 +00:00
Batuhan Apaydın
b5615b6380
feat: create new builder for buildx (#2703)
Co-authored-by: Erkan Zileli <erkan.zileli@trendyol.com>
Co-authored-by: Furkan Turkal <furkan.turkal@trendyol.com>
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>

Co-authored-by: Erkan Zileli <erkan.zileli@trendyol.com>
Co-authored-by: Furkan Turkal <furkan.turkal@trendyol.com>
2021-11-10 21:07:40 +01:00
treydock
6c46ffffd9
Allow Helm CRD management to be disabled (#2655)
Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
2021-11-01 19:21:10 -07: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
a923dce631
Cleanup imports (#2635)
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-10-29 12:24:26 +02:00
ShubhamPalriwala
a0c963c48b rename make command to remove warning
Signed-off-by: ShubhamPalriwala <spalriwalau@gmail.com>
2021-10-29 10:18:16 +05:30
ShubhamPalriwala
5417b9d3c1 feat: shift sigs and sbom
Signed-off-by: ShubhamPalriwala <spalriwalau@gmail.com>
2021-10-13 21:34:04 +05:30
Kumar Mallikarjuna
254be4c1d3
Leader Election for initContainer (#2489)
* Local build

Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>

* Leader Election for initContainer

Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>

* Lease deletion

Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>

* Use wrc client

Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>

* log error out

Signed-off-by: ShutingZhao <shutting06@gmail.com>

Co-authored-by: ShutingZhao <shutting06@gmail.com>
2021-10-06 16:12:07 -07:00
NoSkillGirl
5ca33ce902 Merge branch 'main' of github.com:kyverno/kyverno into feat/support_mutate_in_cli 2021-10-05 12:23:34 +05:30
vivek kumar sahu
ae6f6c327f Added Code to support the test command for mutate policy (#2279)
* Added test-e2e-local in the Makefile
* Added a proper Indentation
* Added 3 more fields
* Added getPolicyResourceFullPath function
* Updating the patchedResource path to full path
* Converts Namespaced policy to ClusterPolicy
* Added GetPatchedResourceFromPath function
* Added GetPatchedResource function
* Checks for namespaced-policy from policy name provided bu user
* Generalizing resultKey for both validate and mutate. Also added kind field to this key
* Added Type field to PolicySpec
* To handle mutate case when resource and patchedResource are equal
* fetch patchResource from path provided by user and compare it with engine patchedResource
* generating result by comparing patchedResource
* Added kind to resultKey
* Handles namespaced policy results
* Skip is required
* Added []*response.EngineResponse return type in ApplyPolicyOnResource function
* namespaced policy only surpasses resources having same namespace as policy
* apply command will print the patchedResource whereas test will not
* passing engineResponse instead of validateEngineResponse because it supports results for both validate and mutate case
* default namespace will printed in the output table if no namespace is being provided by the user
* Added e2e test for mutate policy and also examples for both type of policies
* Created a separate function to get resultKey
* Changes in the resultKey for validate case
* Added help description for test command in the cli
* fixes code for more test cases
* fixes code to support more cases and also added resources for e2e-test
* some small changes like adding brackets, clubbing 2 if cond into one, changing variable name, etc.
* Rearrange GetPatchedResourceFromPath function to get rid from repetion of same thing twice.
* Added kind in the result section of test.yaml for all test-cases
* engineResponse will handle different types of response
* GetPatchedResource() uses GetResource function to fetch patched resource

Signed-off-by: viveksahu26 <vivekkumarsahu650@gmail.com>
2021-10-05 11:11:54 +05:30
Jim Bugwadia
67660647d9 update tests
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-09-26 18:30:53 -07:00
treydock
e1daf2085d
Switch Helm CRDs back to kyverno chart and move Policies to dedicated chart (#2357)
* Switch Helm CRDs back to kyverno chart and move Policies to dedicate chart

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Fix policies chart labels

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Remove README items moved to kyverno-policies chart

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
2021-09-22 13:56:10 -07:00
shuting
e288ed7fd2
Fix upgrade issue from 1.4.2 to 1.4.3-rc1 (#2387)
* update git command to get tag in 'v*' format

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* add label "appVersion" to report change request

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* fix linter issue

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* update git hash

Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-09-14 01:06:56 -07:00
Shuting Zhao
fd7e4735d7 add v1alpha1 CRDs schema back 2021-09-09 17:13:16 -07:00
Naman Lakhwani
e6f16221d0
modifying make command (#2265)
Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
2021-09-09 16:29:16 -07:00
James Callahan
95786f5033
Cleanup kustomizations (#2274)
- Remove dead newName specification
  - Un-hardcode namespace from resources
  - Create 'bundle' kustomization that keeps namespace hardcoding
    This should be used (as a base) to generate static manifests
  - Turn 'release' directory into kustomization that is only place with version numbers

Signed-off-by: James Callahan <jamescallahan@bitgo.com>
2021-09-01 18:53:28 -07:00
Frank Jogeleit
c522343c03
Update PolicyReport CRDs to wgpolicyk8s.io/v1alpha2 (#1825) 2021-08-21 10:35:17 -07:00
treydock
45e95c2217
Make Kyverno CRDs a seperate Helm chart capable of being updated/deleted (#2218)
* Make Kyverno CRDs a seperate Helm chart capable of being updated/deleted

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Make E2E tests work with new chart

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Seems Helm lint needs values.yaml

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Can't use ct install for the CRDs because will end up getting uninstalled after test

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Ensure helm release accounts for new CRD chart

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Update CRD chart versions

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Make CRD chart version match main kyverno chart version

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Bump chart versions

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
2021-08-12 13:54:17 -07:00
shuting
6ba341ff9b
- update Make target; - update release workflow config; - update PR template (#2257)
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-08-12 09:58:25 -07:00
Shuting Zhao
7d9c06da81 tag 1.4.2-rc4
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-08-10 17:41:22 -07:00
Vyankatesh Kudtarkar
adb0170001
Automate CLI binaries releases (#2236)
* fix issue

* fix comment

* fix comment

* fix comment

* add md file

* ignore /release

* fix issue
2021-08-10 09:07:46 -07:00
vivek kumar sahu
749854c589
Allow running e2e tests on local (dev) cluster (#2190)
* Added test-e2e-local in the Makefile

Signed-off-by: viveksahu26 <vivekkumarsahu650@gmail.com>

* Added a proper Indentation

Signed-off-by: viveksahu26 <vivekkumarsahu650@gmail.com>
2021-07-26 23:49:28 -07:00
Jim Bugwadia
13caaed8b7
Feature/cosign (#2078)
* add image verification

* inline policy list

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* cosign version and dependencies updates

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add registry initialization

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add build tag to exclude k8schain for cloud providers

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add build tag to exclude k8schain for cloud providers

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* generate deep copy and other fixtures

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix deep copy issues

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* mutate images to add digest

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add certificates to Kyverno container for HTTPS lookups

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* align flag syntax

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* update docs

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* update dependencies

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* update dependencies

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* patch image with digest and fix checks

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* hardcode image for demos

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add default registry (docker.io) before calling reference.Parse

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix definition

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* increase webhook timeout

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix args

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* run gofmt

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* rename for clarity

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix HasImageVerify check

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* align make test commands

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* align make test commands

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* align make test commands

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix linter error

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* format

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* handle API conflict and retry

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* format

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix reviewdog issues

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix make for unit tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* improve error message

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix durations

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* handle errors in tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* print policy name

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* update tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add retries and duration to error log

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix time check in tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* round creation times in test

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix retry loop

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* remove timing check for policy creation

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix e2e error - policy not found

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* update string comparison method

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* fix test Generate_Namespace_Label_Actions

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* add debug info for e2e tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix error

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix generate bug

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix format

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add check for update operations

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* increase time for deleteing a resource

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* fix check

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

Co-authored-by: Shuting Zhao <shutting06@gmail.com>
2021-07-09 18:01:46 -07:00
Yashvardhan Kukreja
b0ef84c581 added e2e tests: ensuring the availability of kyverno's prometheus metrics-server
Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
2021-05-24 08:09:17 +05:30
treydock
f956a3034f
Improved testing to allow 'skip' status and fail if tested results do not exist (#1881)
* Improved testing to allow 'skip' status and fail if tested results do not exist

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>

* Ensure exit 0 is seen as failure when should be failure

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
2021-05-07 16:27:15 -07:00
Trey Dockendorf
cb364904b6 Improved error handling for test command
Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
2021-05-03 08:39:38 -04:00
Bricktop
9a6f7043b0
Add e2e test for mutation (#1761)
Signed-off-by: MarcelMue <marcel.mueller1@rwth-aachen.de>
Signed-off-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
2021-04-08 16:14:08 -07:00
Vyankatesh Kudtarkar
04dc3ddfe3
Remove sample Dir and Remove testcases from test_runner (#1686)
* remove sample Dir and remove testcases form test_runner

Signed-off-by: vyankatesh <vyankatesh@neualto.com>

* change git URL for test

Signed-off-by: vyankatesh <vyankatesh@neualto.com>

* fix fmt issue

Signed-off-by: vyankatesh <vyankatesh@neualto.com>

* remove unused policy and test yamls

Signed-off-by: vyankatesh <vyankatesh@neualto.com>

* fix yaml path issue

Signed-off-by: vyankatesh <vyankatesh@neualto.com>

Co-authored-by: vyankatesh <vyankatesh@neualto.com>
2021-03-16 14:35:32 -07:00
Raj Babu Das
08643773c3
removing go.sum from github workflow and adding unused pkg check (#1698)
Signed-off-by: rajdas98 <mail.rajdas@gmail.com>
2021-03-11 10:14:46 -08:00
shuting
c8a41d83f7
Update Dockerfile; remove securityContext runAsUser (#1695)
* - run Kyverno with specific uid; - remove "runAsUser" from deployment manifest

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* add LD_FLAGS when push Kyverno images

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* start Kyverno with UID 10001

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* update initContainer and CLI Dockerfiles

Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-03-10 14:47:09 -08:00
Yashvardhan Kukreja
6f15432a21
added: make target to auto generate code (#1603)
* added: make auto-generate target to sync the auto-generated code by kubebuilder

Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>

* synced: all the auto-generable files with kubebuilder's controller-gen

Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
2021-03-01 10:58:58 -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
Yashvardhan Kukreja
ba9d294a43
feat: added versioned validation and installation of controller-gen (#1618)
Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
2021-02-18 20:53:53 -08:00
Raj Babu Das
0b832a038d
Adding multi arch support in all kyverno components (AMD6 and ARM64) (#1542)
* Adding multi arch support

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* Adding multi arch support

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* minor refactors

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* adding buildx action in e2e.yaml

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* Adding kyvernopre

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* Adding kyvernopre

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* Adding amd build

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* Adding go env

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* minor fix

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* removing docker tag

Signed-off-by: Raj Das <mail.rajdas@gmail.com>

* Adding local dockerfile build command

Signed-off-by: rajdas98 <mail.rajdas@gmail.com>
2021-02-18 18:09:01 -08:00
Yashvardhan Kukreja
426475b16c
added: gofmt check over the existing github workflows (#1553)
* added: gofmt check over the existing github workflows

Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>

* added: gofmt check with logs added

Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
2021-02-09 11:34:13 -08:00
shuting
bd44dbff41
Reduce RCR Throttling (#1545)
* buffer report change requests

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* fix clusterReportChangeRequest

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* further reduce RCRs in background scan

Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-07 19:46:50 -08:00
Shuting Zhao
a00d9b1cc9 release v1.3.2-rc2 2021-02-03 14:19:46 -08:00
Raj Babu Das
ac3a42d441
revert cli image name (#1507)
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
2021-01-29 12:42:14 -08:00
Raj Babu Das
9da94d5220
Enhancing dockerfiles (multi-stage) of kyverno components and adding non-root user to the docker images (#1495)
* Dockerfile refactored

Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>

* Adding non-root commands to docker images and enhanced the dockerfiles

Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>

* changing base image to scratch

Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>

* Minor typo fix

Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>

* changing dockerfiles to use /etc/passwd to use non-root user'

Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>

* minor typo

Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>

* minor typo

Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
2021-01-29 11:58:07 -08:00
Yuvraj
5ecdfda4e0
Improve github action (#1385)
* Improve github action

Improve the github action

fix issue

Trigger Krew on relese and skip prerelease

Updated create infrastructure script

* More changes

* More changes

* Added check for prerelease

* Added check for prerelease

* Revert change
2020-12-15 11:46:53 -08:00
Jim Bugwadia
2aeb5aa982 validate conditiona.operator as enum 2020-11-29 00:37:36 -08:00
shuting
f73c40ab4e
Migrate image to GitHub registry (#1299)
* migrate image to GitHub registry

* remove registry login
2020-11-24 11:49:08 -08:00
shuting
bc2e7fcbb3
Revert "Migrate image to GitHub registry" 2020-11-19 13:59:26 -08:00
Shuting Zhao
361d63cc4b migrate image to github registry 2020-11-19 12:19:30 -08:00
Shuting Zhao
943935ee1b properly deserialize anyPattern 2020-11-13 16:25:51 -08:00
Shuting Zhao
047b2b8739 update types.go to generate schema 2020-11-12 19:48:39 -08:00
Shuting Zhao
2292bf860b update policyreport group to wgpolicyk8s.io 2020-11-11 15:09:07 -08:00
shuting
5e07ecc5f3
Add Policy Report (#1229)
* add report in cli

* policy report crd added

* policy report added

* configmap added

* added jobs

* added jobs

* bug fixed

* added logic for cli

* common function added

* sub command added for policy report

* subcommand added for report

* common package changed

* configmap added

* added logic for kyverno cli

* added logic for jobs

* added logic for jobs

* added logic for jobs

* added logic for cli

* buf fix

* cli changes

* count bug fix

* docs added for command

* go fmt

* refactor codebase

* remove policy controller for policyreport

* policy report removed

* bug fixes

* bug fixes

* added job trigger if needed

* job deletation logic added

* build failed fix

* fixed e2e test

* remove hard coded variables

* packages adde

* improvment added in jobs sheduler

* policy report yaml added

* cronjob added

* small fixes

* remove background sync

* documentation added for report command

* remove extra log

* small improvement

* tested policy report

* revert hardcoded changes

* changes for demo

* demo changes

* resource aggrigation added

* More changes

* More changes

* - resolve PR comments; - refactor jobs controller

* set rbac for jobs

* add clean up in job controller

* add short names

* remove application scope for policyreport

* move job controller to policyreport

* add report logic in command apply

* - update policy report types;  - upgrade k8s library; - update code gen

* temporarily comment out code to pass CI build

* generate / update policyreport to cluster

* add unit test for CLI report

* add test for apply - generate policy report

* fix unit test

* - remove job controller; - remove in-memory configmap; - clean up kustomize manifest

* remove dependency

* add reportRequest / clusterReportRequest

* clean up policy report

* generate report request

* update crd clusterReportRequest

* - update json tag of report summary; - update definition manifests; -  fix dclient creation

* aggregate reportRequest into policy report

* fix unit tests

* - update report summary to optional; - generate clusterPolicyReport; - remove reportRequests after merged to report

* remove

* generate reportRequest in kyverno namespace

* update resource filter in helm chart

* - rename reportRequest to reportChangeRequest; -rename clusterReportRequest to clusterReportChangeRequest

* generate policy report in background scan

* skip generating report change request if there's entry results

* fix results entry removal when policy / rule gets deleted

* rename apiversion from policy.kubernetes.io to policy.k8s.io

* update summary.* to lower case

* move reportChangeRequest to kyverno.io/v1alpha1

* remove policy report flag

* fix report update

* clean up policy violation CRD

* remove violation CRD from manifest

* clean up policy violation code - remove pvGenerator

* change severity fields to lower case

* update import library

* set report category

Co-authored-by: Yuvraj <yuvraj.yad001@gmail.com>
Co-authored-by: Yuvraj <10830562+evalsocket@users.noreply.github.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2020-11-09 11:26:12 -08:00
Shuting Zhao
7a49db3882 update repo name 2020-10-08 13:10:52 -07:00
Shuting Zhao
2152d354a9 migrate repo 2020-10-07 15:09:52 -07:00
Shuting Zhao
cdc5190c56 update nirmata/kyverno to kyverno/kyverno 2020-10-07 11:12:31 -07:00
Shuting Zhao
1371da939b tag v1.1.10 2020-08-21 11:12:55 -07:00
Yuvraj
06148a58c5
cli docker images added (#1073)
* cli docker images added

* cli docker images added
2020-08-21 09:45:04 -07:00
shuting
d6062fdd47
Add go fmt (#1055)
* remove empty flag

* format code

* revert change in install.yaml
2020-08-14 12:21:06 -07:00
shuting
0794084b4d
1040 automate release (#1044)
* add release in make

* update release in Makefile

* update README.md
2020-08-12 07:54:45 -07:00
Yuvraj
c236a3a48a
Added e2e test in release (#1042)
* e2e test added in release

* added steps

* dirty added in hash

* new make command added

* dirty remove from make
2020-08-11 09:32:51 -07:00
Yuvraj
19c8f6a9ba
install.yaml added in release (#1038)
* install.yaml added in gorelease

* release added

* revert changes

* tested release

* tested release
2020-08-10 17:16:13 -07:00
Yuvraj
9c0d54f35a
e2e workflow added (#1021)
* e2e flow added

* add kustomize image change in ci
2020-08-06 11:56:31 +05:30
Mohan B E
6e827f912f
Feature/e2e 575 (#1018)
* added api templates

* E2E test for generate roles, rolebindings, clusterrole and clusterrolebindings

* table driven e2e tests

* table driven e2e tests and go fmt

* removed unwanted vars

* increased sleep time

* removed role generation clone

* increated sleep time

* added rolebinding clone and retry mechanism for get resources

* modified test for clone

* added namespace to role

* added namespace variable

* added git actions job

* changed build name

* removed docker login

* added role verbs

* removed github actions job and rbac file

* added clusterrole test with clone

* fixed travis issue
2020-08-06 10:46:10 +05:30
shuting
39de46fe39
983 kustomize support (#1026)
* prototype - strategic merge patch

* add end to end test

* add engine strategic merge patch support

* set webhook reinvocationPolicy to IfNeeded

* refactor engine mutate code

* support JMESPath in strategic merge patch

* implement patchesJson6902

* update doc

* resolve pr comments
2020-08-05 09:11:23 -07:00
Mohan BE
9451f79ee5 added api docs generator 2020-07-20 20:05:06 +05:30
Yuvraj
2e5f000d3e remove duplicate crd changes 2020-06-05 13:44:47 -07:00
Yuvraj
d96f3e6c89 remove duplicate crd changes 2020-06-05 13:42:53 -07:00
Yuvraj
d5ea0415de
remove arm from goreleaser (#903)
* Feature : Added complete release cycle and created install bash script for kyverno-cli
2020-06-04 11:45:37 -07:00
Jim Bugwadia
838d02c475
Bugfix/659 support wildcards for namespaces (#871)
* - support wildcards for namespaces

* do not annotate resource, unless policy is an autogen policy

* close HTTP body

* improve messages

* remove policy store

Policy store was not fully implemented and simply provided a way
to list all polices and get a policy by name, which can be done via
standard client-go interfaces.

We need to revisit and design a better PolicyStore that provides fast
lookups for matching policies based on names, namespaces, etc.

* handle wildcard namespaces in background processing

* fix unit tests 1) remove platform dependent path usage 2) remove policy store

* add test case for mutate with wildcard namespaces
2020-05-26 10:36:56 -07:00
Shuting Zhao
852f2bec2d Fix CRD definition 2020-05-18 17:10:35 -07:00
Jim Bugwadia
8c4c98d1a4
Merge pull request #855 from nirmata/bugfix/fixes_791_792_832
Bugfix/fixes 791 792 832
2020-05-17 19:30:11 -07:00
Jim Bugwadia
bf1aaba99b allow cross platform builds 2020-05-17 09:51:46 -07:00
Shuting Zhao
ddf89b4803 - fix 811; - suppress log 2020-05-15 13:11:28 -07:00
Shuting Zhao
83be17ce9e update cli doc / makefile 2020-02-19 19:13:05 -08:00
Jim Bugwadia
a1b49f72a3
fix gofmt and golint issues (#667)
* fix gofmt and golint issues

* add keys to structs

* fix compile error

* fix clusterrolebinding creation

* fix test
2020-02-03 13:38:24 -08:00
Shivkumar Dudhani
6b8aa9df34
add missing var for PACKAGE (#623) 2020-01-14 10:24:05 -08:00
Shuting Zhao
54275bdc01 tag v1.1.0 2020-01-10 18:52:11 -08:00
Shivkumar Dudhani
d0ab83a34c
fix typo (#585)
* fix typo

* update targets

* update CI scrip
2019-12-30 15:50:47 -08:00
shivkumar dudhani
b2bd144c71 fix makefile build output 2019-11-22 12:28:13 -08:00
Shivkumar Dudhani
61b202c64a
420 init container (#501)
* init container to cleanup stale webhook configurations if any.

* remove test code

* use internal pkg for os signals

* move webhook cleanup before http.server shutown.

* update make file and remove init

* update CI script
2019-11-18 11:41:37 -08:00
shivdudhani
6690f37426 initial targets for unit test and code coverage 2019-06-07 11:50:12 -07:00
shivdudhani
6dedcf3b87 add CGO_ENABLED=0 while go build 2019-06-05 23:26:37 -07:00
shivdudhani
f41179a8ca pulish docker image on suceessful build 2019-06-04 18:05:10 -07:00
shuting
eaef747af8 resolve PR comment 2019-05-29 18:30:10 -07:00
shuting
4b568efd70 print version info in main log 2019-05-29 15:24:19 -07:00
shuting
a1322276b7 update makefile 2019-05-29 14:47:26 -07:00
shuting
ea08ef3fbe add the version command 2019-05-29 14:44:21 -07:00
Jim Bugwadia
e91cd9341b - add Makefile
- add Dockerfile
- update install.yaml
2019-05-22 21:41:24 -07:00