Skip to content
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

fixes for pluto #4032

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/os/pluto.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[Unit]
Description=Generate additional settings for Kubernetes
# Treat pluto as an honorary settings generator. It should run after sundog runs other
# settings generators, and before settings-applier commits all the settings, renders
# config files, and restarts services.
After=network-online.target apiserver.service sundog.service
Before=settings-applier.service
Requires=sundog.service
# We don't want to restart the unit if the network goes offline or apiserver restarts
Wants=network-online.target apiserver.service
Expand All @@ -11,10 +15,16 @@ RefuseManualStop=true

[Service]
Type=oneshot
# pluto needs access to any Kubernetes settings supplied through user-data, along with
# network-related settings such as proxy servers. Commit any settings that might have
# been generated during the sundog phase.
ExecStartPre=/usr/bin/settings-committer
ExecStart=/usr/bin/pluto
RemainAfterExit=true
StandardError=journal+console

[Install]
RequiredBy=preconfigured.target
# settings-applier requires sundog to succeed as a signal that all settings generators ran
# successfully. Since pluto is an honorary settings generator, settings-applier also needs
# it to succeed before it can start.
RequiredBy=settings-applier.service
1 change: 1 addition & 0 deletions sources/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sources/api/pluto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ exclude = ["README.md"]

[dependencies]
bytes = "1"
constants = { path = "../../constants", version = "0.1" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is my dollar? 🤑

#2238 (comment)

futures-util = { version = "0.3", default-features = false }
headers = "0.3"
http = "0.2"
Expand Down
7 changes: 6 additions & 1 deletion sources/api/pluto/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,12 @@ async fn run() -> Result<()> {
"kubernetes": settings
});
let json_str = generated_settings.to_string();
api::client_command(&["set", "-j", json_str.as_str()])
let uri = &format!(
"{}?tx={}",
constants::API_SETTINGS_URI,
constants::LAUNCH_TRANSACTION
);
api::client_command(&["raw", "-m", "PATCH", "-u", uri, "-d", json_str.as_str()])
.await
.context(error::SetFailureSnafu)?;

Expand Down