mirror of https://github.com/kubernetes/kops.git
Merge pull request #14500 from johngmyers/dump-ipv6
Also dump logs from IPv6 nodes
This commit is contained in:
commit
5f72a878e1
|
|
@ -109,13 +109,19 @@ func (d *logDumper) DumpAllNodes(ctx context.Context, nodes corev1.NodeList, add
|
||||||
node := &nodes.Items[i]
|
node := &nodes.Items[i]
|
||||||
|
|
||||||
ip := ""
|
ip := ""
|
||||||
|
ipv6 := ""
|
||||||
for _, address := range node.Status.Addresses {
|
for _, address := range node.Status.Addresses {
|
||||||
if address.Type == "ExternalIP" {
|
if address.Type == "ExternalIP" {
|
||||||
ip = address.Address
|
ip = address.Address
|
||||||
break
|
break
|
||||||
|
} else if address.Type == "InternalIP" && strings.Contains(address.Address, ":") {
|
||||||
|
ipv6 = address.Address
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ip == "" {
|
||||||
|
ip = ipv6
|
||||||
|
}
|
||||||
err := d.dumpNode(ctx, node.Name, ip)
|
err := d.dumpNode(ctx, node.Name, ip)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("could not dump node %s (%s): %v", node.Name, ip, err)
|
log.Printf("could not dump node %s (%s): %v", node.Name, ip, err)
|
||||||
|
|
@ -420,7 +426,7 @@ var _ sshClientFactory = &sshClientFactoryImplementation{}
|
||||||
|
|
||||||
// Dial implements sshClientFactory::Dial
|
// Dial implements sshClientFactory::Dial
|
||||||
func (f *sshClientFactoryImplementation) Dial(ctx context.Context, host string) (sshClient, error) {
|
func (f *sshClientFactoryImplementation) Dial(ctx context.Context, host string) (sshClient, error) {
|
||||||
addr := host + ":22"
|
addr := net.JoinHostPort(host, "22")
|
||||||
d := net.Dialer{
|
d := net.Dialer{
|
||||||
Timeout: 15 * time.Second,
|
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 {
|
for _, tag := range ec2Instance.Tags {
|
||||||
key := aws.StringValue(tag.Key)
|
key := aws.StringValue(tag.Key)
|
||||||
if !strings.HasPrefix(key, awsup.TagNameRolePrefix) {
|
if !strings.HasPrefix(key, awsup.TagNameRolePrefix) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue