-
Notifications
You must be signed in to change notification settings - Fork 9
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
Configure DNS and NTP in machine allocation #571
Conversation
We should discuss if we also put these two options into the Other option is to put dns and ntp configuration into the CloudProfile and adopt machine creation in gepm. |
It should be a feature of |
On the other hand, properties like For me it is a bit opinionated if we inherit from the partition. |
How do you plan to provide the NTP configuration for |
This is actually done in the pixie-core deployment, but would also be easier if partition contains these configuration. |
It seems a bit inconsistent to me that we have to configure the kernel and image URL for |
Regarding the defaulting through the partition entity: I am actually open to offer this defaulting layer when for certain environments this makes everything easier to configure. It seems there can be partitions that do not reach the internet at all and no machine can be provisioned without passing custom DNS and NTP servers. For these scenarios it's really cumbersome to always pass these settings all the time. As long as it's optional to provide, it does not hurt to add this. |
@simcod please add matching fields to the Partition entity (v1 and database) and check in the service if they are set and use the partition config for defaults. |
dnsServers metal.DNSServers | ||
ntpServers metal.NTPServers |
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.
This would render the else
branches unnecessary:
dnsServers metal.DNSServers | |
ntpServers metal.NTPServers | |
dnsServers = partition.DNSServers | |
ntpServers = partition.NTPServers |
var dnsServers metal.DNSServers | ||
if len(requestPayload.DNSServers) > 0 { | ||
dnsServers = requestPayload.DNSServers | ||
} | ||
|
||
var ntpServers metal.NTPServers | ||
if len(requestPayload.NTPServers) > 0 { | ||
ntpServers = requestPayload.NTPServers | ||
} |
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.
Same validations as in the machine spec should be implemented here. Otherwise machines might default to invalid partition defaults.
Maybe you can factor out the validation into a dedicated func?
if len(requestPayload.DNSServers) > 0 { | ||
dnsServers = requestPayload.DNSServers | ||
reqDNSServers := requestPayload.DNSServers | ||
if len(reqDNSServers) > 0 { |
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 think this check can be omited, because the validate func iterates over the dnsservers otherwise returns nil
if len(requestPayload.NTPServers) > 0 { | ||
ntpServers = requestPayload.NTPServers | ||
reqNtpServers := requestPayload.NTPServers | ||
if len(ntpServers) > 0 { |
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.
same here
This PR is related to MEP-14.
Related PRs: