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

Restructure project to follow standards (#2632)

Signed-off-by: Jose Armesto <github@armesto.net>
This commit is contained in:
Jose Armesto 2021-10-29 18:13:20 +02:00 committed by GitHub
parent 1966c82c6d
commit 831a9826d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
202 changed files with 322 additions and 321 deletions

View file

@ -74,8 +74,8 @@ jobs:
- name: e2e testing
run: |
echo ">>> Install Kyverno"
sed 's/imagePullPolicy:.*$/imagePullPolicy: IfNotPresent/g' ${GITHUB_WORKSPACE}/definitions/install.yaml | kubectl apply -f -
kubectl apply -f ${GITHUB_WORKSPACE}/definitions/github/rbac.yaml
sed 's/imagePullPolicy:.*$/imagePullPolicy: IfNotPresent/g' ${GITHUB_WORKSPACE}/config/install.yaml | kubectl apply -f -
kubectl apply -f ${GITHUB_WORKSPACE}/config/github/rbac.yaml
chmod a+x ${GITHUB_WORKSPACE}/scripts/verify-deployment.sh
sleep 50
echo ">>> Check kyverno"
@ -86,7 +86,7 @@ jobs:
kubectl port-forward svc/kyverno-svc-metrics -n kyverno 8000:8000 &
echo ">>> Run Kyverno e2e test"
make test-e2e
kubectl delete -f ${GITHUB_WORKSPACE}/definitions/install.yaml
kubectl delete -f ${GITHUB_WORKSPACE}/config/install.yaml
- name: Update chart values
run: |
@ -111,4 +111,4 @@ jobs:
kubectl get mutatingwebhookconfigurations,validatingwebhookconfigurations
kubectl -n kyverno get pod
kubectl -n kyverno describe pod | grep -i events -A10
kubectl -n kyverno logs deploy/kyverno
kubectl -n kyverno logs deploy/kyverno

View file

@ -136,7 +136,7 @@ docker-push-kyverno:
##################################
generate-api-docs:
go run github.com/ahmetb/gen-crd-api-reference-docs -api-dir ./pkg/api -config documentation/api/config.json -template-dir documentation/api/template -out-file documentation/index.html
go run github.com/ahmetb/gen-crd-api-reference-docs -api-dir ./api -config documentation/api/config.json -template-dir documentation/api/template -out-file documentation/index.html
##################################
@ -228,7 +228,7 @@ test-e2e:
test-e2e-local:
$(eval export E2E="ok")
kubectl apply -f https://raw.githubusercontent.com/kyverno/kyverno/main/definitions/github/rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/kyverno/kyverno/main/config/github/rbac.yaml
kubectl port-forward -n kyverno service/kyverno-svc-metrics 8000:8000 &
go test ./test/e2e/metrics -v
go test ./test/e2e/mutate -v
@ -252,26 +252,26 @@ godownloader:
# kustomize-crd will create install.yaml
kustomize-crd:
# Create CRD for helm deployment Helm
kustomize build ./definitions/release | kustomize cfg grep kind=CustomResourceDefinition > ./charts/kyverno/templates/crds.yaml
kustomize build ./config/release | kustomize cfg grep kind=CustomResourceDefinition > ./charts/kyverno/templates/crds.yaml
# Generate install.yaml that have all resources for kyverno
kustomize build ./definitions > ./definitions/install.yaml
kustomize build ./config > ./config/install.yaml
# Generate install_debug.yaml that for developer testing
kustomize build ./definitions/debug > ./definitions/install_debug.yaml
kustomize build ./config/debug > ./config/install_debug.yaml
# guidance https://github.com/kyverno/kyverno/wiki/Generate-a-Release
release:
kustomize build ./definitions > ./definitions/install.yaml
kustomize build ./definitions/release > ./definitions/release/install.yaml
kustomize build ./config > ./config/install.yaml
kustomize build ./config/release > ./config/release/install.yaml
release-notes:
@bash -c 'while IFS= read -r line ; do if [[ "$$line" == "## "* && "$$line" != "## $(VERSION)" ]]; then break ; fi; echo "$$line"; done < "CHANGELOG.md"' \
true
kyverno-crd: controller-gen
$(CONTROLLER_GEN) crd paths=./pkg/api/kyverno/... crd:crdVersions=v1 output:dir=./definitions/crds
$(CONTROLLER_GEN) crd paths=./api/kyverno/... crd:crdVersions=v1 output:dir=./config/crds
report-crd: controller-gen
$(CONTROLLER_GEN) crd paths=./pkg/api/policyreport/... crd:crdVersions=v1 output:dir=./definitions/crds
$(CONTROLLER_GEN) crd paths=./api/policyreport/... crd:crdVersions=v1 output:dir=./config/crds
# install the right version of controller-gen
install-controller-gen:

View file

@ -1,7 +1,7 @@
package v1
import (
"github.com/kyverno/kyverno/pkg/api/kyverno"
"github.com/kyverno/kyverno/api/kyverno"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -17,7 +17,7 @@ limitations under the License.
package v1alpha1
import (
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
report "github.com/kyverno/kyverno/api/policyreport/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

View file

@ -17,7 +17,7 @@ limitations under the License.
package v1alpha1
import (
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
report "github.com/kyverno/kyverno/api/policyreport/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

View file

@ -22,7 +22,7 @@ limitations under the License.
package v1alpha1
import (
policyreportv1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
policyreportv1alpha1 "github.com/kyverno/kyverno/api/policyreport/v1alpha1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"

View file

@ -17,7 +17,7 @@ limitations under the License.
package v1alpha2
import (
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
report "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

View file

@ -17,7 +17,7 @@ limitations under the License.
package v1alpha2
import (
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
report "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

View file

@ -22,7 +22,7 @@ limitations under the License.
package v1alpha2
import (
policyreportv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
policyreportv1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"

1
go.mod
View file

@ -37,6 +37,7 @@ require (
github.com/spf13/cobra v1.2.1
github.com/stretchr/testify v1.7.0
github.com/xanzy/ssh-agent v0.3.0 // indirect
golang.org/x/tools v0.1.7 // indirect
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
gotest.tools v2.2.0+incompatible

6
go.sum
View file

@ -1721,6 +1721,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA=
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
@ -1990,6 +1991,7 @@ golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210505214959-0714010a04ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f h1:w6wWR0H+nyVpbSAQbzVEIACVyr/h8l/BEkY6Sokc7Eg=
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
@ -2156,6 +2158,7 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210903071746-97244b99971b h1:3Dq0eVHn0uaQJmPO+/aYPI/fRMqdrVDbu7MQcku54gg=
golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@ -2276,8 +2279,9 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ=
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

View file

@ -19,9 +19,9 @@ limitations under the License.
package fake
import (
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
wgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
kyvernov1alpha2 "github.com/kyverno/kyverno/api/kyverno/v1alpha2"
wgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -19,9 +19,9 @@ limitations under the License.
package scheme
import (
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
wgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
kyvernov1alpha2 "github.com/kyverno/kyverno/api/kyverno/v1alpha2"
wgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -22,7 +22,7 @@ import (
"context"
"time"
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -22,7 +22,7 @@ import (
"context"
"time"
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View file

@ -19,7 +19,7 @@ limitations under the License.
package v1
import (
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)

View file

@ -22,7 +22,7 @@ import (
"context"
"time"
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View file

@ -22,7 +22,7 @@ import (
"context"
"time"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
"github.com/kyverno/kyverno/api/kyverno/v1alpha2"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
"github.com/kyverno/kyverno/api/kyverno/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
"github.com/kyverno/kyverno/api/kyverno/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -19,7 +19,7 @@ limitations under the License.
package v1alpha2
import (
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
"github.com/kyverno/kyverno/api/kyverno/v1alpha2"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)

View file

@ -22,7 +22,7 @@ import (
"context"
"time"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
"github.com/kyverno/kyverno/api/kyverno/v1alpha2"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View file

@ -22,7 +22,7 @@ import (
"context"
"time"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/api/policyreport/v1alpha2"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/api/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/api/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -22,7 +22,7 @@ import (
"context"
"time"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/api/policyreport/v1alpha2"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View file

@ -19,7 +19,7 @@ limitations under the License.
package v1alpha2
import (
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)

View file

@ -21,9 +21,9 @@ package externalversions
import (
"fmt"
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
policyreportv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
"github.com/kyverno/kyverno/api/kyverno/v1alpha2"
policyreportv1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)

View file

@ -22,7 +22,7 @@ import (
"context"
time "time"
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1"

View file

@ -22,7 +22,7 @@ import (
"context"
time "time"
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1"

View file

@ -22,7 +22,7 @@ import (
"context"
time "time"
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1"

View file

@ -22,7 +22,7 @@ import (
"context"
time "time"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
kyvernov1alpha2 "github.com/kyverno/kyverno/api/kyverno/v1alpha2"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha2"

View file

@ -22,7 +22,7 @@ import (
"context"
time "time"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
kyvernov1alpha2 "github.com/kyverno/kyverno/api/kyverno/v1alpha2"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha2"

View file

@ -22,7 +22,7 @@ import (
"context"
time "time"
policyreportv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
policyreportv1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha2"

View file

@ -22,7 +22,7 @@ import (
"context"
time "time"
policyreportv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
policyreportv1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha2"

View file

@ -19,7 +19,7 @@ limitations under the License.
package v1
import (
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v12 "github.com/kyverno/kyverno/api/kyverno/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,10 +30,10 @@ import (
type ClusterPolicyLister interface {
// List lists all ClusterPolicies in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.ClusterPolicy, err error)
List(selector labels.Selector) (ret []*v12.ClusterPolicy, err error)
// Get retrieves the ClusterPolicy from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.ClusterPolicy, error)
Get(name string) (*v12.ClusterPolicy, error)
ClusterPolicyListerExpansion
}
@ -48,21 +48,21 @@ func NewClusterPolicyLister(indexer cache.Indexer) ClusterPolicyLister {
}
// List lists all ClusterPolicies in the indexer.
func (s *clusterPolicyLister) List(selector labels.Selector) (ret []*v1.ClusterPolicy, err error) {
func (s *clusterPolicyLister) List(selector labels.Selector) (ret []*v12.ClusterPolicy, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.ClusterPolicy))
ret = append(ret, m.(*v12.ClusterPolicy))
})
return ret, err
}
// Get retrieves the ClusterPolicy from the index for a given name.
func (s *clusterPolicyLister) Get(name string) (*v1.ClusterPolicy, error) {
func (s *clusterPolicyLister) Get(name string) (*v12.ClusterPolicy, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("clusterpolicy"), name)
return nil, errors.NewNotFound(v12.Resource("clusterpolicy"), name)
}
return obj.(*v1.ClusterPolicy), nil
return obj.(*v12.ClusterPolicy), nil
}

View file

@ -19,22 +19,22 @@ limitations under the License.
package v1
import (
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
"k8s.io/apimachinery/pkg/labels"
)
//ListResources is a wrapper to List and adds the resource kind information
// as the lister is specific to a gvk we can harcode the values here
func (pl *clusterPolicyLister) ListResources(selector labels.Selector) (ret []*kyvernov1.ClusterPolicy, err error) {
func (pl *clusterPolicyLister) ListResources(selector labels.Selector) (ret []*v1.ClusterPolicy, err error) {
policies, err := pl.List(selector)
for index := range policies {
policies[index].SetGroupVersionKind(kyvernov1.SchemeGroupVersion.WithKind("ClusterPolicy"))
policies[index].SetGroupVersionKind(v1.SchemeGroupVersion.WithKind("ClusterPolicy"))
}
return policies, err
}
func (s generateRequestNamespaceLister) GetGenerateRequestsForResource(kind, namespace, name string) ([]*kyvernov1.GenerateRequest, error) {
var list []*kyvernov1.GenerateRequest
func (s generateRequestNamespaceLister) GetGenerateRequestsForResource(kind, namespace, name string) ([]*v1.GenerateRequest, error) {
var list []*v1.GenerateRequest
grs, err := s.List(labels.NewSelector())
if err != nil {
return nil, err
@ -50,8 +50,8 @@ func (s generateRequestNamespaceLister) GetGenerateRequestsForResource(kind, nam
return list, err
}
func (s generateRequestNamespaceLister) GetGenerateRequestsForClusterPolicy(policy string) ([]*kyvernov1.GenerateRequest, error) {
var list []*kyvernov1.GenerateRequest
func (s generateRequestNamespaceLister) GetGenerateRequestsForClusterPolicy(policy string) ([]*v1.GenerateRequest, error) {
var list []*v1.GenerateRequest
grs, err := s.List(labels.NewSelector())
if err != nil {
return nil, err

View file

@ -1,6 +1,8 @@
package v1
import kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
import (
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
)
type GenerateRequestNamespaceListerExpansion interface {
GetGenerateRequestsForClusterPolicy(policy string) ([]*kyvernov1.GenerateRequest, error)

View file

@ -19,7 +19,7 @@ limitations under the License.
package v1
import (
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v12 "github.com/kyverno/kyverno/api/kyverno/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,7 +30,7 @@ import (
type GenerateRequestLister interface {
// List lists all GenerateRequests in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.GenerateRequest, err error)
List(selector labels.Selector) (ret []*v12.GenerateRequest, err error)
// GenerateRequests returns an object that can list and get GenerateRequests.
GenerateRequests(namespace string) GenerateRequestNamespaceLister
GenerateRequestListerExpansion
@ -47,9 +47,9 @@ func NewGenerateRequestLister(indexer cache.Indexer) GenerateRequestLister {
}
// List lists all GenerateRequests in the indexer.
func (s *generateRequestLister) List(selector labels.Selector) (ret []*v1.GenerateRequest, err error) {
func (s *generateRequestLister) List(selector labels.Selector) (ret []*v12.GenerateRequest, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.GenerateRequest))
ret = append(ret, m.(*v12.GenerateRequest))
})
return ret, err
}
@ -64,10 +64,10 @@ func (s *generateRequestLister) GenerateRequests(namespace string) GenerateReque
type GenerateRequestNamespaceLister interface {
// List lists all GenerateRequests in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.GenerateRequest, err error)
List(selector labels.Selector) (ret []*v12.GenerateRequest, err error)
// Get retrieves the GenerateRequest from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.GenerateRequest, error)
Get(name string) (*v12.GenerateRequest, error)
GenerateRequestNamespaceListerExpansion
}
@ -79,21 +79,21 @@ type generateRequestNamespaceLister struct {
}
// List lists all GenerateRequests in the indexer for a given namespace.
func (s generateRequestNamespaceLister) List(selector labels.Selector) (ret []*v1.GenerateRequest, err error) {
func (s generateRequestNamespaceLister) List(selector labels.Selector) (ret []*v12.GenerateRequest, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1.GenerateRequest))
ret = append(ret, m.(*v12.GenerateRequest))
})
return ret, err
}
// Get retrieves the GenerateRequest from the indexer for a given namespace and name.
func (s generateRequestNamespaceLister) Get(name string) (*v1.GenerateRequest, error) {
func (s generateRequestNamespaceLister) Get(name string) (*v12.GenerateRequest, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("generaterequest"), name)
return nil, errors.NewNotFound(v12.Resource("generaterequest"), name)
}
return obj.(*v1.GenerateRequest), nil
return obj.(*v12.GenerateRequest), nil
}

View file

@ -19,7 +19,7 @@ limitations under the License.
package v1
import (
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v12 "github.com/kyverno/kyverno/api/kyverno/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,7 +30,7 @@ import (
type PolicyLister interface {
// List lists all Policies in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.Policy, err error)
List(selector labels.Selector) (ret []*v12.Policy, err error)
// Policies returns an object that can list and get Policies.
Policies(namespace string) PolicyNamespaceLister
PolicyListerExpansion
@ -47,9 +47,9 @@ func NewPolicyLister(indexer cache.Indexer) PolicyLister {
}
// List lists all Policies in the indexer.
func (s *policyLister) List(selector labels.Selector) (ret []*v1.Policy, err error) {
func (s *policyLister) List(selector labels.Selector) (ret []*v12.Policy, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.Policy))
ret = append(ret, m.(*v12.Policy))
})
return ret, err
}
@ -64,10 +64,10 @@ func (s *policyLister) Policies(namespace string) PolicyNamespaceLister {
type PolicyNamespaceLister interface {
// List lists all Policies in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.Policy, err error)
List(selector labels.Selector) (ret []*v12.Policy, err error)
// Get retrieves the Policy from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.Policy, error)
Get(name string) (*v12.Policy, error)
PolicyNamespaceListerExpansion
}
@ -79,21 +79,21 @@ type policyNamespaceLister struct {
}
// List lists all Policies in the indexer for a given namespace.
func (s policyNamespaceLister) List(selector labels.Selector) (ret []*v1.Policy, err error) {
func (s policyNamespaceLister) List(selector labels.Selector) (ret []*v12.Policy, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1.Policy))
ret = append(ret, m.(*v12.Policy))
})
return ret, err
}
// Get retrieves the Policy from the indexer for a given namespace and name.
func (s policyNamespaceLister) Get(name string) (*v1.Policy, error) {
func (s policyNamespaceLister) Get(name string) (*v12.Policy, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("policy"), name)
return nil, errors.NewNotFound(v12.Resource("policy"), name)
}
return obj.(*v1.Policy), nil
return obj.(*v12.Policy), nil
}

View file

@ -19,7 +19,7 @@ limitations under the License.
package v1alpha2
import (
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
v1alpha22 "github.com/kyverno/kyverno/api/kyverno/v1alpha2"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,10 +30,10 @@ import (
type ClusterReportChangeRequestLister interface {
// List lists all ClusterReportChangeRequests in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha2.ClusterReportChangeRequest, err error)
List(selector labels.Selector) (ret []*v1alpha22.ClusterReportChangeRequest, err error)
// Get retrieves the ClusterReportChangeRequest from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha2.ClusterReportChangeRequest, error)
Get(name string) (*v1alpha22.ClusterReportChangeRequest, error)
ClusterReportChangeRequestListerExpansion
}
@ -48,21 +48,21 @@ func NewClusterReportChangeRequestLister(indexer cache.Indexer) ClusterReportCha
}
// List lists all ClusterReportChangeRequests in the indexer.
func (s *clusterReportChangeRequestLister) List(selector labels.Selector) (ret []*v1alpha2.ClusterReportChangeRequest, err error) {
func (s *clusterReportChangeRequestLister) List(selector labels.Selector) (ret []*v1alpha22.ClusterReportChangeRequest, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha2.ClusterReportChangeRequest))
ret = append(ret, m.(*v1alpha22.ClusterReportChangeRequest))
})
return ret, err
}
// Get retrieves the ClusterReportChangeRequest from the index for a given name.
func (s *clusterReportChangeRequestLister) Get(name string) (*v1alpha2.ClusterReportChangeRequest, error) {
func (s *clusterReportChangeRequestLister) Get(name string) (*v1alpha22.ClusterReportChangeRequest, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha2.Resource("clusterreportchangerequest"), name)
return nil, errors.NewNotFound(v1alpha22.Resource("clusterreportchangerequest"), name)
}
return obj.(*v1alpha2.ClusterReportChangeRequest), nil
return obj.(*v1alpha22.ClusterReportChangeRequest), nil
}

View file

@ -19,7 +19,7 @@ limitations under the License.
package v1alpha2
import (
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
v1alpha22 "github.com/kyverno/kyverno/api/kyverno/v1alpha2"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,7 +30,7 @@ import (
type ReportChangeRequestLister interface {
// List lists all ReportChangeRequests in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha2.ReportChangeRequest, err error)
List(selector labels.Selector) (ret []*v1alpha22.ReportChangeRequest, err error)
// ReportChangeRequests returns an object that can list and get ReportChangeRequests.
ReportChangeRequests(namespace string) ReportChangeRequestNamespaceLister
ReportChangeRequestListerExpansion
@ -47,9 +47,9 @@ func NewReportChangeRequestLister(indexer cache.Indexer) ReportChangeRequestList
}
// List lists all ReportChangeRequests in the indexer.
func (s *reportChangeRequestLister) List(selector labels.Selector) (ret []*v1alpha2.ReportChangeRequest, err error) {
func (s *reportChangeRequestLister) List(selector labels.Selector) (ret []*v1alpha22.ReportChangeRequest, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha2.ReportChangeRequest))
ret = append(ret, m.(*v1alpha22.ReportChangeRequest))
})
return ret, err
}
@ -64,10 +64,10 @@ func (s *reportChangeRequestLister) ReportChangeRequests(namespace string) Repor
type ReportChangeRequestNamespaceLister interface {
// List lists all ReportChangeRequests in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha2.ReportChangeRequest, err error)
List(selector labels.Selector) (ret []*v1alpha22.ReportChangeRequest, err error)
// Get retrieves the ReportChangeRequest from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha2.ReportChangeRequest, error)
Get(name string) (*v1alpha22.ReportChangeRequest, error)
ReportChangeRequestNamespaceListerExpansion
}
@ -79,21 +79,21 @@ type reportChangeRequestNamespaceLister struct {
}
// List lists all ReportChangeRequests in the indexer for a given namespace.
func (s reportChangeRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.ReportChangeRequest, err error) {
func (s reportChangeRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha22.ReportChangeRequest, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha2.ReportChangeRequest))
ret = append(ret, m.(*v1alpha22.ReportChangeRequest))
})
return ret, err
}
// Get retrieves the ReportChangeRequest from the indexer for a given namespace and name.
func (s reportChangeRequestNamespaceLister) Get(name string) (*v1alpha2.ReportChangeRequest, error) {
func (s reportChangeRequestNamespaceLister) Get(name string) (*v1alpha22.ReportChangeRequest, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha2.Resource("reportchangerequest"), name)
return nil, errors.NewNotFound(v1alpha22.Resource("reportchangerequest"), name)
}
return obj.(*v1alpha2.ReportChangeRequest), nil
return obj.(*v1alpha22.ReportChangeRequest), nil
}

View file

@ -19,7 +19,7 @@ limitations under the License.
package v1alpha2
import (
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
v1alpha22 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,10 +30,10 @@ import (
type ClusterPolicyReportLister interface {
// List lists all ClusterPolicyReports in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha2.ClusterPolicyReport, err error)
List(selector labels.Selector) (ret []*v1alpha22.ClusterPolicyReport, err error)
// Get retrieves the ClusterPolicyReport from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha2.ClusterPolicyReport, error)
Get(name string) (*v1alpha22.ClusterPolicyReport, error)
ClusterPolicyReportListerExpansion
}
@ -48,21 +48,21 @@ func NewClusterPolicyReportLister(indexer cache.Indexer) ClusterPolicyReportList
}
// List lists all ClusterPolicyReports in the indexer.
func (s *clusterPolicyReportLister) List(selector labels.Selector) (ret []*v1alpha2.ClusterPolicyReport, err error) {
func (s *clusterPolicyReportLister) List(selector labels.Selector) (ret []*v1alpha22.ClusterPolicyReport, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha2.ClusterPolicyReport))
ret = append(ret, m.(*v1alpha22.ClusterPolicyReport))
})
return ret, err
}
// Get retrieves the ClusterPolicyReport from the index for a given name.
func (s *clusterPolicyReportLister) Get(name string) (*v1alpha2.ClusterPolicyReport, error) {
func (s *clusterPolicyReportLister) Get(name string) (*v1alpha22.ClusterPolicyReport, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha2.Resource("clusterpolicyreport"), name)
return nil, errors.NewNotFound(v1alpha22.Resource("clusterpolicyreport"), name)
}
return obj.(*v1alpha2.ClusterPolicyReport), nil
return obj.(*v1alpha22.ClusterPolicyReport), nil
}

Some files were not shown because too many files have changed in this diff Show more