Skip to content

Commit

Permalink
[internal-dns] break types-only dependencies to dns-service-client (#…
Browse files Browse the repository at this point in the history
…6807)

Currently, a number of crates across Omicron use `dns-service-client` just for
the types, leading tools like `ls-apis` to have to make exceptions to handle
them.

To resolve this, follow the pattern we've used in other places, particularly
while breaking dependency loops between API and client crates:

* Introduce a `types` crate, in this case `internal-dns-types`, and move the
  shared types (currently in `dns-server-api`) to the crate. This crate is a
  good place to put config code generally.
* Use the types from `internal-dns-types` everywhere via `replace`
  directives.

As a result of this, the only code that was left in `internal-dns` was the
resolver -- so rename the crate to `internal-dns-resolver` and move that to
`internal-dns/resolver`. Also move the `internal-dns-cli` crate to
`internal-dns/cli`, since that is the general pattern we follow in
Omicron.

As a result of this change, code that just needs the types no longer needs to
depend on `dns-service-client`, allowing us to remove one of the two
`dns-service-client`-related rules. (I believe the other rule can be removed
once all our dependencies have been bumped.)

There are no changes to the output of `cargo xtask ls-apis apis`.
  • Loading branch information
sunshowers authored Oct 10, 2024
1 parent d832c82 commit b0639b0
Show file tree
Hide file tree
Showing 99 changed files with 498 additions and 483 deletions.
78 changes: 51 additions & 27 deletions Cargo.lock

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

13 changes: 8 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ members = [
"installinator-api",
"installinator-common",
"installinator",
"internal-dns-cli",
"internal-dns",
"internal-dns/cli",
"internal-dns/resolver",
"internal-dns/types",
"ipcc",
"key-manager",
"live-tests",
Expand Down Expand Up @@ -173,8 +174,9 @@ default-members = [
"installinator-api",
"installinator-common",
"installinator",
"internal-dns-cli",
"internal-dns",
"internal-dns/cli",
"internal-dns/resolver",
"internal-dns/types",
"ipcc",
"key-manager",
"live-tests",
Expand Down Expand Up @@ -401,7 +403,8 @@ installinator = { path = "installinator" }
installinator-api = { path = "installinator-api" }
installinator-client = { path = "clients/installinator-client" }
installinator-common = { path = "installinator-common" }
internal-dns = { path = "internal-dns" }
internal-dns-resolver = { path = "internal-dns/resolver" }
internal-dns-types = { path = "internal-dns/types" }
ipcc = { path = "ipcc" }
ipnet = "2.9"
itertools = "0.13.0"
Expand Down
2 changes: 1 addition & 1 deletion clients/dns-service-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ license = "MPL-2.0"
workspace = true

[dependencies]
anyhow.workspace = true
chrono.workspace = true
expectorate.workspace = true
http.workspace = true
internal-dns-types.workspace = true
progenitor.workspace = true
reqwest = { workspace = true, features = ["json", "rustls-tls", "stream"] }
schemars.workspace = true
Expand Down
Loading

0 comments on commit b0639b0

Please sign in to comment.