Skip to content

Commit 58290e9

Browse files
authored
[23.5/n] [update-common] update tufaceous and zone file names (#8518)
In #8514 we found that the artifact and file names don't actually match all the time. With this change, both the artifact and the file name have to be specified. #8510 is the issue that tracks cleaning this up.
1 parent c16f14f commit 58290e9

File tree

6 files changed

+71
-86
lines changed

6 files changed

+71
-86
lines changed

Cargo.lock

Lines changed: 14 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nexus/tests/integration_tests/updates.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ async fn test_repo_upload() -> Result<()> {
155155
}
156156
})
157157
.collect::<Vec<_>>(),
158-
["zone1", "zone2"]
158+
["zone-1", "zone-2"]
159159
);
160160
assert!(!initial_description.artifacts.iter().any(|artifact| {
161161
artifact.id.kind == KnownArtifactKind::ControlPlane.into()
@@ -302,7 +302,7 @@ async fn test_repo_upload() -> Result<()> {
302302
)?;
303303
assert_error_message_contains(
304304
&response.body,
305-
"For artifact (name: zone1, version: 1.0.0, kind: zone), uploaded \
305+
"For artifact (name: zone-1, version: 1.0.0, kind: zone), uploaded \
306306
SHA256 hash",
307307
)?;
308308
}

update-common/manifests/fake-non-semver.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,17 @@ version = "2.0.0"
4141
[artifact.control_plane.source]
4242
kind = "composite-control-plane"
4343
zones = [
44-
{ kind = "fake", name = "zone1", size = "1MiB" },
45-
{ kind = "fake", name = "zone2", size = "1MiB" },
44+
{ kind = "fake", artifact_name = "clickhouse", file_name = "clickhouse.tar.gz", size = "128KiB" },
45+
{ kind = "fake", artifact_name = "clickhouse_keeper", file_name = "clickhouse_keeper.tar.gz", size = "128KiB" },
46+
{ kind = "fake", artifact_name = "clickhouse_server", file_name = "clickhouse_server.tar.gz", size = "128KiB" },
47+
{ kind = "fake", artifact_name = "cockroachdb", file_name = "cockroachdb.tar.gz", size = "128KiB" },
48+
{ kind = "fake", artifact_name = "crucible-zone", file_name = "crucible.tar.gz", size = "128KiB" },
49+
{ kind = "fake", artifact_name = "crucible-pantry-zone", file_name = "crucible_pantry.tar.gz", size = "128KiB" },
50+
{ kind = "fake", artifact_name = "external-dns", file_name = "external_dns.tar.gz", size = "128KiB" },
51+
{ kind = "fake", artifact_name = "internal-dns", file_name = "internal_dns.tar.gz", size = "128KiB" },
52+
{ kind = "fake", artifact_name = "ntp", file_name = "ntp.tar.gz", size = "128KiB" },
53+
{ kind = "fake", artifact_name = "nexus", file_name = "nexus.tar.gz", size = "128KiB" },
54+
{ kind = "fake", artifact_name = "oximeter", file_name = "oximeter.tar.gz", size = "128KiB" },
4655
]
4756

4857
[[artifact.psc_sp]]

update-common/manifests/fake.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ version = "1.0.0"
3939
[artifact.control_plane.source]
4040
kind = "composite-control-plane"
4141
zones = [
42-
{ kind = "fake", name = "clickhouse", size = "128KiB" },
43-
{ kind = "fake", name = "clickhouse_keeper", size = "128KiB" },
44-
{ kind = "fake", name = "clickhouse_server", size = "128KiB" },
45-
{ kind = "fake", name = "cockroachdb", size = "128KiB" },
46-
{ kind = "fake", name = "crucible-zone", size = "128KiB" },
47-
{ kind = "fake", name = "crucible-pantry-zone", size = "128KiB" },
48-
{ kind = "fake", name = "external-dns", size = "128KiB" },
49-
{ kind = "fake", name = "internal-dns", size = "128KiB" },
50-
{ kind = "fake", name = "ntp", size = "128KiB" },
51-
{ kind = "fake", name = "nexus", size = "128KiB" },
52-
{ kind = "fake", name = "oximeter", size = "128KiB" },
42+
{ kind = "fake", artifact_name = "clickhouse", file_name = "clickhouse.tar.gz", size = "128KiB" },
43+
{ kind = "fake", artifact_name = "clickhouse_keeper", file_name = "clickhouse_keeper.tar.gz", size = "128KiB" },
44+
{ kind = "fake", artifact_name = "clickhouse_server", file_name = "clickhouse_server.tar.gz", size = "128KiB" },
45+
{ kind = "fake", artifact_name = "cockroachdb", file_name = "cockroachdb.tar.gz", size = "128KiB" },
46+
{ kind = "fake", artifact_name = "crucible-zone", file_name = "crucible.tar.gz", size = "128KiB" },
47+
{ kind = "fake", artifact_name = "crucible-pantry-zone", file_name = "crucible_pantry.tar.gz", size = "128KiB" },
48+
{ kind = "fake", artifact_name = "external-dns", file_name = "external_dns.tar.gz", size = "128KiB" },
49+
{ kind = "fake", artifact_name = "internal-dns", file_name = "internal_dns.tar.gz", size = "128KiB" },
50+
{ kind = "fake", artifact_name = "ntp", file_name = "ntp.tar.gz", size = "128KiB" },
51+
{ kind = "fake", artifact_name = "nexus", file_name = "nexus.tar.gz", size = "128KiB" },
52+
{ kind = "fake", artifact_name = "oximeter", file_name = "oximeter.tar.gz", size = "128KiB" },
5353
]
5454

5555
[[artifact.psc_sp]]

wicketd/tests/integration_tests/updates.rs

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ use wicketd_client::types::{
4141
GetInventoryParams, GetInventoryResponse, StartUpdateParams,
4242
};
4343

44+
/// The list of zone file names defined in fake-non-semver.toml.
45+
static FAKE_NON_SEMVER_ZONE_FILE_NAMES: &[&str] = &[
46+
"clickhouse.tar.gz",
47+
"clickhouse_keeper.tar.gz",
48+
"clickhouse_server.tar.gz",
49+
"cockroachdb.tar.gz",
50+
"crucible.tar.gz",
51+
"crucible_pantry.tar.gz",
52+
"external_dns.tar.gz",
53+
"internal_dns.tar.gz",
54+
"ntp.tar.gz",
55+
"nexus.tar.gz",
56+
"oximeter.tar.gz",
57+
];
58+
4459
// See documentation for extract_nested_artifact_pair in update_plan.rs for why
4560
// multi_thread is required.
4661
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
@@ -413,15 +428,15 @@ async fn test_installinator_fetch() {
413428
// Check that the host and control plane artifacts were downloaded
414429
// correctly.
415430
//
416-
// The control plane zone names here are defined in `fake.toml` which we
417-
// load above.
418-
for file_name in
419-
[HOST_PHASE_2_FILE_NAME, "install/zone1.tar.gz", "install/zone2.tar.gz"]
420-
{
421-
let a_path = a_path.join(file_name);
431+
// The control plane zone names here are defined in `fake-non-semver.toml`
432+
// which we load above.
433+
for file_name in [HOST_PHASE_2_FILE_NAME.to_owned()].into_iter().chain(
434+
FAKE_NON_SEMVER_ZONE_FILE_NAMES.iter().map(|z| format!("install/{z}")),
435+
) {
436+
let a_path = a_path.join(&file_name);
422437
assert!(a_path.is_file(), "{a_path} was written out");
423438

424-
let b_path = b_path.join(file_name);
439+
let b_path = b_path.join(&file_name);
425440
assert!(b_path.is_file(), "{b_path} was written out");
426441
}
427442

@@ -481,17 +496,13 @@ async fn test_installinator_fetch() {
481496
"mupdate ID matches",
482497
);
483498

484-
// Check that the zone1 and zone2 images are present in the zone set. (The
485-
// names come from fake-non-semver.toml, under
486-
// [artifact.control-plane.source]).
487-
assert!(
488-
a_manifest.zones.contains_key("zone1.tar.gz"),
489-
"zone1 is present in the zone set"
490-
);
491-
assert!(
492-
a_manifest.zones.contains_key("zone2.tar.gz"),
493-
"zone2 is present in the zone set"
494-
);
499+
// Check that the images are present in the zone set.
500+
for file_name in FAKE_NON_SEMVER_ZONE_FILE_NAMES {
501+
assert!(
502+
a_manifest.zones.contains_key(file_name),
503+
"{file_name} is present in the zone set"
504+
);
505+
}
495506

496507
// Ensure that the B path also had the same file written out.
497508
let b_manifest_path =

workspace-hack/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ generic-array = { version = "0.14.7", default-features = false, features = ["mor
6464
getrandom-6f8ce4dd05d13bba = { package = "getrandom", version = "0.2.15", default-features = false, features = ["js", "rdrand", "std"] }
6565
group = { version = "0.13.0", default-features = false, features = ["alloc"] }
6666
hashbrown = { version = "0.15.4" }
67+
heck = { version = "0.4.1" }
6768
hickory-proto = { version = "0.25.2", features = ["serde", "text-parsing"] }
6869
hmac = { version = "0.12.1", default-features = false, features = ["reset"] }
6970
hyper = { version = "1.6.0", features = ["full"] }
@@ -72,7 +73,7 @@ indexmap = { version = "2.9.0", features = ["serde"] }
7273
inout = { version = "0.1.3", default-features = false, features = ["std"] }
7374
ipnet = { version = "2.11.0", features = ["serde"] }
7475
ipnetwork = { version = "0.21.1", features = ["schemars", "serde"] }
75-
itertools-93f6ce9d446188ac = { package = "itertools", version = "0.10.5" }
76+
itertools = { version = "0.10.5" }
7677
lalrpop-util = { version = "0.19.12" }
7778
lazy_static = { version = "1.5.0", default-features = false, features = ["spin_no_std"] }
7879
libc = { version = "0.2.174", features = ["extra_traits"] }
@@ -197,6 +198,7 @@ generic-array = { version = "0.14.7", default-features = false, features = ["mor
197198
getrandom-6f8ce4dd05d13bba = { package = "getrandom", version = "0.2.15", default-features = false, features = ["js", "rdrand", "std"] }
198199
group = { version = "0.13.0", default-features = false, features = ["alloc"] }
199200
hashbrown = { version = "0.15.4" }
201+
heck = { version = "0.4.1" }
200202
hickory-proto = { version = "0.25.2", features = ["serde", "text-parsing"] }
201203
hmac = { version = "0.12.1", default-features = false, features = ["reset"] }
202204
hyper = { version = "1.6.0", features = ["full"] }
@@ -205,7 +207,7 @@ indexmap = { version = "2.9.0", features = ["serde"] }
205207
inout = { version = "0.1.3", default-features = false, features = ["std"] }
206208
ipnet = { version = "2.11.0", features = ["serde"] }
207209
ipnetwork = { version = "0.21.1", features = ["schemars", "serde"] }
208-
itertools-93f6ce9d446188ac = { package = "itertools", version = "0.10.5" }
210+
itertools = { version = "0.10.5" }
209211
lalrpop-util = { version = "0.19.12" }
210212
lazy_static = { version = "1.5.0", default-features = false, features = ["spin_no_std"] }
211213
libc = { version = "0.2.174", features = ["extra_traits"] }
@@ -350,7 +352,6 @@ getrandom-468e82937335b1c9 = { package = "getrandom", version = "0.3.1", default
350352
hyper-rustls = { version = "0.27.7", features = ["http2", "ring", "webpki-tokio"] }
351353
hyper-util = { version = "0.1.14", features = ["client-proxy", "client-proxy-system", "full"] }
352354
indicatif = { version = "0.17.11", features = ["rayon"] }
353-
itertools-5ef9efb8ec2df382 = { package = "itertools", version = "0.12.1" }
354355
mio = { version = "1.0.2", features = ["net", "os-ext"] }
355356
rustix = { version = "0.38.37", features = ["event", "fs", "net", "pipe", "process", "stdio", "system", "termios", "time"] }
356357
toml_edit-cdcf2f9584511fe6 = { package = "toml_edit", version = "0.19.15", features = ["serde"] }
@@ -365,7 +366,6 @@ getrandom-468e82937335b1c9 = { package = "getrandom", version = "0.3.1", default
365366
hyper-rustls = { version = "0.27.7", features = ["http2", "ring", "webpki-tokio"] }
366367
hyper-util = { version = "0.1.14", features = ["client-proxy", "client-proxy-system", "full"] }
367368
indicatif = { version = "0.17.11", features = ["rayon"] }
368-
itertools-5ef9efb8ec2df382 = { package = "itertools", version = "0.12.1" }
369369
mio = { version = "1.0.2", features = ["net", "os-ext"] }
370370
rustix = { version = "0.38.37", features = ["event", "fs", "net", "pipe", "process", "stdio", "system", "termios", "time"] }
371371
toml_edit-cdcf2f9584511fe6 = { package = "toml_edit", version = "0.19.15", features = ["serde"] }

0 commit comments

Comments
 (0)