Skip to content

Commit

Permalink
chore: rename Id->Ref and make linter happy
Browse files Browse the repository at this point in the history
Signed-off-by: Kumar Mallikarjuna <[email protected]>
  • Loading branch information
kumar-mallikarjuna committed Nov 27, 2024
1 parent fd5aae1 commit 0e43475
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/testharness/v1beta1/test_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/test/utils/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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()
Expand All @@ -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)
Expand Down

0 comments on commit 0e43475

Please sign in to comment.