mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 07:03:31 +00:00
Debugging to fix e2e testing issue
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
set -x
|
||||
set -e
|
||||
|
||||
source "${KUBE_REPO_ROOT}/cluster/kube-env.sh"
|
||||
source "${KUBE_REPO_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh"
|
||||
|
@@ -30,6 +30,7 @@ import (
|
||||
"code.google.com/p/goauth2/compute/serviceaccount"
|
||||
compute "code.google.com/p/google-api-go-client/compute/v1"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
// GCECloud is an implementation of Interface, TCPLoadBalancer and Instances for Google Compute Engine.
|
||||
@@ -191,10 +192,18 @@ func (gce *GCECloud) DeleteTCPLoadBalancer(name, region string) error {
|
||||
|
||||
// IPAddress is an implementation of Instances.IPAddress.
|
||||
func (gce *GCECloud) IPAddress(instance string) (net.IP, error) {
|
||||
res, err := gce.service.Instances.Get(gce.projectID, gce.zone, instance).Do()
|
||||
suffix, err := fqdnSuffix()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(suffix) > 0 {
|
||||
suffix = "." + suffix
|
||||
}
|
||||
res, err := gce.service.Instances.Get(gce.projectID, gce.zone, strings.Replace(instance, suffix, "", 1)).Do()
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to retrieve TargetInstance resource for instance:%s", instance)
|
||||
return nil, err
|
||||
}
|
||||
ip := net.ParseIP(res.NetworkInterfaces[0].AccessConfigs[0].NatIP)
|
||||
if ip == nil {
|
||||
return nil, fmt.Errorf("Invalid network IP: %s", res.NetworkInterfaces[0].AccessConfigs[0].NatIP)
|
||||
|
Reference in New Issue
Block a user