15
15
package podmaxconn
16
16
17
17
import (
18
- "github.com/haproxytech/kubernetes-ingress/pkg/k8s"
18
+ k8ssync "github.com/haproxytech/kubernetes-ingress/pkg/k8s/sync "
19
19
"github.com/haproxytech/kubernetes-ingress/pkg/store"
20
20
networkingv1 "k8s.io/api/networking/v1"
21
21
)
@@ -31,18 +31,18 @@ func (suite *PodMaxConnSuite) TestPodMaxConnConfigMap() {
31
31
cm .Annotations ["pod-maxconn" ] = "128"
32
32
svc := newAppSvc ()
33
33
ing := newAppIngress ()
34
- events := []k8s .SyncDataEvent {
35
- {SyncType : k8s .CONFIGMAP , Namespace : configMapNamespace , Name : configMapName , Data : cm },
36
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
34
+ events := []k8ssync .SyncDataEvent {
35
+ {SyncType : k8ssync .CONFIGMAP , Namespace : configMapNamespace , Name : configMapName , Data : cm },
36
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
37
37
Status : store .ADDED ,
38
38
Name : "ic1" ,
39
39
}},
40
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
40
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
41
41
Status : store .ADDED ,
42
42
Name : "ic2" ,
43
43
}},
44
- {SyncType : k8s .SERVICE , Namespace : appNs , Name : serviceName , Data : svc },
45
- {SyncType : k8s .INGRESS , Namespace : appNs , Name : ingressName , Data : ing },
44
+ {SyncType : k8ssync .SERVICE , Namespace : appNs , Name : serviceName , Data : svc },
45
+ {SyncType : k8ssync .INGRESS , Namespace : appNs , Name : ingressName , Data : ing },
46
46
}
47
47
suite .fixture (events ... )
48
48
// Expected occurrences of "default-server check maxconn 64"
@@ -65,18 +65,18 @@ func (suite *PodMaxConnSuite) TestPodMaxConnConfigMapMisc() {
65
65
cm .Annotations ["pod-maxconn" ] = "128"
66
66
svc := newAppSvc ()
67
67
ing := newAppIngress ()
68
- events := []k8s .SyncDataEvent {
69
- {SyncType : k8s .CONFIGMAP , Namespace : configMapNamespace , Name : configMapName , Data : cm },
70
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
68
+ events := []k8ssync .SyncDataEvent {
69
+ {SyncType : k8ssync .CONFIGMAP , Namespace : configMapNamespace , Name : configMapName , Data : cm },
70
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
71
71
Status : store .ADDED ,
72
72
Name : "ic1" ,
73
73
}},
74
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
74
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
75
75
Status : store .ADDED ,
76
76
Name : "ic2" ,
77
77
}},
78
- {SyncType : k8s .SERVICE , Namespace : appNs , Name : serviceName , Data : svc },
79
- {SyncType : k8s .INGRESS , Namespace : appNs , Name : ingressName , Data : ing },
78
+ {SyncType : k8ssync .SERVICE , Namespace : appNs , Name : serviceName , Data : svc },
79
+ {SyncType : k8ssync .INGRESS , Namespace : appNs , Name : ingressName , Data : ing },
80
80
}
81
81
suite .fixture (events ... )
82
82
// Expected occurrences of "default-server check maxconn 64"
@@ -87,12 +87,12 @@ func (suite *PodMaxConnSuite) TestPodMaxConnConfigMapMisc() {
87
87
88
88
// -------------------------------------
89
89
// Resend ADDED => should change nothing
90
- events = []k8s .SyncDataEvent {
91
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
90
+ events = []k8ssync .SyncDataEvent {
91
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
92
92
Status : store .ADDED ,
93
93
Name : "ic1" ,
94
94
}},
95
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
95
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
96
96
Status : store .ADDED ,
97
97
Name : "ic2" ,
98
98
}},
@@ -106,12 +106,12 @@ func (suite *PodMaxConnSuite) TestPodMaxConnConfigMapMisc() {
106
106
107
107
// -------------------------------------
108
108
// SEND MODIFIED => should change nothing
109
- events = []k8s .SyncDataEvent {
110
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
109
+ events = []k8ssync .SyncDataEvent {
110
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
111
111
Status : store .MODIFIED ,
112
112
Name : "ic1" ,
113
113
}},
114
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
114
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
115
115
Status : store .MODIFIED ,
116
116
Name : "ic2" ,
117
117
}},
@@ -125,12 +125,12 @@ func (suite *PodMaxConnSuite) TestPodMaxConnConfigMapMisc() {
125
125
126
126
// --------------------------------------------------
127
127
// Send MODIFIED on a non-existing POD -> should increment
128
- events = []k8s .SyncDataEvent {
129
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic3" , Data : store.PodEvent {
128
+ events = []k8ssync .SyncDataEvent {
129
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic3" , Data : store.PodEvent {
130
130
Status : store .MODIFIED ,
131
131
Name : "ic3" ,
132
132
}},
133
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic4" , Data : store.PodEvent {
133
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic4" , Data : store.PodEvent {
134
134
Status : store .MODIFIED ,
135
135
Name : "ic4" ,
136
136
}},
@@ -161,18 +161,18 @@ func (suite *PodMaxConnSuite) TestPodMaxConnService() {
161
161
svc := newAppSvc ()
162
162
svc .Annotations ["pod-maxconn" ] = "124"
163
163
164
- events := []k8s .SyncDataEvent {
165
- {SyncType : k8s .CONFIGMAP , Namespace : configMapNamespace , Name : configMapName , Data : cm },
166
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
164
+ events := []k8ssync .SyncDataEvent {
165
+ {SyncType : k8ssync .CONFIGMAP , Namespace : configMapNamespace , Name : configMapName , Data : cm },
166
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
167
167
Status : store .ADDED ,
168
168
Name : "ic1" ,
169
169
}},
170
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
170
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
171
171
Status : store .ADDED ,
172
172
Name : "ic2" ,
173
173
}},
174
- {SyncType : k8s .SERVICE , Namespace : appNs , Name : serviceName , Data : svc },
175
- {SyncType : k8s .INGRESS , Namespace : appNs , Name : ingressName , Data : ing },
174
+ {SyncType : k8ssync .SERVICE , Namespace : appNs , Name : serviceName , Data : svc },
175
+ {SyncType : k8ssync .INGRESS , Namespace : appNs , Name : ingressName , Data : ing },
176
176
}
177
177
suite .fixture (events ... )
178
178
// -- Expected occurrences of "default-server check maxconn 64" #1 (from configmap)
@@ -200,18 +200,18 @@ func (suite *PodMaxConnSuite) TestPodMaxConnIngress() {
200
200
ing .Annotations ["pod-maxconn" ] = "126"
201
201
svc := newAppSvc ()
202
202
203
- events := []k8s .SyncDataEvent {
204
- {SyncType : k8s .CONFIGMAP , Namespace : configMapNamespace , Name : configMapName , Data : cm },
205
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
203
+ events := []k8ssync .SyncDataEvent {
204
+ {SyncType : k8ssync .CONFIGMAP , Namespace : configMapNamespace , Name : configMapName , Data : cm },
205
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic1" , Data : store.PodEvent {
206
206
Status : store .ADDED ,
207
207
Name : "ic1" ,
208
208
}},
209
- {SyncType : k8s .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
209
+ {SyncType : k8ssync .POD , Namespace : configMapName , Name : "ic2" , Data : store.PodEvent {
210
210
Status : store .ADDED ,
211
211
Name : "ic2" ,
212
212
}},
213
- {SyncType : k8s .SERVICE , Namespace : appNs , Name : serviceName , Data : svc },
214
- {SyncType : k8s .INGRESS , Namespace : appNs , Name : ingressName , Data : ing },
213
+ {SyncType : k8ssync .SERVICE , Namespace : appNs , Name : serviceName , Data : svc },
214
+ {SyncType : k8ssync .INGRESS , Namespace : appNs , Name : ingressName , Data : ing },
215
215
}
216
216
suite .fixture (events ... )
217
217
// -- Expected occurrences of "default-server check maxconn 64" #1 (from configmap)
0 commit comments