mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
feat: update built-in resource schemas (#7014)
* feat: update built-in resource schemas Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix unit test Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> --------- Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
0c22858bbc
commit
2e2d5d8db7
6 changed files with 88284 additions and 113360 deletions
File diff suppressed because it is too large
Load diff
14
data/data.go
Normal file
14
data/data.go
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package data
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "embed"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed swagger.json
|
||||||
|
var SwaggerDoc string
|
||||||
|
|
||||||
|
//go:embed preferred-resources.json
|
||||||
|
var PreferredAPIResourceLists string
|
||||||
|
|
||||||
|
//go:embed api-resources.json
|
||||||
|
var APIResourceLists string
|
File diff suppressed because it is too large
Load diff
87181
data/swagger.json
Normal file
87181
data/swagger.json
Normal file
File diff suppressed because it is too large
Load diff
110622
data/swaggerDoc.go
110622
data/swaggerDoc.go
File diff suppressed because it is too large
Load diff
|
@ -196,10 +196,7 @@ func Test_matchGVK(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this test covers all supported Ingress in 1.20 cluster
|
// this test covers all supported Ingress
|
||||||
// networking.k8s.io/v1/Ingress
|
|
||||||
// networking.k8s.io/v1beta1/Ingress
|
|
||||||
// extensions/v1beta1/Ingress
|
|
||||||
func Test_Ingress(t *testing.T) {
|
func Test_Ingress(t *testing.T) {
|
||||||
o, err := NewManager(logr.Discard())
|
o, err := NewManager(logr.Discard())
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
@ -208,17 +205,11 @@ func Test_Ingress(t *testing.T) {
|
||||||
assert.Equal(t, true, ok)
|
assert.Equal(t, true, ok)
|
||||||
|
|
||||||
assert.Equal(t, versions.serverPreferredGVK, "networking.k8s.io/v1/Ingress")
|
assert.Equal(t, versions.serverPreferredGVK, "networking.k8s.io/v1/Ingress")
|
||||||
assert.Equal(t, len(versions.gvks), 3)
|
assert.Equal(t, len(versions.gvks), 1)
|
||||||
|
|
||||||
definitionName, _ := o.gvkToDefinitionName.Get("Ingress")
|
definitionName, _ := o.gvkToDefinitionName.Get("Ingress")
|
||||||
assert.Equal(t, definitionName, "io.k8s.api.networking.v1.Ingress")
|
assert.Equal(t, definitionName, "io.k8s.api.networking.v1.Ingress")
|
||||||
|
|
||||||
definitionName, _ = o.gvkToDefinitionName.Get("networking.k8s.io/v1/Ingress")
|
definitionName, _ = o.gvkToDefinitionName.Get("networking.k8s.io/v1/Ingress")
|
||||||
assert.Equal(t, definitionName, "io.k8s.api.networking.v1.Ingress")
|
assert.Equal(t, definitionName, "io.k8s.api.networking.v1.Ingress")
|
||||||
|
|
||||||
definitionName, _ = o.gvkToDefinitionName.Get("networking.k8s.io/v1beta1/Ingress")
|
|
||||||
assert.Equal(t, definitionName, "io.k8s.api.networking.v1beta1.Ingress")
|
|
||||||
|
|
||||||
definitionName, _ = o.gvkToDefinitionName.Get("extensions/v1beta1/Ingress")
|
|
||||||
assert.Equal(t, definitionName, "io.k8s.api.extensions.v1beta1.Ingress")
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue