-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathingress_test.go
More file actions
43 lines (39 loc) · 836 Bytes
/
ingress_test.go
File metadata and controls
43 lines (39 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package ok8s
import (
"k8s.io/api/networking/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"testing"
)
var (
ingress = v1beta1.Ingress{
ObjectMeta: v1.ObjectMeta{
Name: "web",
},
Spec: v1beta1.IngressSpec{
Rules: []v1beta1.IngressRule{
{
Host: "www.chulinx.com",
IngressRuleValue: v1beta1.IngressRuleValue{
HTTP: &v1beta1.HTTPIngressRuleValue{
Paths: []v1beta1.HTTPIngressPath{
{
Path: "/",
Backend: v1beta1.IngressBackend{
ServiceName: "web",
ServicePort: intstr.IntOrString{IntVal: 80},
},
},
},
},
},
},
},
},
}
i = NewIngress(NewTestClientSet())
)
func TestIngress_Create(t *testing.T) {
ok, err := i.Create(ns, ingress)
AssertError(ok, err, t)
}