File tree 4 files changed +60
-20
lines changed
4 files changed +60
-20
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ func TestHelmSimpleExpand(t *testing.T) {
68
68
err = json .Unmarshal ([]byte (code ), & output )
69
69
require .Nil (t , err )
70
70
71
- require .Equal (t , 2 , len (output ))
71
+ require .Equal (t , 3 , len (output ))
72
72
73
73
sort .Slice (output , func (i , j int ) bool {
74
74
return output [i ].Kind < output [j ].Kind
@@ -82,6 +82,9 @@ func TestHelmSimpleExpand(t *testing.T) {
82
82
a .Equal ("baz" , ob .Data ["bar" ])
83
83
84
84
ob = output [1 ]
85
+ a .Equal ("networking.k8s.io/v1" , ob .APIVersion )
86
+
87
+ ob = output [2 ]
85
88
a .Equal ("Secret" , ob .Kind )
86
89
a .Equal ("my-ns" , ob .Metadata .Namespace )
87
90
a .Equal ("my-name" , ob .Metadata .Name )
Original file line number Diff line number Diff line change 1
1
local expandHelmTemplate = std.native('expandHelmTemplate' );
2
2
3
3
expandHelmTemplate(
4
- './charts/foobar' ,
5
- {
6
- foo: 'barbar' ,
7
- },
8
- {
9
- namespace: 'my-ns' ,
10
- name : 'my-name' ,
11
- verbose: true ,
12
- }
4
+ './charts/foobar' ,
5
+ {
6
+ foo: 'barbar' ,
7
+ },
8
+ {
9
+ namespace: 'my-ns' ,
10
+ nameTemplate : 'my-name' ,
11
+ verbose: true ,
12
+ }
13
13
)
Original file line number Diff line number Diff line change
1
+ ---
2
+ {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
3
+ apiVersion : networking.k8s.io/v1
4
+ kind : Ingress
5
+ metadata :
6
+ name : name-virtual-host-ingress
7
+ spec :
8
+ ingressClassName : nginx
9
+ rules :
10
+ - host : foo.bar.com
11
+ http :
12
+ paths :
13
+ - path : /
14
+ pathType : Prefix
15
+ backend :
16
+ service :
17
+ name : service1
18
+ port :
19
+ number : 80
20
+ {{- else }}
21
+ apiVersion : networking.k8s.io/v1beta1
22
+ kind : Ingress
23
+ metadata :
24
+ name : name-virtual-host-ingress
25
+ spec :
26
+ rules :
27
+ - host : foo.bar.com
28
+ http :
29
+ paths :
30
+ - path : /
31
+ backend :
32
+ serviceName : service1
33
+ servicePort : 80
34
+ {{- end }}
Original file line number Diff line number Diff line change 1
1
local expandHelmTemplate = std.native('expandHelmTemplate' );
2
2
3
3
expandHelmTemplate(
4
- './charts/foobar' ,
5
- {
6
- foo: 'barbar' ,
7
- },
8
- {
9
- namespace: 'my-ns' ,
10
- nameTemplate: 'my-name' ,
11
- thisFile: std.thisFile ,
12
- verbose: true ,
13
- }
4
+ './charts/foobar' ,
5
+ {
6
+ foo: 'barbar' ,
7
+ },
8
+ {
9
+ namespace: 'my-ns' ,
10
+ nameTemplate: 'my-name' ,
11
+ thisFile: std.thisFile ,
12
+ verbose: true ,
13
+ apiVersions: [
14
+ 'networking.k8s.io/v1/Ingress' ,
15
+ ],
16
+ }
14
17
)
You can’t perform that action at this time.
0 commit comments