diff --git a/pkg/apis/testharness/v1beta1/test_types.go b/pkg/apis/testharness/v1beta1/test_types.go index 28165236..55a4f3b9 100644 --- a/pkg/apis/testharness/v1beta1/test_types.go +++ b/pkg/apis/testharness/v1beta1/test_types.go @@ -227,11 +227,11 @@ type TestCollector struct { } type TestResourceRef struct { - ApiVersion string `json:"apiVersion,omitempty"` + APIVersion string `json:"apiVersion,omitempty"` Kind string `json:"kind,omitempty"` Namespace string `json:"namespace,omitempty"` Name string `json:"name,omitempty"` - Id string `json:"id,omitempty"` + Ref string `json:"ref,omitempty"` } type AnyAllExpressions struct { diff --git a/pkg/test/utils/kubernetes.go b/pkg/test/utils/kubernetes.go index 05d25969..b2e34e06 100644 --- a/pkg/test/utils/kubernetes.go +++ b/pkg/test/utils/kubernetes.go @@ -1245,7 +1245,7 @@ func RunAssertExpressions( variables := make(map[string]interface{}) for _, resourceRef := range resourceRefs { - gvk := constructGVK(resourceRef.ApiVersion, resourceRef.Kind) + gvk := constructGVK(resourceRef.APIVersion, resourceRef.Kind) referencedResource := &unstructured.Unstructured{} referencedResource.SetGroupVersionKind(gvk) @@ -1257,7 +1257,7 @@ func RunAssertExpressions( return []error{fmt.Errorf("failed to get referenced resource '%v': %w", gvk, err)} } - variables[resourceRef.Id] = referencedResource.Object + variables[resourceRef.Ref] = referencedResource.Object } env, err := cel.NewEnv() @@ -1280,7 +1280,7 @@ func RunAssertExpressions( prg, err := env.Program(ast) if err != nil { - return []error{fmt.Errorf("program constuction error: %w", err)} + return []error{fmt.Errorf("program construction error: %w", err)} } out, _, err := prg.Eval(variables)