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

clean up dpd-client #5951

Merged
merged 1 commit into from
Jun 26, 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
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion clients/dpd-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ slog.workspace = true
regress.workspace = true
uuid.workspace = true
chrono.workspace = true
ipnetwork.workspace = true
http.workspace = true
schemars.workspace = true
rand.workspace = true
Expand Down
24 changes: 19 additions & 5 deletions clients/dpd-client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

// Copyright 2022 Oxide Computer Company
// Copyright 2024 Oxide Computer Company
//
// TODO: remove
// This code is only required at the moment because the source repo
Expand All @@ -15,6 +15,7 @@ use anyhow::Context;
use anyhow::Result;
use omicron_zone_package::config::Config;
use omicron_zone_package::package::PackageSource;
use progenitor::TypePatch;
use quote::quote;
use std::env;
use std::fs;
Expand Down Expand Up @@ -73,7 +74,7 @@ fn main() -> Result<()> {

let code = progenitor::Generator::new(
progenitor::GenerationSettings::new()
.with_inner_type(quote!(ClientState))
.with_inner_type(quote!{ ClientState })
.with_pre_hook(quote! {
|state: &crate::ClientState, request: &reqwest::Request| {
slog::debug!(state.log, "client request";
Expand All @@ -88,9 +89,22 @@ fn main() -> Result<()> {
slog::debug!(state.log, "client response"; "result" => ?result);
}
})
.with_replacement("Ipv4Cidr", "crate::Ipv4Cidr", std::iter::empty())
.with_replacement("Ipv6Cidr", "crate::Ipv6Cidr", std::iter::empty())
.with_replacement("Cidr", "crate::Cidr", std::iter::empty()),
.with_patch("LinkId", &TypePatch::default()
.with_derive("Eq")
.with_derive("PartialEq")
)
.with_patch("LinkCreate", &TypePatch::default()
.with_derive("Eq")
.with_derive("PartialEq")
)
.with_patch("LinkSettings", &TypePatch::default()
.with_derive("Eq")
.with_derive("PartialEq")
)
.with_patch("PortSettings", &TypePatch::default()
.with_derive("Eq")
.with_derive("PartialEq")
)
)
.generate_tokens(&spec)
.with_context(|| {
Expand Down
Loading
Loading