Skip to content

Commit ce582da

Browse files
authored
Feature/v1.13 versions (#826) (#827)
* depdency updates * feat: support versions * feat: update docs --------- Signed-off-by: Frank Jogeleit <[email protected]>
1 parent 1e4759f commit ce582da

File tree

19 files changed

+947
-713
lines changed

19 files changed

+947
-713
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ frontend/node_modules
33
frontend/.vite
44
frontend/dist
55
backend/coverage.out
6+
backend/config.yaml
67
backend/dist
78
backend/pkg/server/ui/dist
89
backend/backend

backend/.goreleaser.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
version: 2
2+
3+
project_name: kyverno-playground
4+
15
before:
26
hooks:
37
- go mod tidy
@@ -10,6 +14,7 @@ builds:
1014
- windows
1115
- darwin
1216
binary: kyverno-playground
17+
mod_timestamp: "{{ .CommitTimestamp }}"
1318
flags:
1419
- -trimpath
1520
ldflags:
@@ -22,7 +27,7 @@ kos:
2227
- '{{ if not .Prerelease }}latest{{ end }}'
2328
bare: true
2429
preserve_import_paths: false
25-
sbom: none
30+
sbom: spdx
2631
platforms:
2732
- all
2833
flags:
@@ -66,7 +71,7 @@ sboms:
6671
artifacts: source
6772

6873
snapshot:
69-
name_template: '{{ incpatch .Version }}-next'
74+
version_template: '{{ incpatch .Version }}-next'
7075

7176
release:
7277
prerelease: auto

backend/go.mod

+17-10
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ require (
88
github.com/gin-contrib/cors v1.7.2
99
github.com/gin-gonic/gin v1.10.0
1010
github.com/go-logr/logr v1.4.2
11+
github.com/knadh/koanf/parsers/yaml v0.1.0
12+
github.com/knadh/koanf/providers/file v1.1.2
13+
github.com/knadh/koanf/v2 v2.1.2
1114
github.com/kyverno/kyverno v1.13.2
1215
github.com/loopfz/gadgeto v0.11.4
1316
github.com/spf13/cobra v1.8.1
14-
github.com/stretchr/testify v1.9.0
17+
github.com/stretchr/testify v1.10.0
1518
gomodules.xyz/jsonpatch/v2 v2.4.0
1619
k8s.io/api v0.31.1
1720
k8s.io/apimachinery v0.31.1
@@ -97,8 +100,8 @@ require (
97100
github.com/buildkite/go-pipeline v0.11.0 // indirect
98101
github.com/buildkite/interpolate v0.1.3 // indirect
99102
github.com/buildkite/roko v1.2.0 // indirect
100-
github.com/bytedance/sonic v1.11.9 // indirect
101-
github.com/bytedance/sonic/loader v0.1.1 // indirect
103+
github.com/bytedance/sonic v1.12.5 // indirect
104+
github.com/bytedance/sonic/loader v0.2.1 // indirect
102105
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
103106
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
104107
github.com/cespare/xxhash/v2 v2.3.0 // indirect
@@ -132,7 +135,7 @@ require (
132135
github.com/fluxcd/pkg/oci v0.41.1 // indirect
133136
github.com/fsnotify/fsnotify v1.7.0 // indirect
134137
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
135-
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
138+
github.com/gabriel-vasile/mimetype v1.4.7 // indirect
136139
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect
137140
github.com/gin-contrib/sse v0.1.0 // indirect
138141
github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect
@@ -158,9 +161,10 @@ require (
158161
github.com/go-piv/piv-go v1.11.0 // indirect
159162
github.com/go-playground/locales v0.14.1 // indirect
160163
github.com/go-playground/universal-translator v0.18.1 // indirect
161-
github.com/go-playground/validator/v10 v10.22.0 // indirect
164+
github.com/go-playground/validator/v10 v10.23.0 // indirect
165+
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
162166
github.com/gobwas/glob v0.2.3 // indirect
163-
github.com/goccy/go-json v0.10.3 // indirect
167+
github.com/goccy/go-json v0.10.4 // indirect
164168
github.com/gogo/protobuf v1.3.2 // indirect
165169
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
166170
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
@@ -210,7 +214,8 @@ require (
210214
github.com/josharian/intern v1.0.0 // indirect
211215
github.com/json-iterator/go v1.1.12 // indirect
212216
github.com/klauspost/compress v1.17.9 // indirect
213-
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
217+
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
218+
github.com/knadh/koanf/maps v0.1.1 // indirect
214219
github.com/kylelemons/godebug v1.1.0 // indirect
215220
github.com/kyverno/go-jmespath v0.4.1-0.20231124160150-95e59c162877 // indirect
216221
github.com/kyverno/kyverno-json v0.0.4-0.20240730143747-aade3d42fc0e // indirect
@@ -223,9 +228,11 @@ require (
223228
github.com/mattn/go-colorable v0.1.13 // indirect
224229
github.com/mattn/go-isatty v0.0.20 // indirect
225230
github.com/miekg/pkcs11 v1.1.1 // indirect
231+
github.com/mitchellh/copystructure v1.2.0 // indirect
226232
github.com/mitchellh/go-homedir v1.1.0 // indirect
227233
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
228234
github.com/mitchellh/mapstructure v1.5.0 // indirect
235+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
229236
github.com/moby/term v0.5.0 // indirect
230237
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
231238
github.com/modern-go/reflect2 v1.0.2 // indirect
@@ -332,11 +339,11 @@ require (
332339
go.step.sm/crypto v0.51.1 // indirect
333340
go.uber.org/multierr v1.11.0 // indirect
334341
go.uber.org/zap v1.27.0 // indirect
335-
golang.org/x/arch v0.8.0 // indirect
342+
golang.org/x/arch v0.12.0 // indirect
336343
golang.org/x/crypto v0.31.0 // indirect
337344
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
338345
golang.org/x/mod v0.20.0 // indirect
339-
golang.org/x/net v0.29.0 // indirect
346+
golang.org/x/net v0.32.0 // indirect
340347
golang.org/x/oauth2 v0.23.0 // indirect
341348
golang.org/x/sync v0.10.0 // indirect
342349
golang.org/x/sys v0.28.0 // indirect
@@ -348,7 +355,7 @@ require (
348355
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
349356
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
350357
google.golang.org/grpc v1.67.0 // indirect
351-
google.golang.org/protobuf v1.34.2 // indirect
358+
google.golang.org/protobuf v1.35.2 // indirect
352359
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
353360
gopkg.in/inf.v0 v0.9.1 // indirect
354361
gopkg.in/ini.v1 v1.67.0 // indirect

backend/go.sum

+34-21
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,11 @@ github.com/buildkite/roko v1.2.0/go.mod h1:23R9e6nHxgedznkwwfmqZ6+0VJZJZ2Sg/uVcp
197197
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
198198
github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 h1:3uZCA/BLTIu+DqCfguByNMJa2HVHpXvjfy0Dy7g6fuA=
199199
github.com/bytecodealliance/wasmtime-go/v3 v3.0.2/go.mod h1:RnUjnIXxEJcL6BgCvNyzCCRzZcxCgsZCi+RNlvYor5Q=
200-
github.com/bytedance/sonic v1.11.9 h1:LFHENlIY/SLzDWverzdOvgMztTxcfcF+cqNsz9pK5zg=
201-
github.com/bytedance/sonic v1.11.9/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
202-
github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
200+
github.com/bytedance/sonic v1.12.5 h1:hoZxY8uW+mT+OpkcUWw4k0fDINtOcVavEsGfzwzFU/w=
201+
github.com/bytedance/sonic v1.12.5/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk=
203202
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
203+
github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iCjjJv3+E=
204+
github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
204205
github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M=
205206
github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs=
206207
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
@@ -317,8 +318,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
317318
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
318319
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
319320
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
320-
github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I=
321-
github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s=
321+
github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA=
322+
github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU=
322323
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew=
323324
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I=
324325
github.com/gin-contrib/cors v1.7.2 h1:oLDHxdg8W/XDoN/8zamqk/Drgt4oVZDvaV0YmvVICQw=
@@ -381,8 +382,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
381382
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
382383
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
383384
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
384-
github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao=
385-
github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
385+
github.com/go-playground/validator/v10 v10.23.0 h1:/PwmTwZhS0dPkav3cdK9kV1FsAmrL8sThn8IHr/sO+o=
386+
github.com/go-playground/validator/v10 v10.23.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
386387
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
387388
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
388389
github.com/go-rod/rod v0.116.2 h1:A5t2Ky2A+5eD/ZJQr1EfsQSe5rms5Xof/qj296e+ZqA=
@@ -395,10 +396,12 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v
395396
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
396397
github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=
397398
github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
399+
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
400+
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
398401
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
399402
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
400-
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
401-
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
403+
github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM=
404+
github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
402405
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
403406
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
404407
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -590,8 +593,16 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
590593
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
591594
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
592595
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
593-
github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM=
594-
github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
596+
github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY=
597+
github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8=
598+
github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
599+
github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
600+
github.com/knadh/koanf/parsers/yaml v0.1.0 h1:ZZ8/iGfRLvKSaMEECEBPM1HQslrZADk8fP1XFUxVI5w=
601+
github.com/knadh/koanf/parsers/yaml v0.1.0/go.mod h1:cvbUDC7AL23pImuQP0oRw/hPuccrNBS2bps8asS0CwY=
602+
github.com/knadh/koanf/providers/file v1.1.2 h1:aCC36YGOgV5lTtAFz2qkgtWdeQsgfxUkxDOe+2nQY3w=
603+
github.com/knadh/koanf/providers/file v1.1.2/go.mod h1:/faSBcv2mxPVjFrXck95qeoyoZ5myJ6uxN8OOVNJJCI=
604+
github.com/knadh/koanf/v2 v2.1.2 h1:I2rtLRqXRy1p01m/utEtpZSSA6dcJbgGVuE27kW2PzQ=
605+
github.com/knadh/koanf/v2 v2.1.2/go.mod h1:Gphfaen0q1Fc1HTgJgSTC4oRX9R2R5ErYMZJy8fLJBo=
595606
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
596607
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
597608
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
@@ -639,12 +650,16 @@ github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eyk
639650
github.com/miekg/pkcs11 v1.0.3-0.20190429190417-a667d056470f/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
640651
github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU=
641652
github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
653+
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
654+
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
642655
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
643656
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
644657
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
645658
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
646659
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
647660
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
661+
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
662+
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
648663
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
649664
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
650665
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -836,8 +851,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
836851
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
837852
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
838853
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
839-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
840-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
854+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
855+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
841856
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
842857
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
843858
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
@@ -957,9 +972,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
957972
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
958973
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
959974
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
960-
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
961-
golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc=
962-
golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
975+
golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg=
976+
golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
963977
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
964978
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
965979
golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -1018,8 +1032,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
10181032
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
10191033
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
10201034
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
1021-
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
1022-
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
1035+
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
1036+
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
10231037
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
10241038
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
10251039
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
@@ -1152,8 +1166,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
11521166
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
11531167
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
11541168
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
1155-
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
1156-
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
1169+
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
1170+
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
11571171
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
11581172
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
11591173
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
@@ -1213,7 +1227,6 @@ k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3/go.mod h1:OLgZIPagt7ERELqWJFomSt
12131227
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
12141228
oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c=
12151229
oras.land/oras-go/v2 v2.5.0/go.mod h1:z4eisnLP530vwIOUOJeBIj0aGI0L1C3d53atvCBqZHg=
1216-
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
12171230
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY=
12181231
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
12191232
sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk=

backend/pkg/cmd/root.go

+13
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ import (
1313
"k8s.io/client-go/tools/clientcmd"
1414

1515
"github.com/kyverno/playground/backend/pkg/cluster"
16+
"github.com/kyverno/playground/backend/pkg/config"
1617
"github.com/kyverno/playground/backend/pkg/engine"
1718
"github.com/kyverno/playground/backend/pkg/server"
1819
"github.com/kyverno/playground/backend/pkg/server/api"
20+
apiconfig "github.com/kyverno/playground/backend/pkg/server/api/config"
1921
"github.com/kyverno/playground/backend/pkg/utils"
2022
)
2123

@@ -25,6 +27,7 @@ type commandFlags struct {
2527
uiFlags uiFlags
2628
engineFlags engineFlags
2729
clusterFlags clusterFlags
30+
configFile string
2831
}
2932

3033
type serverFlags struct {
@@ -58,6 +61,7 @@ func NewRootCommand() *cobra.Command {
5861
res := &cobra.Command{
5962
RunE: command.Run,
6063
}
64+
res.Flags().StringVar(&command.configFile, "config", "", "path to an optional config file")
6165
// server flags
6266
res.Flags().StringVar(&command.serverFlags.host, "server-host", "0.0.0.0", "server host")
6367
res.Flags().IntVar(&command.serverFlags.port, "server-port", 8080, "server port")
@@ -78,6 +82,12 @@ func NewRootCommand() *cobra.Command {
7882
}
7983

8084
func (c *commandFlags) Run(_ *cobra.Command, _ []string) error {
85+
cfg := &config.Config{}
86+
err := config.Load(cfg, c.configFile)
87+
if err != nil {
88+
return err
89+
}
90+
8191
// initialise gin framework
8292
gin.SetMode(c.ginFlags.mode)
8393
tonic.SetBindHook(tonic.DefaultBindingHookMaxBodyBytes(int64(c.ginFlags.maxBodySize)))
@@ -111,6 +121,9 @@ func (c *commandFlags) Run(_ *cobra.Command, _ []string) error {
111121
BuiltInCrds: c.engineFlags.builtInCrds,
112122
LocalCrds: c.engineFlags.localCrds,
113123
},
124+
Versions: utils.Map(cfg.Versions, func(version config.Version) apiconfig.Version {
125+
return apiconfig.Version(version)
126+
}),
114127
}
115128
// register API routes (with/without cluster support)
116129
if c.clusterFlags.cluster {

backend/pkg/config/config.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package config
2+
3+
type Version struct {
4+
Name string `koanf:"name"`
5+
URL string `koanf:"url"`
6+
}
7+
8+
type Config struct {
9+
Versions []Version `koanf:"versions"`
10+
}

0 commit comments

Comments
 (0)