mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
Merge pull request #60104 from nikhiljindal/kubemcie2e
Automatic merge from submit-queue (batch tested with PRs 59934, 60098, 60103, 60104, 60109). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Returning an empty array instead of returning an array with empty string for kubemci get status This is required since the caller checks if `len(returnedArray) == 0` which fails for `[]string{""}` cc @madhusudancs @G-Harmon /assign @madhusudancs ```release-note NONE ```
This commit is contained in:
commit
c922807c36
@ -1252,12 +1252,16 @@ func (j *IngressTestJig) runDelete(ing *extensions.Ingress, class string) error
|
|||||||
// getIngressAddressFromKubemci returns the IP address of the given multicluster ingress using kubemci.
|
// getIngressAddressFromKubemci returns the IP address of the given multicluster ingress using kubemci.
|
||||||
// TODO(nikhiljindal): Update this to be able to return hostname as well.
|
// TODO(nikhiljindal): Update this to be able to return hostname as well.
|
||||||
func getIngressAddressFromKubemci(name string) ([]string, error) {
|
func getIngressAddressFromKubemci(name string) ([]string, error) {
|
||||||
|
var addresses []string
|
||||||
out, err := runKubemciCmd("get-status", name)
|
out, err := runKubemciCmd("get-status", name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []string{}, err
|
return addresses, err
|
||||||
}
|
}
|
||||||
ip := findIPv4(out)
|
ip := findIPv4(out)
|
||||||
return []string{ip}, err
|
if ip != "" {
|
||||||
|
addresses = append(addresses, ip)
|
||||||
|
}
|
||||||
|
return addresses, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// findIPv4 returns the first IPv4 address found in the given string.
|
// findIPv4 returns the first IPv4 address found in the given string.
|
||||||
@ -1278,7 +1282,7 @@ func getIngressAddress(client clientset.Interface, ns, name, class string) ([]st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
addresses := []string{}
|
var addresses []string
|
||||||
for _, a := range ing.Status.LoadBalancer.Ingress {
|
for _, a := range ing.Status.LoadBalancer.Ingress {
|
||||||
if a.IP != "" {
|
if a.IP != "" {
|
||||||
addresses = append(addresses, a.IP)
|
addresses = append(addresses, a.IP)
|
||||||
|
Loading…
Reference in New Issue
Block a user