File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
2121 "encoding/base64"
2222 "fmt"
2323 "strconv"
24+ "strings"
2425
2526 "k8s.io/utils/pointer"
2627
@@ -372,14 +373,16 @@ func (m *PowerVSMachineScope) SetAddresses(instance *models.PVMInstance) {
372373 Address : * instance .ServerName ,
373374 })
374375 for _ , network := range instance .Networks {
375- addresses = append (addresses , corev1.NodeAddress {
376- Type : corev1 .NodeInternalIP ,
377- Address : network .IPAddress ,
378- })
379- if network .ExternalIP != "" {
376+ if strings .TrimSpace (network .IPAddress ) != "" {
377+ addresses = append (addresses , corev1.NodeAddress {
378+ Type : corev1 .NodeInternalIP ,
379+ Address : strings .TrimSpace (network .IPAddress ),
380+ })
381+ }
382+ if strings .TrimSpace (network .ExternalIP ) != "" {
380383 addresses = append (addresses , corev1.NodeAddress {
381384 Type : corev1 .NodeExternalIP ,
382- Address : network .ExternalIP ,
385+ Address : strings . TrimSpace ( network .ExternalIP ) ,
383386 })
384387 }
385388 }
You can’t perform that action at this time.
0 commit comments