Skip to content

Commit

Permalink
Merge pull request #20 from mgugino-upstream-stage/update-status-dns
Browse files Browse the repository at this point in the history
Update instance internal-dns names
  • Loading branch information
openshift-merge-robot committed May 20, 2019
2 parents 7fd17e9 + 8bfc0cd commit d2ff502
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/cloud/gcp/actuators/machine/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ func (r *Reconciler) reconcileMachineWithCloudState(failedCondition *v1beta1.GCP
for _, config := range networkInterface.AccessConfigs {
nodeAddresses = append(nodeAddresses, v1.NodeAddress{Type: v1.NodeExternalIP, Address: config.NatIP})
}
// Since we don't know when the project was created, we must account for
// both types of internal-dns:
// https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names
// [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal (newer)
nodeAddresses = append(nodeAddresses, corev1.NodeAddress{
Type: corev1.NodeInternalDNS,
Address: fmt.Sprintf("%s.%s.c.%s.internal", r.machine.Name, r.providerSpec.Zone, r.projectID),
})
// [INSTANCE_NAME].c.[PROJECT_ID].internal
nodeAddresses = append(nodeAddresses, corev1.NodeAddress{
Type: "AltInternalDNS",
Address: fmt.Sprintf("%s.c.%s.internal", r.machine.Name, r.projectID),
})

r.machine.Spec.ProviderID = &r.providerID
r.machine.Status.Addresses = nodeAddresses
Expand Down

0 comments on commit d2ff502

Please sign in to comment.