~philroche/cloud-init/trunk

Viewing all changes in revision 1236.

  • Committer: Phil Roche
  • Date: 2016-06-15 09:25:03 UTC
  • Revision ID: phil.roche@canonical.com-20160615092503-f3pzohbr378tdhi0
Removes trailing dot in metadata.google.internal GCE metadata lookup.

A bug was reported (lp:1581200) where if there is no DNS server configured
or it is not running then the metadata lookup on GCE will fail as it contains a
trailing dot 'metadata.google.internal.'. As there is no DNS configured or
running it will use the /etc/hosts file but the hosts file does not contain
an entry with the trailing dot.

One solution is to add an entry to the /etc/hosts file with the trailing dot
but according to the manpage, /etc/hosts entries must end with an alphanumeric
character and cannot end with a dot.

The trailing dot was added to avoid MIM by dns search but we should probably
assume the instance being started has no DNS and as such when querying
metadata should use a URL that will resolve using /etc/hosts.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: