-
Notifications
You must be signed in to change notification settings - Fork 523
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
settings: add ntp settings extension #3595
settings: add ntp settings extension #3595
Conversation
a53a45d
to
751b7d4
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.
Nice work! Just a few suggestions.
model-derive = { path = "../../models/model-derive", version = "0.1" } | ||
serde = { version = "1", features = ["derive"] } | ||
serde_json = "1" | ||
string_impls_for = { version = "0.1", path = "../../models/string_impls_for" } |
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.
Looks like we don't use this dependency, you can remove it.
edition = "2021" | ||
publish = false | ||
|
||
[dependencies] |
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.
The settings-sdk
emits logs to stderr
, and I realized after talking with @zmrow that I never initialized the logger in the motd
extension.
I would take a dependency on env_logger
and initialize the logger just before initializing the extension with env_logger::init()
.
// TODO: add additional validation -- legal for this to be set to any URL or do we need to | ||
// check that it is a valid time server? |
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.
We tend not to rely on external services when validating settings as long as they are the same shape, and I think that's the right move. It would be too easy for a transient error to cause unnecessary failure at scale.
751b7d4
to
3c28977
Compare
Signed-off-by: Sam Berning <[email protected]>
Signed-off-by: Sam Berning <[email protected]>
Signed-off-by: Sam Berning <[email protected]>
3c28977
to
02d4ce1
Compare
Description of changes:
Implements a settings extension for NTP settings using the
bottlerocket-settings-sdk
.Because it uses the SDK, this will create a settings binary which can be installed on a variant via the
settings-ntp
package. But for now, we are only using the settings model from the extension.Testing done:
aws-dev
on an ec2 instance and checked that the NTP settings were set correctly on boot and would update/etc/chrony.conf
when set to a new valueaws-dev
, and made sure the binary gave the expected responses.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.