From 7fb94ad995db6c00dbef2c0d2591b5df373f37e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?=
Date: Sat, 10 Aug 2024 23:25:45 +0100
Subject: [PATCH] feat: migrate to new expressions (#1843)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Charles-Edouard Brétéché
---
pkg/apis/v1alpha1/action.go | 16 ++++-----
pkg/apis/v1alpha1/types.go | 20 ++++++-----
pkg/apis/v1alpha1/types_test.go | 2 +-
pkg/apis/v1alpha1/zz_generated.deepcopy.go | 2 +-
pkg/commands/migrate/kuttl/tests/command.go | 22 ++++++------
pkg/engine/bindings/bindings.go | 3 +-
pkg/engine/kubectl/describe.go | 7 ++--
pkg/engine/kubectl/get.go | 9 +++--
pkg/engine/kubectl/logs.go | 9 +++--
pkg/engine/kubectl/mapping.go | 5 ++-
pkg/engine/kubectl/proxy.go | 9 +++--
pkg/engine/kubectl/wait.go | 17 +++++-----
pkg/engine/kubectl/wait_test.go | 4 +--
pkg/runner/processors/step.go | 8 ++---
.../docs/reference/apis/chainsaw.v1alpha1.md | 34 ++++++++++++-------
15 files changed, 85 insertions(+), 82 deletions(-)
diff --git a/pkg/apis/v1alpha1/action.go b/pkg/apis/v1alpha1/action.go
index 02ac034c5..745c084eb 100644
--- a/pkg/apis/v1alpha1/action.go
+++ b/pkg/apis/v1alpha1/action.go
@@ -97,7 +97,7 @@ type ActionObjectSelector struct {
// Selector defines labels selector.
// +optional
- Selector string `json:"selector,omitempty"`
+ Selector Expression `json:"selector,omitempty"`
}
// ActionOutputs contains outputs options for an action.
@@ -274,7 +274,7 @@ type PodLogs struct {
// Container in pod to get logs from else --all-containers is used.
// +optional
- Container string `json:"container,omitempty"`
+ Container Expression `json:"container,omitempty"`
// Tail is the number of last lines to collect from pods. If omitted or zero,
// then the default is 10 if you use a selector, or -1 (all) if you use a pod name.
@@ -293,11 +293,11 @@ type Proxy struct {
// TargetPort defines the target port to proxy the request.
// +optional
- TargetPort string `json:"port,omitempty"`
+ TargetPort Expression `json:"port,omitempty"`
// TargetPath defines the target path to proxy the request.
// +optional
- TargetPath string `json:"path,omitempty"`
+ TargetPath Expression `json:"path,omitempty"`
}
// Script describes a script to run as a part of a test step.
@@ -361,11 +361,11 @@ type WaitFor struct {
// WaitForCondition represents parameters for waiting on a specific condition of a resource.
type WaitForCondition struct {
// Name defines the specific condition to wait for, e.g., "Available", "Ready".
- Name string `json:"name"`
+ Name Expression `json:"name"`
// Value defines the specific condition status to wait for, e.g., "True", "False".
// +optional
- Value *string `json:"value,omitempty"`
+ Value *Expression `json:"value,omitempty"`
}
// WaitForDeletion represents parameters for waiting on a resource's deletion.
@@ -374,8 +374,8 @@ type WaitForDeletion struct{}
// WaitForJsonPath represents parameters for waiting on a json path of a resource.
type WaitForJsonPath struct {
// Path defines the json path to wait for, e.g. '{.status.phase}'.
- Path string `json:"path"`
+ Path Expression `json:"path"`
// Value defines the expected value to wait for, e.g., "Running".
- Value string `json:"value"`
+ Value Expression `json:"value"`
}
diff --git a/pkg/apis/v1alpha1/types.go b/pkg/apis/v1alpha1/types.go
index 694d1db16..9d50cf4b5 100644
--- a/pkg/apis/v1alpha1/types.go
+++ b/pkg/apis/v1alpha1/types.go
@@ -19,8 +19,9 @@ type Any = v1alpha1.Any
// Binding represents a key/value set as a binding in an executing test.
type Binding struct {
// Name the name of the binding.
- // +kubebuilder:validation:Pattern=`^(?:\w+|\(.+\))$`
- Name string `json:"name"`
+ // +kubebuilder:validation:Type:=string
+ // +kubebuilder:validation:Pattern:=`^(?:\w+|\(.+\))$`
+ Name Expression `json:"name"`
// Value value of the binding.
// +kubebuilder:validation:Schemaless
@@ -29,7 +30,7 @@ type Binding struct {
}
func (b Binding) CheckName() error {
- if !identifier.MatchString(b.Name) {
+ if !identifier.MatchString(string(b.Name)) {
return fmt.Errorf("invalid name %s", b.Name)
}
return nil
@@ -70,8 +71,9 @@ func (e Expression) Value(ctx context.Context, bindings binding.Bindings) (strin
}
// Format determines the output format (json or yaml).
-// +kubebuilder:validation:Pattern=`^(?:json|yaml|\(.+\))$`
-type Format string
+// +kubebuilder:validation:Type:=string
+// +kubebuilder:validation:Pattern:=`^(?:json|yaml|\(.+\))$`
+type Format Expression
// Match represents a match condition against an evaluated object.
type Match = Any
@@ -81,12 +83,12 @@ type ObjectName struct {
// Namespace of the referent.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
// +optional
- Namespace string `json:"namespace,omitempty"`
+ Namespace Expression `json:"namespace,omitempty"`
// Name of the referent.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
// +optional
- Name string `json:"name,omitempty"`
+ Name Expression `json:"name,omitempty"`
}
// ObjectReference represents one or more objects with a specific apiVersion and kind.
@@ -104,11 +106,11 @@ type ObjectReference struct {
// ObjectType represents a specific apiVersion and kind.
type ObjectType struct {
// API version of the referent.
- APIVersion string `json:"apiVersion"`
+ APIVersion Expression `json:"apiVersion"`
// Kind of the referent.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- Kind string `json:"kind"`
+ Kind Expression `json:"kind"`
}
// Output represents an output binding with a match to determine if the binding must be considered or not.
diff --git a/pkg/apis/v1alpha1/types_test.go b/pkg/apis/v1alpha1/types_test.go
index 31701736b..8a4a8c665 100644
--- a/pkg/apis/v1alpha1/types_test.go
+++ b/pkg/apis/v1alpha1/types_test.go
@@ -11,7 +11,7 @@ import (
func TestBinding_CheckName(t *testing.T) {
tests := []struct {
name string
- bindingName string
+ bindingName Expression
bindingValue Any
wantErr bool
}{{
diff --git a/pkg/apis/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/v1alpha1/zz_generated.deepcopy.go
index 4daa26d1d..f07a89e45 100644
--- a/pkg/apis/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/v1alpha1/zz_generated.deepcopy.go
@@ -1583,7 +1583,7 @@ func (in *WaitForCondition) DeepCopyInto(out *WaitForCondition) {
*out = *in
if in.Value != nil {
in, out := &in.Value, &out.Value
- *out = new(string)
+ *out = new(Expression)
**out = **in
}
return
diff --git a/pkg/commands/migrate/kuttl/tests/command.go b/pkg/commands/migrate/kuttl/tests/command.go
index b8a525761..10cba51a1 100644
--- a/pkg/commands/migrate/kuttl/tests/command.go
+++ b/pkg/commands/migrate/kuttl/tests/command.go
@@ -455,12 +455,12 @@ func testStep(to *v1alpha1.TestStepSpec, in unstructured.Unstructured) error {
Delete: &v1alpha1.Delete{
Ref: &v1alpha1.ObjectReference{
ObjectType: v1alpha1.ObjectType{
- APIVersion: operation.APIVersion,
- Kind: operation.Kind,
+ APIVersion: v1alpha1.Expression(operation.APIVersion),
+ Kind: v1alpha1.Expression(operation.Kind),
},
ObjectName: v1alpha1.ObjectName{
- Namespace: operation.Namespace,
- Name: operation.Name,
+ Namespace: v1alpha1.Expression(operation.Namespace),
+ Name: v1alpha1.Expression(operation.Name),
},
Labels: operation.Labels,
},
@@ -506,12 +506,12 @@ func testAssert(to *v1alpha1.TestStepSpec, in unstructured.Unstructured) error {
op := &v1alpha1.PodLogs{
ActionObjectSelector: v1alpha1.ActionObjectSelector{
ObjectName: v1alpha1.ObjectName{
- Name: collector.Pod,
- Namespace: collector.Namespace,
+ Name: v1alpha1.Expression(collector.Pod),
+ Namespace: v1alpha1.Expression(collector.Namespace),
},
- Selector: collector.Selector,
+ Selector: v1alpha1.Expression(collector.Selector),
},
- Container: collector.Container,
+ Container: v1alpha1.Expression(collector.Container),
}
if collector.Tail != 0 {
op.Tail = ptr.To(collector.Tail)
@@ -531,10 +531,10 @@ func testAssert(to *v1alpha1.TestStepSpec, in unstructured.Unstructured) error {
Events: &v1alpha1.Events{
ActionObjectSelector: v1alpha1.ActionObjectSelector{
ObjectName: v1alpha1.ObjectName{
- Name: collector.Pod,
- Namespace: collector.Namespace,
+ Name: v1alpha1.Expression(collector.Pod),
+ Namespace: v1alpha1.Expression(collector.Namespace),
},
- Selector: collector.Selector,
+ Selector: v1alpha1.Expression(collector.Selector),
},
},
})
diff --git a/pkg/engine/bindings/bindings.go b/pkg/engine/bindings/bindings.go
index c10dcdd41..3d6d1acbd 100644
--- a/pkg/engine/bindings/bindings.go
+++ b/pkg/engine/bindings/bindings.go
@@ -8,7 +8,6 @@ import (
"github.com/jmespath-community/go-jmespath/pkg/binding"
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
"github.com/kyverno/chainsaw/pkg/engine/templating"
- "github.com/kyverno/chainsaw/pkg/expressions"
)
var identifier = regexp.MustCompile(`^\w+$`)
@@ -25,7 +24,7 @@ func RegisterBinding(ctx context.Context, bindings binding.Bindings, name string
}
func ResolveBinding(ctx context.Context, bindings binding.Bindings, input any, variable v1alpha1.Binding) (string, any, error) {
- name, err := expressions.String(ctx, variable.Name, bindings)
+ name, err := variable.Name.Value(ctx, bindings)
if err != nil {
return "", nil, err
}
diff --git a/pkg/engine/kubectl/describe.go b/pkg/engine/kubectl/describe.go
index d265af8e7..46599463b 100644
--- a/pkg/engine/kubectl/describe.go
+++ b/pkg/engine/kubectl/describe.go
@@ -8,22 +8,21 @@ import (
"github.com/jmespath-community/go-jmespath/pkg/binding"
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
"github.com/kyverno/chainsaw/pkg/client"
- "github.com/kyverno/chainsaw/pkg/expressions"
)
func Describe(ctx context.Context, client client.Client, tc binding.Bindings, collector *v1alpha1.Describe) (string, []string, error) {
if collector == nil {
return "", nil, errors.New("collector is null")
}
- name, err := expressions.String(ctx, collector.Name, tc)
+ name, err := collector.Name.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- namespace, err := expressions.String(ctx, collector.Namespace, tc)
+ namespace, err := collector.Namespace.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- selector, err := expressions.String(ctx, collector.Selector, tc)
+ selector, err := collector.Selector.Value(ctx, tc)
if err != nil {
return "", nil, err
}
diff --git a/pkg/engine/kubectl/get.go b/pkg/engine/kubectl/get.go
index 9fcde532f..a16e67ae8 100644
--- a/pkg/engine/kubectl/get.go
+++ b/pkg/engine/kubectl/get.go
@@ -7,26 +7,25 @@ import (
"github.com/jmespath-community/go-jmespath/pkg/binding"
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
"github.com/kyverno/chainsaw/pkg/client"
- "github.com/kyverno/chainsaw/pkg/expressions"
)
func Get(ctx context.Context, client client.Client, tc binding.Bindings, collector *v1alpha1.Get) (string, []string, error) {
if collector == nil {
return "", nil, errors.New("collector is null")
}
- name, err := expressions.String(ctx, collector.Name, tc)
+ name, err := collector.Name.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- namespace, err := expressions.String(ctx, collector.Namespace, tc)
+ namespace, err := collector.Namespace.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- selector, err := expressions.String(ctx, collector.Selector, tc)
+ selector, err := collector.Selector.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- format, err := expressions.String(ctx, string(collector.Format), tc)
+ format, err := v1alpha1.Expression(collector.Format).Value(ctx, tc)
if err != nil {
return "", nil, err
}
diff --git a/pkg/engine/kubectl/logs.go b/pkg/engine/kubectl/logs.go
index c625a519a..f64a91e95 100644
--- a/pkg/engine/kubectl/logs.go
+++ b/pkg/engine/kubectl/logs.go
@@ -7,26 +7,25 @@ import (
"github.com/jmespath-community/go-jmespath/pkg/binding"
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
- "github.com/kyverno/chainsaw/pkg/expressions"
)
func Logs(ctx context.Context, tc binding.Bindings, collector *v1alpha1.PodLogs) (string, []string, error) {
if collector == nil {
return "", nil, errors.New("collector is null")
}
- name, err := expressions.String(ctx, collector.Name, tc)
+ name, err := collector.Name.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- namespace, err := expressions.String(ctx, collector.Namespace, tc)
+ namespace, err := collector.Namespace.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- selector, err := expressions.String(ctx, collector.Selector, tc)
+ selector, err := collector.Selector.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- container, err := expressions.String(ctx, collector.Container, tc)
+ container, err := collector.Container.Value(ctx, tc)
if err != nil {
return "", nil, err
}
diff --git a/pkg/engine/kubectl/mapping.go b/pkg/engine/kubectl/mapping.go
index 4b82c6945..1f38b03c7 100644
--- a/pkg/engine/kubectl/mapping.go
+++ b/pkg/engine/kubectl/mapping.go
@@ -8,16 +8,15 @@ import (
"github.com/jmespath-community/go-jmespath/pkg/binding"
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
"github.com/kyverno/chainsaw/pkg/client"
- "github.com/kyverno/chainsaw/pkg/expressions"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime/schema"
)
func mapResource(ctx context.Context, client client.Client, tc binding.Bindings, resource v1alpha1.ObjectType) (string, bool, error) {
if resource.APIVersion != "" && resource.Kind != "" {
- if apiVersion, err := expressions.String(ctx, resource.APIVersion, tc); err != nil {
+ if apiVersion, err := resource.APIVersion.Value(ctx, tc); err != nil {
return "", false, err
- } else if kind, err := expressions.String(ctx, resource.Kind, tc); err != nil {
+ } else if kind, err := resource.Kind.Value(ctx, tc); err != nil {
return "", false, err
} else {
return mapResourceFromApiVersionAndKind(client, apiVersion, kind)
diff --git a/pkg/engine/kubectl/proxy.go b/pkg/engine/kubectl/proxy.go
index 4254a8c0e..045e81361 100644
--- a/pkg/engine/kubectl/proxy.go
+++ b/pkg/engine/kubectl/proxy.go
@@ -8,26 +8,25 @@ import (
"github.com/jmespath-community/go-jmespath/pkg/binding"
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
"github.com/kyverno/chainsaw/pkg/client"
- "github.com/kyverno/chainsaw/pkg/expressions"
)
func Proxy(ctx context.Context, client client.Client, tc binding.Bindings, collector *v1alpha1.Proxy) (string, []string, error) {
if collector == nil {
return "", nil, errors.New("collector is null")
}
- name, err := expressions.String(ctx, collector.Name, tc)
+ name, err := collector.Name.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- namespace, err := expressions.String(ctx, collector.Namespace, tc)
+ namespace, err := collector.Namespace.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- targetPath, err := expressions.String(ctx, collector.TargetPath, tc)
+ targetPath, err := collector.TargetPath.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- targetPort, err := expressions.String(ctx, collector.TargetPort, tc)
+ targetPort, err := collector.TargetPort.Value(ctx, tc)
if err != nil {
return "", nil, err
}
diff --git a/pkg/engine/kubectl/wait.go b/pkg/engine/kubectl/wait.go
index 5b1488398..215600932 100644
--- a/pkg/engine/kubectl/wait.go
+++ b/pkg/engine/kubectl/wait.go
@@ -8,26 +8,25 @@ import (
"github.com/jmespath-community/go-jmespath/pkg/binding"
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
"github.com/kyverno/chainsaw/pkg/client"
- "github.com/kyverno/chainsaw/pkg/expressions"
)
func Wait(ctx context.Context, client client.Client, tc binding.Bindings, collector *v1alpha1.Wait) (string, []string, error) {
if collector == nil {
return "", nil, errors.New("collector is null")
}
- name, err := expressions.String(ctx, collector.Name, tc)
+ name, err := collector.Name.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- namespace, err := expressions.String(ctx, collector.Namespace, tc)
+ namespace, err := collector.Namespace.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- selector, err := expressions.String(ctx, collector.Selector, tc)
+ selector, err := collector.Selector.Value(ctx, tc)
if err != nil {
return "", nil, err
}
- format, err := expressions.String(ctx, string(collector.Format), tc)
+ format, err := v1alpha1.Expression(collector.Format).Value(ctx, tc)
if err != nil {
return "", nil, err
}
@@ -42,7 +41,7 @@ func Wait(ctx context.Context, client client.Client, tc binding.Bindings, collec
if collector.WaitFor.Deletion != nil {
args = append(args, "--for=delete")
} else if collector.WaitFor.Condition != nil {
- name, err := expressions.String(ctx, collector.WaitFor.Condition.Name, tc)
+ name, err := collector.WaitFor.Condition.Name.Value(ctx, tc)
if err != nil {
return "", nil, err
}
@@ -50,7 +49,7 @@ func Wait(ctx context.Context, client client.Client, tc binding.Bindings, collec
return "", nil, errors.New("a condition name must be specified for condition wait type")
}
if collector.WaitFor.Condition.Value != nil {
- value, err := expressions.String(ctx, *collector.WaitFor.Condition.Value, tc)
+ value, err := collector.WaitFor.Condition.Value.Value(ctx, tc)
if err != nil {
return "", nil, err
}
@@ -59,14 +58,14 @@ func Wait(ctx context.Context, client client.Client, tc binding.Bindings, collec
args = append(args, fmt.Sprintf("--for=condition=%s", name))
}
} else if collector.WaitFor.JsonPath != nil {
- path, err := expressions.String(ctx, collector.WaitFor.JsonPath.Path, tc)
+ path, err := collector.WaitFor.JsonPath.Path.Value(ctx, tc)
if err != nil {
return "", nil, err
}
if path == "" {
return "", nil, errors.New("a path must be specified for jsonpath wait type")
}
- value, err := expressions.String(ctx, collector.WaitFor.JsonPath.Value, tc)
+ value, err := collector.WaitFor.JsonPath.Value.Value(ctx, tc)
if err != nil {
return "", nil, err
}
diff --git a/pkg/engine/kubectl/wait_test.go b/pkg/engine/kubectl/wait_test.go
index 8f2c3a3e1..3555ff5d7 100644
--- a/pkg/engine/kubectl/wait_test.go
+++ b/pkg/engine/kubectl/wait_test.go
@@ -81,7 +81,7 @@ func TestWait(t *testing.T) {
WaitFor: v1alpha1.WaitFor{
Condition: &v1alpha1.WaitForCondition{
Name: "Ready",
- Value: ptr.To("test"),
+ Value: ptr.To(v1alpha1.Expression("test")),
},
},
},
@@ -100,7 +100,7 @@ func TestWait(t *testing.T) {
WaitFor: v1alpha1.WaitFor{
Condition: &v1alpha1.WaitForCondition{
Name: "Ready",
- Value: ptr.To(""),
+ Value: ptr.To(v1alpha1.Expression("")),
},
},
},
diff --git a/pkg/runner/processors/step.go b/pkg/runner/processors/step.go
index f1df7dcb7..7ded43f46 100644
--- a/pkg/runner/processors/step.go
+++ b/pkg/runner/processors/step.go
@@ -573,10 +573,10 @@ func (p *stepProcessor) deleteOperation(id int, namespacer namespacer.Namespacer
}
if op.Ref != nil {
var resource unstructured.Unstructured
- resource.SetAPIVersion(op.Ref.APIVersion)
- resource.SetKind(op.Ref.Kind)
- resource.SetName(op.Ref.Name)
- resource.SetNamespace(op.Ref.Namespace)
+ resource.SetAPIVersion(string(op.Ref.APIVersion))
+ resource.SetKind(string(op.Ref.Kind))
+ resource.SetName(string(op.Ref.Name))
+ resource.SetNamespace(string(op.Ref.Namespace))
resource.SetLabels(op.Ref.Labels)
ref.Resource = &resource
}
diff --git a/website/docs/reference/apis/chainsaw.v1alpha1.md b/website/docs/reference/apis/chainsaw.v1alpha1.md
index cae9b2e41..035387c80 100644
--- a/website/docs/reference/apis/chainsaw.v1alpha1.md
+++ b/website/docs/reference/apis/chainsaw.v1alpha1.md
@@ -222,7 +222,7 @@ auto_generated: true
| Field | Type | Required | Inline | Description |
|---|---|---|---|---|
| `ObjectName` | [`ObjectName`](#chainsaw-kyverno-io-v1alpha1-ObjectName) | :white_check_mark: | :white_check_mark: | *No description provided.* |
-| `selector` | `string` | | | Selector defines labels selector.
|
+| `selector` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | | | Selector defines labels selector.
|
## ActionOutputs {#chainsaw-kyverno-io-v1alpha1-ActionOutputs}
@@ -342,7 +342,7 @@ during the testing process.
| Field | Type | Required | Inline | Description |
|---|---|---|---|---|
-| `name` | `string` | :white_check_mark: | | Name the name of the binding.
|
+| `name` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | :white_check_mark: | | Name the name of the binding.
|
| `value` | `policy/v1alpha1.Any` | :white_check_mark: | | Value value of the binding.
|
## CatchFinally {#chainsaw-kyverno-io-v1alpha1-CatchFinally}
@@ -568,8 +568,16 @@ with a match filter to determine if the verification should be considered.
**Appears in:**
+- [ActionObjectSelector](#chainsaw-kyverno-io-v1alpha1-ActionObjectSelector)
+- [Binding](#chainsaw-kyverno-io-v1alpha1-Binding)
- [Delete](#chainsaw-kyverno-io-v1alpha1-Delete)
- [FileRef](#chainsaw-kyverno-io-v1alpha1-FileRef)
+- [ObjectName](#chainsaw-kyverno-io-v1alpha1-ObjectName)
+- [ObjectType](#chainsaw-kyverno-io-v1alpha1-ObjectType)
+- [PodLogs](#chainsaw-kyverno-io-v1alpha1-PodLogs)
+- [Proxy](#chainsaw-kyverno-io-v1alpha1-Proxy)
+- [WaitForCondition](#chainsaw-kyverno-io-v1alpha1-WaitForCondition)
+- [WaitForJsonPath](#chainsaw-kyverno-io-v1alpha1-WaitForJsonPath)
Expression defines an expression to be used in string fields.
@@ -629,8 +637,8 @@ with a match filter to determine if the verification should be considered.
| Field | Type | Required | Inline | Description |
|---|---|---|---|---|
-| `namespace` | `string` | | | Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
|
-| `name` | `string` | | | Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
+| `namespace` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | | | Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
|
+| `name` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | | | Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
## ObjectReference {#chainsaw-kyverno-io-v1alpha1-ObjectReference}
@@ -662,8 +670,8 @@ For multiple objects use labels.
| Field | Type | Required | Inline | Description |
|---|---|---|---|---|
-| `apiVersion` | `string` | :white_check_mark: | | API version of the referent.
|
-| `kind` | `string` | :white_check_mark: | | Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
+| `apiVersion` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | :white_check_mark: | | API version of the referent.
|
+| `kind` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | :white_check_mark: | | Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
## Operation {#chainsaw-kyverno-io-v1alpha1-Operation}
@@ -758,7 +766,7 @@ If a resource doesn't exist yet in the cluster it will fail.
| `ActionClusters` | [`ActionClusters`](#chainsaw-kyverno-io-v1alpha1-ActionClusters) | :white_check_mark: | :white_check_mark: | *No description provided.* |
| `ActionObjectSelector` | [`ActionObjectSelector`](#chainsaw-kyverno-io-v1alpha1-ActionObjectSelector) | :white_check_mark: | :white_check_mark: | *No description provided.* |
| `ActionTimeout` | [`ActionTimeout`](#chainsaw-kyverno-io-v1alpha1-ActionTimeout) | :white_check_mark: | :white_check_mark: | *No description provided.* |
-| `container` | `string` | | | Container in pod to get logs from else --all-containers is used.
|
+| `container` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | | | Container in pod to get logs from else --all-containers is used.
|
| `tail` | `int` | | | Tail is the number of last lines to collect from pods. If omitted or zero, then the default is 10 if you use a selector, or -1 (all) if you use a pod name. This matches default behavior of `kubectl logs`.
|
## Proxy {#chainsaw-kyverno-io-v1alpha1-Proxy}
@@ -777,8 +785,8 @@ If a resource doesn't exist yet in the cluster it will fail.
| `ActionTimeout` | [`ActionTimeout`](#chainsaw-kyverno-io-v1alpha1-ActionTimeout) | :white_check_mark: | :white_check_mark: | *No description provided.* |
| `ObjectName` | [`ObjectName`](#chainsaw-kyverno-io-v1alpha1-ObjectName) | :white_check_mark: | :white_check_mark: | *No description provided.* |
| `ObjectType` | [`ObjectType`](#chainsaw-kyverno-io-v1alpha1-ObjectType) | :white_check_mark: | :white_check_mark: | *No description provided.* |
-| `port` | `string` | | | TargetPort defines the target port to proxy the request.
|
-| `path` | `string` | | | TargetPath defines the target path to proxy the request.
|
+| `port` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | | | TargetPort defines the target port to proxy the request.
|
+| `path` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | | | TargetPath defines the target path to proxy the request.
|
## ReportFormatType {#chainsaw-kyverno-io-v1alpha1-ReportFormatType}
@@ -1017,8 +1025,8 @@ If a resource does not exist in the cluster it will fail.
| Field | Type | Required | Inline | Description |
|---|---|---|---|---|
-| `name` | `string` | :white_check_mark: | | Name defines the specific condition to wait for, e.g., "Available", "Ready".
|
-| `value` | `string` | | | Value defines the specific condition status to wait for, e.g., "True", "False".
|
+| `name` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | :white_check_mark: | | Name defines the specific condition to wait for, e.g., "Available", "Ready".
|
+| `value` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | | | Value defines the specific condition status to wait for, e.g., "True", "False".
|
## WaitForDeletion {#chainsaw-kyverno-io-v1alpha1-WaitForDeletion}
@@ -1040,7 +1048,7 @@ If a resource does not exist in the cluster it will fail.
| Field | Type | Required | Inline | Description |
|---|---|---|---|---|
-| `path` | `string` | :white_check_mark: | | Path defines the json path to wait for, e.g. '{.status.phase}'.
|
-| `value` | `string` | :white_check_mark: | | Value defines the expected value to wait for, e.g., "Running".
|
+| `path` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | :white_check_mark: | | Path defines the json path to wait for, e.g. '{.status.phase}'.
|
+| `value` | [`Expression`](#chainsaw-kyverno-io-v1alpha1-Expression) | :white_check_mark: | | Value defines the expected value to wait for, e.g., "Running".
|
\ No newline at end of file