-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenStack single-stack IPv6 support #1909
base: main
Are you sure you want to change the base?
Conversation
9e7cba8
to
87e4a48
Compare
Not sure that will work. What happens if the instance is IPv6 only? Do requests fail differently than if the network is not up yet? |
One of the principle behind Ignition is that it will retry indefinitely until the server explicitly returns an error. |
87e4a48
to
5fad1fd
Compare
I updated my code logic. In an IPv6-only instance, IPv4 will fail because it's not found and the resources will be returned from IPv6. If both fails it will return errors. The error will be handled with a message in dispatch function above. It makes sense? One thing I need to consider is the possibility of having both IPv4 and IPv6 simultaneously. Is that possible? If yes, I need to handle this case as well. |
Nice. I guess this is being handled in
Thanks! |
Yes, this is very common. |
5fad1fd
to
91f89b5
Compare
I updated the code to cover this scenarios. So, now the code looks like this:
These should be the basic scenarios. Now, I'm working on running my code in the OpenStack environment and reading the necessary docs to test it correctly. Thanks for reviewing and helping me with this task! |
91f89b5
to
a850f29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something to take into consideration:
Scheme: "http", | ||
Host: "169.254.169.254", | ||
Path: "openstack/latest/user_data", | ||
} | ||
ipv6MetadataServiceUrl = url.URL{ | ||
Scheme: "http", | ||
Host: "[fe80::a9fe:a9fe]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we might need to specify the interface name like it's mentioned on the docs
https://docs.openstack.org/nova/latest/user/metadata.html#the-metadata-service
and how it's done elsewhere
https://github.com/canonical/cloud-init/blob/main/cloudinit/sources/DataSourceOpenStack.py#L76
a850f29
to
d81e5fb
Compare
d81e5fb
to
6b8a11e
Compare
} | ||
ipv6MetadataServiceUrl = url.URL{ | ||
Scheme: "http", | ||
Host: fmt.Sprintf("[fe80::a9fe:a9fe%%%s]", url.PathEscape(iface)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need to change to [fe80::a9fe:a9fe%25%s]
refer to https://docs.openstack.org/nova/latest/user/metadata.html#the-metadata-service
f2979b8
to
fa50682
Compare
fa50682
to
ee0d2af
Compare
In #1897 issue, we are requested to create support for IPv6 so Ignition can fetch the metadata in single-stack environments.
To achieve this, we added a new URL with the IPv6 endpoint. We also created logic to first attempt the IPv4 endpoint so If this fails, it will try the IPv6 one. If both endpoints fail, it will return the appropriate error.