Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

datasource/gce: add initial support #426

Merged
merged 4 commits into from
May 18, 2016
Merged

datasource/gce: add initial support #426

merged 4 commits into from
May 18, 2016

Conversation

crawford
Copy link
Contributor

No description provided.

@crawford
Copy link
Contributor Author

$ sudo ./coreos-cloudinit -oem=gce
2016/05/18 20:13:48 Checking availability of "gce-metadata-service"
2016/05/18 20:13:48 Fetching user-data from datasource of type "gce-metadata-service"
2016/05/18 20:13:48 Fetching data from http://metadata.google.internal/computeMetadata/v1/instance/attributes/user-data. Attempt #1
2016/05/18 20:13:48 Fetching meta-data from datasource of type "gce-metadata-service"
2016/05/18 20:13:48 Fetching data from http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip. Attempt #1
2016/05/18 20:13:48 Fetching data from http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip. Attempt #1
2016/05/18 20:13:48 Fetching data from http://metadata.google.internal/computeMetadata/v1/instance/hostname. Attempt #1
2016/05/18 20:13:48 Merging cloud-config from meta-data and user-data
2016/05/18 20:13:48 Set hostname to crawford-ignition-test-1.c.coreos-gce-testing.internal
2016/05/18 20:13:48 Writing file to "/etc/environment"
2016/05/18 20:13:48 Wrote file to "/etc/environment"
2016/05/18 20:13:48 Updated /etc/environment
2016/05/18 20:13:48 Ensuring runtime unit file "etcd.service" is unmasked
2016/05/18 20:13:48 Ensuring runtime unit file "etcd2.service" is unmasked
2016/05/18 20:13:48 Ensuring runtime unit file "fleet.service" is unmasked
2016/05/18 20:13:48 Ensuring runtime unit file "locksmithd.service" is unmasked
$ cat /etc/environment 
COREOS_PRIVATE_IPV4=10.240.0.14
COREOS_PUBLIC_IPV4=104.196.121.100

}

func (ms metadataService) FetchMetadata() (datasource.Metadata, error) {
public, err := ms.fetchIP("network-interfaces/0/access-configs/0/external-ip")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the machine has no external IP?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hint: it shouldn't fail ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it doesn't!

@marineam
Copy link
Contributor

LGTM

@crawford crawford merged commit 4c333e6 into coreos:master May 18, 2016
@crawford crawford deleted the gce branch May 18, 2016 22:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants