Skip to content
Open
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
1 change: 0 additions & 1 deletion clients/wicketd-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ progenitor::generate_api!(
ProgressEventForInstallinatorSpec = installinator_common::ProgressEvent,
ProgressEventForUplinkPreflightSpec = wicket_common::preflight_check::ProgressEvent,
ProgressEventForWicketdEngineSpec = wicket_common::update_events::ProgressEvent,
PutRssUserConfigInsensitive = wicketd_commission_types_versions::latest::rack_setup::PutRssUserConfigInsensitive,
RackV1Inventory = wicket_common::inventory::RackV1Inventory,
RotInventory = wicket_common::inventory::RotInventory,
RotSlot = wicket_common::inventory::RotSlot,
Expand Down
119 changes: 0 additions & 119 deletions openapi/wicketd.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,32 +345,6 @@
}
}
},
"put": {
"summary": "Update (a subset of) the current RSS configuration.",
"description": "Sensitive values (certificates and password hash) are not set through this endpoint.",
"operationId": "put_rss_config",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PutRssUserConfigInsensitive"
}
}
},
"required": true
},
"responses": {
"204": {
"description": "resource updated"
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
},
"delete": {
"summary": "Reset all RSS configuration to their default values.",
"operationId": "delete_rss_config",
Expand Down Expand Up @@ -3441,99 +3415,6 @@
"hash"
]
},
"PutRssUserConfigInsensitive": {
"description": "The portion of the RSS configuration that can be posted in one shot.\n\nIt is provided by the operator uploading a TOML file. Sensitive values (certificates, the recovery password hash, and BGP authentication keys) are set separately.\n\nThis version replaces the flat `internal_services_ip_pool_ranges` of the initial version with fully-specified [`service_ip_pools`], letting operators name and describe each pool.\n\n[`service_ip_pools`]: Self::service_ip_pools",
"type": "object",
"properties": {
"allowed_source_ips": {
"description": "IPs or subnets allowed to make requests to user-facing services.",
"allOf": [
{
"$ref": "#/components/schemas/AllowedSourceIps"
}
]
},
"bootstrap_sleds": {
"description": "The slot numbers of the sleds to bring up during RSS.\n\nwicketd maps these back to sleds with the correct identifiers based on the bootstrap sleds it reports.",
"type": "array",
"items": {
"type": "integer",
"format": "uint16",
"minimum": 0
},
"uniqueItems": true
},
"dns_servers": {
"description": "The external DNS server addresses.",
"type": "array",
"items": {
"type": "string",
"format": "ip"
}
},
"external_dns_ips": {
"description": "Service IP addresses on which external DNS servers are run.",
"type": "array",
"items": {
"type": "string",
"format": "ip"
}
},
"external_dns_zone_name": {
"description": "The DNS zone name delegated to the rack for external DNS.",
"type": "string"
},
"external_jumbo_frames_opt_in_enabled": {
"description": "Enable the fleet-wide jumbo-frames opt-in.",
"default": false,
"type": "boolean"
},
"ntp_servers": {
"description": "The external NTP server addresses.",
"type": "array",
"items": {
"type": "string"
}
},
"rack_network_config": {
"description": "The user-specified rack network configuration.",
"allOf": [
{
"$ref": "#/components/schemas/UserSpecifiedRackNetworkConfig"
}
]
},
"service_ip_pools": {
"title": "IdOrdMap",
"description": "The service IP pools which may be used for internal services.",
"x-rust-type": {
"crate": "iddqd",
"parameters": [
{
"$ref": "#/components/schemas/ServiceIpPoolConfig"
}
],
"path": "iddqd::IdOrdMap",
"version": "*"
},
"type": "array",
"items": {
"$ref": "#/components/schemas/ServiceIpPoolConfig"
},
"uniqueItems": true
}
},
"required": [
"allowed_source_ips",
"bootstrap_sleds",
"dns_servers",
"external_dns_ips",
"external_dns_zone_name",
"ntp_servers",
"rack_network_config",
"service_ip_pools"
]
},
"RackInitUuid": {
"x-rust-type": {
"crate": "omicron-uuid-kinds",
Expand Down
2 changes: 1 addition & 1 deletion wicket/src/cli/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl ShellApp {
args.exec(log, addrs.wicketd, self.global_opts, output).await
}
ShellCommand::Setup(args) => {
args.exec(log, addrs.wicketd, self.global_opts).await?;
args.exec(log, addrs, self.global_opts).await?;
Ok(ExitCode::SUCCESS)
}
ShellCommand::Preflight(args) => {
Expand Down
12 changes: 8 additions & 4 deletions wicket/src/cli/rack_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use crate::ui::defaults::style::BULLET_ICON;
use crate::ui::defaults::style::CHECK_ICON;
use crate::ui::defaults::style::WARN_ICON;
use crate::wicketd::WicketdAddrs;
use crate::wicketd::create_commission_client;
use crate::wicketd::create_wicketd_client;
use anyhow::Context;
use anyhow::Result;
Expand All @@ -24,7 +26,6 @@ use std::fmt;
use std::io;
use std::io::Read;
use std::mem;
use std::net::SocketAddrV6;
use std::time::Duration;
use wicket_common::rack_setup::BgpAuthKeyInfo;
use wicket_common::rack_setup::BgpAuthKeyStatus;
Expand Down Expand Up @@ -87,10 +88,13 @@ impl SetupArgs {
pub(crate) async fn exec(
self,
log: Logger,
wicketd_addr: SocketAddrV6,
addrs: WicketdAddrs,
global_opts: GlobalOpts,
) -> Result<()> {
let client = create_wicketd_client(&log, wicketd_addr, WICKETD_TIMEOUT);
let client =
create_wicketd_client(&log, addrs.wicketd, WICKETD_TIMEOUT);
let commission_client =
create_commission_client(&log, addrs.commission, WICKETD_TIMEOUT);

match self {
SetupArgs::GetConfig => {
Expand Down Expand Up @@ -119,7 +123,7 @@ impl SetupArgs {
.context("failed to parse config TOML")?;

slog::info!(log, "uploading config to wicketd...");
client
commission_client
.put_rss_config(&config)
.await
.context("error uploading config to wicketd")?;
Expand Down
14 changes: 0 additions & 14 deletions wicketd-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use wicket_common::update_events::EventReport;
use wicketd_commission_types::rack_setup::BgpAuthKey;
use wicketd_commission_types::rack_setup::BgpAuthKeyId;
use wicketd_commission_types::rack_setup::CertificateUploadResponse;
use wicketd_commission_types::rack_setup::PutRssUserConfigInsensitive;
use wicketd_commission_types::rack_setup::SetBgpAuthKeyStatus;
use wicketd_commission_types::update::ClearUpdateStateResponse;
use wicketd_commission_types::update::UpdateTargets;
Expand Down Expand Up @@ -62,19 +61,6 @@ pub trait WicketdApi {
rqctx: RequestContext<Self::Context>,
) -> Result<HttpResponseOk<CurrentRssUserConfig>, HttpError>;

/// Update (a subset of) the current RSS configuration.
///
/// Sensitive values (certificates and password hash) are not set through
/// this endpoint.
#[endpoint {
method = PUT,
path = "/rack-setup/config"
}]
async fn put_rss_config(
rqctx: RequestContext<Self::Context>,
body: TypedBody<PutRssUserConfigInsensitive>,
) -> Result<HttpResponseUpdatedNoContent, HttpError>;

/// Get the current status of the multirack join configuration.
#[endpoint {
method = GET,
Expand Down
30 changes: 0 additions & 30 deletions wicketd/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ use wicket_common::rack_update::AbortUpdateOptions;
use wicket_common::update_events::EventReport;
use wicketd_api::*;
use wicketd_commission_types::rack_setup::CertificateUploadResponse;
use wicketd_commission_types::rack_setup::PutRssUserConfigInsensitive;
use wicketd_commission_types::update::ClearUpdateStateResponse;

use crate::ServerContext;
Expand Down Expand Up @@ -118,35 +117,6 @@ impl WicketdApi for WicketdApiImpl {
Ok(HttpResponseOk(config.into()))
}

async fn put_rss_config(
rqctx: RequestContext<Self::Context>,
body: TypedBody<PutRssUserConfigInsensitive>,
) -> Result<HttpResponseUpdatedNoContent, HttpError> {
let ctx = rqctx.context();

// We can't run RSS if we don't have an inventory from MGS yet; we always
// need to fill in the bootstrap sleds first.
let inventory = mgs_inventory_or_unavail(&ctx.mgs_handle).await?;

let mut config = ctx.rss_or_multirack_join_config.lock().unwrap();

// Overwrite any non-rss config
let rss_config = config.rss_config_mut_or_default();

let ddm_discovered_sleds = &ctx.bootstrap_peers.sleds();
rss_config
.update(
body.into_inner(),
&ctx.baseboard_id,
&inventory,
&ddm_discovered_sleds,
&ctx.log,
)
.map_err(|err| HttpError::for_bad_request(None, err))?;

Ok(HttpResponseUpdatedNoContent())
}

async fn put_multirack_join_config(
rqctx: RequestContext<Self::Context>,
body: TypedBody<MultirackJoinConfigBaseUserInput>,
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.