@@ -8,26 +8,26 @@ import (
8
8
"github.com/jmespath-community/go-jmespath/pkg/binding"
9
9
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
10
10
"github.com/kyverno/chainsaw/pkg/client"
11
- "github.com/kyverno/chainsaw/pkg/engine/templating "
11
+ "github.com/kyverno/chainsaw/pkg/expressions "
12
12
)
13
13
14
14
func Wait (ctx context.Context , client client.Client , tc binding.Bindings , collector * v1alpha1.Wait ) (string , []string , error ) {
15
15
if collector == nil {
16
16
return "" , nil , errors .New ("collector is null" )
17
17
}
18
- name , err := templating .String (ctx , collector .Name , tc )
18
+ name , err := expressions .String (ctx , collector .Name , tc )
19
19
if err != nil {
20
20
return "" , nil , err
21
21
}
22
- namespace , err := templating .String (ctx , collector .Namespace , tc )
22
+ namespace , err := expressions .String (ctx , collector .Namespace , tc )
23
23
if err != nil {
24
24
return "" , nil , err
25
25
}
26
- selector , err := templating .String (ctx , collector .Selector , tc )
26
+ selector , err := expressions .String (ctx , collector .Selector , tc )
27
27
if err != nil {
28
28
return "" , nil , err
29
29
}
30
- format , err := templating .String (ctx , string (collector .Format ), tc )
30
+ format , err := expressions .String (ctx , string (collector .Format ), tc )
31
31
if err != nil {
32
32
return "" , nil , err
33
33
}
@@ -42,15 +42,15 @@ func Wait(ctx context.Context, client client.Client, tc binding.Bindings, collec
42
42
if collector .WaitFor .Deletion != nil {
43
43
args = append (args , "--for=delete" )
44
44
} else if collector .WaitFor .Condition != nil {
45
- name , err := templating .String (ctx , collector .WaitFor .Condition .Name , tc )
45
+ name , err := expressions .String (ctx , collector .WaitFor .Condition .Name , tc )
46
46
if err != nil {
47
47
return "" , nil , err
48
48
}
49
49
if name == "" {
50
50
return "" , nil , errors .New ("a condition name must be specified for condition wait type" )
51
51
}
52
52
if collector .WaitFor .Condition .Value != nil {
53
- value , err := templating .String (ctx , * collector .WaitFor .Condition .Value , tc )
53
+ value , err := expressions .String (ctx , * collector .WaitFor .Condition .Value , tc )
54
54
if err != nil {
55
55
return "" , nil , err
56
56
}
@@ -59,14 +59,14 @@ func Wait(ctx context.Context, client client.Client, tc binding.Bindings, collec
59
59
args = append (args , fmt .Sprintf ("--for=condition=%s" , name ))
60
60
}
61
61
} else if collector .WaitFor .JsonPath != nil {
62
- path , err := templating .String (ctx , collector .WaitFor .JsonPath .Path , tc )
62
+ path , err := expressions .String (ctx , collector .WaitFor .JsonPath .Path , tc )
63
63
if err != nil {
64
64
return "" , nil , err
65
65
}
66
66
if path == "" {
67
67
return "" , nil , errors .New ("a path must be specified for jsonpath wait type" )
68
68
}
69
- value , err := templating .String (ctx , collector .WaitFor .JsonPath .Value , tc )
69
+ value , err := expressions .String (ctx , collector .WaitFor .JsonPath .Value , tc )
70
70
if err != nil {
71
71
return "" , nil , err
72
72
}
0 commit comments