mirror of https://github.com/kubernetes/kops.git
Also dump logs from IPv6 nodes
This commit is contained in:
parent
0efc42822b
commit
8675336725
|
|
@ -109,13 +109,19 @@ func (d *logDumper) DumpAllNodes(ctx context.Context, nodes corev1.NodeList, add
|
|||
node := &nodes.Items[i]
|
||||
|
||||
ip := ""
|
||||
ipv6 := ""
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == "ExternalIP" {
|
||||
ip = address.Address
|
||||
break
|
||||
} else if address.Type == "InternalIP" && strings.Contains(address.Address, ":") {
|
||||
ipv6 = address.Address
|
||||
}
|
||||
}
|
||||
|
||||
if ip == "" {
|
||||
ip = ipv6
|
||||
}
|
||||
err := d.dumpNode(ctx, node.Name, ip)
|
||||
if err != nil {
|
||||
log.Printf("could not dump node %s (%s): %v", node.Name, ip, err)
|
||||
|
|
@ -420,7 +426,7 @@ var _ sshClientFactory = &sshClientFactoryImplementation{}
|
|||
|
||||
// Dial implements sshClientFactory::Dial
|
||||
func (f *sshClientFactoryImplementation) Dial(ctx context.Context, host string) (sshClient, error) {
|
||||
addr := host + ":22"
|
||||
addr := net.JoinHostPort(host, "22")
|
||||
d := net.Dialer{
|
||||
Timeout: 15 * time.Second,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -534,6 +534,9 @@ func DumpInstance(op *resources.DumpOperation, r *resources.Resource) error {
|
|||
}
|
||||
}
|
||||
}
|
||||
if len(i.PublicAddresses) == 0 && ec2Instance.Ipv6Address != nil {
|
||||
i.PublicAddresses = append(i.PublicAddresses, *ec2Instance.Ipv6Address)
|
||||
}
|
||||
for _, tag := range ec2Instance.Tags {
|
||||
key := aws.StringValue(tag.Key)
|
||||
if !strings.HasPrefix(key, awsup.TagNameRolePrefix) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue