Skip to content

Commit

Permalink
fix: inject s3 bucket into cas config
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 committed May 21, 2024
1 parent 7a4b051 commit 6bc32c9
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 6 deletions.
5 changes: 5 additions & 0 deletions operator/src/network/cas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ pub fn cas_stateful_set_spec(
value: Some("s3".to_owned()),
..Default::default()
},
EnvVar {
name: "S3_BUCKET_NAME".to_owned(),
value: Some("ceramic-dev-cas".to_owned()),
..Default::default()
},
EnvVar {
name: "S3_ENDPOINT".to_owned(),
value: Some("http://localstack:4566".to_owned()),
Expand Down
78 changes: 72 additions & 6 deletions operator/src/network/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2817,7 +2817,18 @@ mod tests {
stub.cas_stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -130,8 +130,8 @@
@@ -122,6 +122,10 @@
"value": "dev"
},
{
+ "name": "S3_BUCKET_NAME",
+ "value": "ceramic-dev-cas"
+ },
+ {
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
},
@@ -130,8 +134,8 @@
"value": "http://localstack:4566/000000000000/cas-anchor-dev-"
}
],
Expand All @@ -2828,7 +2839,18 @@ mod tests {
"name": "cas-api",
"ports": [
{
@@ -264,8 +264,8 @@
@@ -232,6 +236,10 @@
"value": "s3"
},
{
+ "name": "S3_BUCKET_NAME",
+ "value": "ceramic-dev-cas"
+ },
+ {
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
},
@@ -264,8 +272,8 @@
"value": "false"
}
],
Expand All @@ -2839,7 +2861,7 @@ mod tests {
"name": "cas-worker",
"resources": {
"limits": {
@@ -434,8 +434,8 @@
@@ -434,8 +442,8 @@
"value": "dev"
}
],
Expand Down Expand Up @@ -2915,7 +2937,18 @@ mod tests {
stub.cas_stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -140,12 +140,12 @@
@@ -122,6 +122,10 @@
"value": "dev"
},
{
+ "name": "S3_BUCKET_NAME",
+ "value": "ceramic-dev-cas"
+ },
+ {
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
},
@@ -140,12 +144,12 @@
],
"resources": {
"limits": {
Expand All @@ -2930,7 +2963,18 @@ mod tests {
"ephemeral-storage": "1Gi",
"memory": "1Gi"
}
@@ -269,12 +269,12 @@
@@ -232,6 +236,10 @@
"value": "s3"
},
{
+ "name": "S3_BUCKET_NAME",
+ "value": "ceramic-dev-cas"
+ },
+ {
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
},
@@ -269,12 +277,12 @@
"name": "cas-worker",
"resources": {
"limits": {
Expand All @@ -2945,7 +2989,7 @@ mod tests {
"ephemeral-storage": "1Gi",
"memory": "1Gi"
}
@@ -357,12 +357,12 @@
@@ -357,12 +365,12 @@
"name": "cas-scheduler",
"resources": {
"limits": {
Expand Down Expand Up @@ -4588,6 +4632,28 @@ mod tests {
"name": "ETH_CONTRACT_ADDRESS",
"value": "0x231055A0852D67C7107Ad0d0DFeab60278fE6AdC"
},
@@ -122,6 +130,10 @@
"value": "dev"
},
{
+ "name": "S3_BUCKET_NAME",
+ "value": "ceramic-dev-cas"
+ },
+ {
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
},
@@ -232,6 +244,10 @@
"value": "s3"
},
{
+ "name": "S3_BUCKET_NAME",
+ "value": "ceramic-dev-cas"
+ },
+ {
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
},
"#]]);
let (testctx, api_handle) = Context::test(mock_rpc_client);
let fakeserver = ApiServerVerifier::new(api_handle);
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/default_stubs/cas_stateful_set
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ Request {
"name": "NODE_ENV",
"value": "dev"
},
{
"name": "S3_BUCKET_NAME",
"value": "ceramic-dev-cas"
},
{
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
Expand Down Expand Up @@ -231,6 +235,10 @@ Request {
"name": "MERKLE_CAR_STORAGE_MODE",
"value": "s3"
},
{
"name": "S3_BUCKET_NAME",
"value": "ceramic-dev-cas"
},
{
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
Expand Down

0 comments on commit 6bc32c9

Please sign in to comment.