@@ -187,11 +187,6 @@ func DecorateErrorWithDocsLink(err error, link ...string) error {
187187 return fmt .Errorf ("%s\n for more information: %s" , err .Error (), link [0 ])
188188}
189189
190- func ParseHostNameFromIngressHost (ingressHost string ) string {
191- split := strings .Split (ingressHost , "//" )
192- return split [1 ]
193- }
194-
195190func reportCancel (status reporter.CliStepStatus ) {
196191 reporter .G ().ReportStep (reporter.CliStepData {
197192 Step : reporter .SIGNAL_TERMINATION ,
@@ -201,6 +196,10 @@ func reportCancel(status reporter.CliStepStatus) {
201196 })
202197}
203198
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+
204203func RunNetworkTest (ctx context.Context , kubeFactory kube.Factory , urls ... string ) error {
205204 const networkTestsTimeout = 120 * time .Second
206205 var testerPodName string
@@ -232,14 +231,14 @@ func RunNetworkTest(ctx context.Context, kubeFactory kube.Factory, urls ...strin
232231 defer func () {
233232 deferErr := client .BatchV1 ().Jobs (store .Get ().DefaultNamespace ).Delete (ctx , store .Get ().NetworkTesterName , metav1.DeleteOptions {})
234233 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 ())
236235 }
237236 }()
238237
239238 defer func (name * string ) {
240239 deferErr := client .CoreV1 ().Pods (store .Get ().DefaultNamespace ).Delete (ctx , * name , metav1.DeleteOptions {})
241240 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 ())
243242 }
244243 }(& testerPodName )
245244
0 commit comments