diff --git a/pkg/k8s/kubernetes.go b/pkg/k8s/kubernetes.go index 4dfb95b0..f84edff7 100644 --- a/pkg/k8s/kubernetes.go +++ b/pkg/k8s/kubernetes.go @@ -316,7 +316,10 @@ func BuildSUT(client *kubernetes.Clientset, s *config.PerfScenarios) error { return err } s.VMHost = host - WaitForVMI(s.KClient, clientAcrossRole) + err = WaitForVMI(s.KClient, clientAcrossRole) + if err != nil { + return err + } s.ClientAcross, err = GetNakedPods(s.ClientSet, fmt.Sprintf("app=%s", clientAcrossRole)) if err != nil { return err @@ -335,7 +338,10 @@ func BuildSUT(client *kubernetes.Clientset, s *config.PerfScenarios) error { return err } s.VMHost = host - WaitForVMI(s.KClient, clientAcrossRole) + err = WaitForVMI(s.KClient, clientAcrossRole) + if err != nil { + return err + } s.ClientAcross, err = GetNakedPods(s.ClientSet, fmt.Sprintf("app=%s", clientAcrossRole)) if err != nil { return err @@ -435,7 +441,10 @@ func BuildSUT(client *kubernetes.Clientset, s *config.PerfScenarios) error { if err != nil { return err } - WaitForVMI(s.KClient, serverRole) + err = WaitForVMI(s.KClient, serverRole) + if err != nil { + return err + } s.ServerHost, err = GetNakedPods(s.ClientSet, fmt.Sprintf("app=%s", serverRole)) if err != nil { return err @@ -461,7 +470,10 @@ func BuildSUT(client *kubernetes.Clientset, s *config.PerfScenarios) error { if err != nil { return err } - WaitForVMI(s.KClient, serverRole) + err = WaitForVMI(s.KClient, serverRole) + if err != nil { + return err + } s.Server, err = GetNakedPods(s.ClientSet, fmt.Sprintf("app=%s", serverRole)) if err != nil { return err diff --git a/pkg/k8s/kubevirt.go b/pkg/k8s/kubevirt.go index f2df1095..163c3457 100644 --- a/pkg/k8s/kubevirt.go +++ b/pkg/k8s/kubevirt.go @@ -52,6 +52,9 @@ func SSHConnect(conf *config.PerfScenarios) (*goph.Client, error) { } key := fmt.Sprintf("%s/.ssh/id_rsa", dir) keyd, err := os.ReadFile(key) + if err != nil { + return nil, fmt.Errorf("Unable to read key. Error : %s", err) + } auth, err := goph.RawKey(string(keyd), "") if err != nil { return nil, fmt.Errorf("Unable to retrieve sshkey. Error : %s", err) @@ -87,7 +90,7 @@ func createCommService(client *kubernetes.Clientset, label map[string]string, na Spec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{ { - Name: fmt.Sprintf("%s", name), + Name: name, Protocol: corev1.ProtocolTCP, NodePort: int32(sshPort), TargetPort: intstr.Parse(fmt.Sprintf("%d", 22)),