@@ -187,11 +187,6 @@ func DecorateErrorWithDocsLink(err error, link ...string) error {
187
187
return fmt .Errorf ("%s\n for more information: %s" , err .Error (), link [0 ])
188
188
}
189
189
190
- func ParseHostNameFromIngressHost (ingressHost string ) string {
191
- split := strings .Split (ingressHost , "//" )
192
- return split [1 ]
193
- }
194
-
195
190
func reportCancel (status reporter.CliStepStatus ) {
196
191
reporter .G ().ReportStep (reporter.CliStepData {
197
192
Step : reporter .SIGNAL_TERMINATION ,
@@ -201,6 +196,10 @@ func reportCancel(status reporter.CliStepStatus) {
201
196
})
202
197
}
203
198
199
+ func IsIP (s string ) (bool , error ) {
200
+ return regexp .MatchString (`^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$` , s )
201
+ }
202
+
204
203
func RunNetworkTest (ctx context.Context , kubeFactory kube.Factory , urls ... string ) error {
205
204
const networkTestsTimeout = 120 * time .Second
206
205
var testerPodName string
@@ -232,14 +231,14 @@ func RunNetworkTest(ctx context.Context, kubeFactory kube.Factory, urls ...strin
232
231
defer func () {
233
232
deferErr := client .BatchV1 ().Jobs (store .Get ().DefaultNamespace ).Delete (ctx , store .Get ().NetworkTesterName , metav1.DeleteOptions {})
234
233
if deferErr != nil {
235
- log .G (ctx ).Error ("fail to delete job resource '%s': %s" , store .Get ().NetworkTesterName , deferErr .Error ())
234
+ log .G (ctx ).Errorf ("fail to delete job resource '%s': %s" , store .Get ().NetworkTesterName , deferErr .Error ())
236
235
}
237
236
}()
238
237
239
238
defer func (name * string ) {
240
239
deferErr := client .CoreV1 ().Pods (store .Get ().DefaultNamespace ).Delete (ctx , * name , metav1.DeleteOptions {})
241
240
if deferErr != nil {
242
- log .G (ctx ).Error ("fail to delete tester pod '%s': %s" , testerPodName , deferErr .Error ())
241
+ log .G (ctx ).Errorf ("fail to delete tester pod '%s': %s" , testerPodName , deferErr .Error ())
243
242
}
244
243
}(& testerPodName )
245
244
0 commit comments