From 83cb089c90e3504263e6bbd9612365a8e9ece4c8 Mon Sep 17 00:00:00 2001 From: Nathaniel Cook Date: Wed, 1 Nov 2023 13:43:03 -0600 Subject: [PATCH] fix: explicitly specify ceramic-one network as local --- operator/src/network/ceramic.rs | 12 ++++ operator/src/network/controller.rs | 56 +++++++++++++------ operator/src/network/testdata/ceramic_ss_1 | 8 +++ .../network/testdata/ceramic_ss_weighted_0 | 8 +++ .../network/testdata/ceramic_ss_weighted_1 | 8 +++ .../network/testdata/ceramic_ss_weighted_2 | 8 +++ .../network/testdata/ceramic_ss_weighted_3 | 8 +++ .../network/testdata/ceramic_ss_weighted_4 | 8 +++ .../network/testdata/ceramic_ss_weighted_5 | 8 +++ .../network/testdata/ceramic_ss_weighted_6 | 8 +++ .../network/testdata/ceramic_ss_weighted_7 | 8 +++ .../network/testdata/ceramic_ss_weighted_8 | 8 +++ .../network/testdata/ceramic_ss_weighted_9 | 8 +++ .../default_stubs/ceramic_stateful_set | 8 +++ 14 files changed, 148 insertions(+), 16 deletions(-) diff --git a/operator/src/network/ceramic.rs b/operator/src/network/ceramic.rs index 93d0071c..9285bdd9 100644 --- a/operator/src/network/ceramic.rs +++ b/operator/src/network/ceramic.rs @@ -423,6 +423,18 @@ impl RustIpfsConfig { value: Some("/data/ipfs".to_owned()), ..Default::default() }, + EnvVar { + name: "CERAMIC_ONE_NETWORK".to_owned(), + value: Some("local".to_owned()), + ..Default::default() + }, + EnvVar { + name: "CERAMIC_ONE_LOCAL_NETWORK_ID".to_owned(), + // We can use a hard coded value since nodes from other networks should not be + // able to connect. + value: Some("0".to_owned()), + ..Default::default() + }, ]), image: Some(self.image.to_owned()), image_pull_policy: Some(self.image_pull_policy.to_owned()), diff --git a/operator/src/network/controller.rs b/operator/src/network/controller.rs index 10c7c145..98f5d635 100644 --- a/operator/src/network/controller.rs +++ b/operator/src/network/controller.rs @@ -1774,7 +1774,7 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -137,34 +137,8 @@ + @@ -137,42 +137,8 @@ ] }, { @@ -1802,6 +1802,14 @@ mod tests { - { - "name": "CERAMIC_ONE_STORE_DIR", - "value": "/data/ipfs" + - }, + - { + - "name": "CERAMIC_ONE_NETWORK", + - "value": "local" + - }, + - { + - "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + - "value": "0" - } - ], - "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", @@ -1811,7 +1819,7 @@ mod tests { "name": "ipfs", "ports": [ { - @@ -199,6 +173,11 @@ + @@ -207,6 +173,11 @@ { "mountPath": "/data/ipfs", "name": "ipfs-data" @@ -1823,7 +1831,7 @@ mod tests { } ] } - @@ -307,6 +286,13 @@ + @@ -315,6 +286,13 @@ "persistentVolumeClaim": { "claimName": "ipfs-data" } @@ -1891,7 +1899,7 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -137,34 +137,8 @@ + @@ -137,42 +137,8 @@ ] }, { @@ -1919,6 +1927,14 @@ mod tests { - { - "name": "CERAMIC_ONE_STORE_DIR", - "value": "/data/ipfs" + - }, + - { + - "name": "CERAMIC_ONE_NETWORK", + - "value": "local" + - }, + - { + - "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + - "value": "0" - } - ], - "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", @@ -1928,7 +1944,7 @@ mod tests { "name": "ipfs", "ports": [ { - @@ -185,14 +159,14 @@ + @@ -193,14 +159,14 @@ ], "resources": { "limits": { @@ -1949,7 +1965,7 @@ mod tests { } }, "volumeMounts": [ - @@ -199,6 +173,11 @@ + @@ -207,6 +173,11 @@ { "mountPath": "/data/ipfs", "name": "ipfs-data" @@ -1961,7 +1977,7 @@ mod tests { } ] } - @@ -307,6 +286,13 @@ + @@ -315,6 +286,13 @@ "persistentVolumeClaim": { "claimName": "ipfs-data" } @@ -2027,7 +2043,7 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -137,34 +137,8 @@ + @@ -137,42 +137,8 @@ ] }, { @@ -2055,6 +2071,14 @@ mod tests { - { - "name": "CERAMIC_ONE_STORE_DIR", - "value": "/data/ipfs" + - }, + - { + - "name": "CERAMIC_ONE_NETWORK", + - "value": "local" + - }, + - { + - "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + - "value": "0" - } - ], - "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", @@ -2064,7 +2088,7 @@ mod tests { "name": "ipfs", "ports": [ { - @@ -199,6 +173,16 @@ + @@ -207,6 +173,16 @@ { "mountPath": "/data/ipfs", "name": "ipfs-data" @@ -2081,7 +2105,7 @@ mod tests { } ] } - @@ -307,6 +291,13 @@ + @@ -315,6 +291,13 @@ "persistentVolumeClaim": { "claimName": "ipfs-data" } @@ -2146,8 +2170,8 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -163,7 +163,7 @@ - "value": "/data/ipfs" + @@ -171,7 +171,7 @@ + "value": "0" } ], - "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", @@ -2155,7 +2179,7 @@ mod tests { "imagePullPolicy": "Always", "name": "ipfs", "ports": [ - @@ -185,14 +185,14 @@ + @@ -193,14 +193,14 @@ ], "resources": { "limits": { @@ -2503,7 +2527,7 @@ mod tests { } }, "volumeMounts": [ - @@ -262,14 +262,14 @@ + @@ -270,14 +270,14 @@ "name": "init-ceramic-config", "resources": { "limits": { @@ -2701,7 +2725,7 @@ mod tests { }, { "name": "CERAMIC_SQLITE_PATH", - @@ -222,19 +222,19 @@ + @@ -230,19 +230,19 @@ }, { "name": "CERAMIC_NETWORK", @@ -2761,7 +2785,7 @@ mod tests { "livenessProbe": { "httpGet": { "path": "/api/v0/node/healthcheck", - @@ -257,8 +257,8 @@ + @@ -265,8 +265,8 @@ "value": "2" } ], diff --git a/operator/src/network/testdata/ceramic_ss_1 b/operator/src/network/testdata/ceramic_ss_1 index 4b8de500..4631cb8d 100644 --- a/operator/src/network/testdata/ceramic_ss_1 +++ b/operator/src/network/testdata/ceramic_ss_1 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_0 b/operator/src/network/testdata/ceramic_ss_weighted_0 index 84be3706..8ea2e19e 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_0 +++ b/operator/src/network/testdata/ceramic_ss_weighted_0 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_1 b/operator/src/network/testdata/ceramic_ss_weighted_1 index a4e25477..a4e99614 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_1 +++ b/operator/src/network/testdata/ceramic_ss_weighted_1 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_2 b/operator/src/network/testdata/ceramic_ss_weighted_2 index d05de693..3b2882c1 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_2 +++ b/operator/src/network/testdata/ceramic_ss_weighted_2 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_3 b/operator/src/network/testdata/ceramic_ss_weighted_3 index 2ff48183..ca6fb2ee 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_3 +++ b/operator/src/network/testdata/ceramic_ss_weighted_3 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_4 b/operator/src/network/testdata/ceramic_ss_weighted_4 index a6a67c75..77e0586f 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_4 +++ b/operator/src/network/testdata/ceramic_ss_weighted_4 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_5 b/operator/src/network/testdata/ceramic_ss_weighted_5 index 8ffe246e..6d209fc8 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_5 +++ b/operator/src/network/testdata/ceramic_ss_weighted_5 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_6 b/operator/src/network/testdata/ceramic_ss_weighted_6 index ff05f9c9..f2e7dd29 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_6 +++ b/operator/src/network/testdata/ceramic_ss_weighted_6 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_7 b/operator/src/network/testdata/ceramic_ss_weighted_7 index 90037ae8..c7db493a 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_7 +++ b/operator/src/network/testdata/ceramic_ss_weighted_7 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_8 b/operator/src/network/testdata/ceramic_ss_weighted_8 index 4751782b..778ea27f 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_8 +++ b/operator/src/network/testdata/ceramic_ss_weighted_8 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/ceramic_ss_weighted_9 b/operator/src/network/testdata/ceramic_ss_weighted_9 index f6510e50..62967bd2 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_9 +++ b/operator/src/network/testdata/ceramic_ss_weighted_9 @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest", diff --git a/operator/src/network/testdata/default_stubs/ceramic_stateful_set b/operator/src/network/testdata/default_stubs/ceramic_stateful_set index e79a2111..43912c67 100644 --- a/operator/src/network/testdata/default_stubs/ceramic_stateful_set +++ b/operator/src/network/testdata/default_stubs/ceramic_stateful_set @@ -161,6 +161,14 @@ Request { { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" + }, + { + "name": "CERAMIC_ONE_NETWORK", + "value": "local" + }, + { + "name": "CERAMIC_ONE_LOCAL_NETWORK_ID", + "value": "0" } ], "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",