diff --git a/cmd/cli/kubectl-kyverno/apis/v1alpha1/context.go b/cmd/cli/kubectl-kyverno/apis/v1alpha1/context.go index 59af21eb27..19acd3942b 100644 --- a/cmd/cli/kubectl-kyverno/apis/v1alpha1/context.go +++ b/cmd/cli/kubectl-kyverno/apis/v1alpha1/context.go @@ -1,6 +1,7 @@ package v1alpha1 import ( + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) @@ -19,4 +20,17 @@ type Context struct { type ContextSpec struct { Resources []unstructured.Unstructured `json:"resources,omitempty"` + Images []ImageData `json:"images,omitempty"` +} + +type ImageData struct { + Image string `json:"image"` + ResolvedImage string `json:"resolvedImage"` + Registry string `json:"registry"` + Repository string `json:"repository"` + Tag string `json:"tag,omitempty"` + Digest string `json:"digest,omitempty"` + ImageIndex v1alpha1.Any `json:"imageIndex,omitempty"` + Manifest v1alpha1.Any `json:"manifest,omitempty"` + ConfigData v1alpha1.Any `json:"config,omitempty"` } diff --git a/cmd/cli/kubectl-kyverno/config/crds/cli.kyverno.io_contexts.yaml b/cmd/cli/kubectl-kyverno/config/crds/cli.kyverno.io_contexts.yaml index 3695c6d08f..736e2b1af7 100644 --- a/cmd/cli/kubectl-kyverno/config/crds/cli.kyverno.io_contexts.yaml +++ b/cmd/cli/kubectl-kyverno/config/crds/cli.kyverno.io_contexts.yaml @@ -38,6 +38,40 @@ spec: type: object spec: properties: + images: + items: + properties: + config: + description: Any can be any type. + type: object + x-kubernetes-preserve-unknown-fields: true + digest: + type: string + image: + type: string + imageIndex: + description: Any can be any type. + type: object + x-kubernetes-preserve-unknown-fields: true + manifest: + description: Any can be any type. + type: object + x-kubernetes-preserve-unknown-fields: true + registry: + type: string + repository: + type: string + resolvedImage: + type: string + tag: + type: string + required: + - image + - registry + - repository + - resolvedImage + type: object + type: array resources: items: type: object diff --git a/cmd/cli/kubectl-kyverno/data/crds/cli.kyverno.io_contexts.yaml b/cmd/cli/kubectl-kyverno/data/crds/cli.kyverno.io_contexts.yaml index 3695c6d08f..736e2b1af7 100644 --- a/cmd/cli/kubectl-kyverno/data/crds/cli.kyverno.io_contexts.yaml +++ b/cmd/cli/kubectl-kyverno/data/crds/cli.kyverno.io_contexts.yaml @@ -38,6 +38,40 @@ spec: type: object spec: properties: + images: + items: + properties: + config: + description: Any can be any type. + type: object + x-kubernetes-preserve-unknown-fields: true + digest: + type: string + image: + type: string + imageIndex: + description: Any can be any type. + type: object + x-kubernetes-preserve-unknown-fields: true + manifest: + description: Any can be any type. + type: object + x-kubernetes-preserve-unknown-fields: true + registry: + type: string + repository: + type: string + resolvedImage: + type: string + tag: + type: string + required: + - image + - registry + - repository + - resolvedImage + type: object + type: array resources: items: type: object diff --git a/docs/user/cli/crd/index.html b/docs/user/cli/crd/index.html index a8d60a307d..74fb176795 100644 --- a/docs/user/cli/crd/index.html +++ b/docs/user/cli/crd/index.html @@ -103,6 +103,18 @@ ContextSpec
images
images
+(Appears on: +ContextSpec) +
++
+Field | +Description | +
---|---|
+image + +string + + |
++ | +
+resolvedImage + +string + + |
++ | +
+registry + +string + + |
++ | +
+repository + +string + + |
++ | +
+tag + +string + + |
++ | +
+digest + +string + + |
++ | +
+imageIndex + +github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any + + |
++ | +
+manifest + +github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any + + |
++ | +
+config + +github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any + + |
++ | +
images
+
+ *
+
+
+
+
+
+
+
+ []ImageData
+
+
+
+ metadata.name
instead
+
+
+
+
+
+
+ images
+
+ *
+
+
+
+
+
+
+
+ []ImageData
+
+
+
+ + (Appears in: + ContextSpec) +
+ + + + + +Field | +Description | +
---|---|
image
+
+ *
+
+
+
+
+
+
+ string
+
+
+ |
+ + + + + + + + + | +
resolvedImage
+
+ *
+
+
+
+
+
+
+ string
+
+
+ |
+ + + + + + + + + | +
registry
+
+ *
+
+
+
+
+
+
+ string
+
+
+ |
+ + + + + + + + + | +
repository
+
+ *
+
+
+
+
+
+
+ string
+
+
+ |
+ + + + + + + + + | +
tag
+
+ *
+
+
+
+
+
+
+ string
+
+
+ |
+ + + + + + + + + | +
digest
+
+ *
+
+
+
+
+
+
+ string
+
+
+ |
+ + + + + + + + + | +
imageIndex
+
+ *
+
+
+
+
+
+
+ github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any
+
+
+ |
+ + + + + + + + + | +
manifest
+
+ *
+
+
+
+
+
+
+ github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any
+
+
+ |
+ + + + + + + + + | +
config
+
+ *
+
+
+
+
+
+
+ github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any
+
+
+ |
+ + + + + + + + |