Skip to content

Commit be9e52c

Browse files
ashrafclaude
authored andcommitted
fix(gateway): include gateway-name/fqdn-proxy in deployment hash encoder
The deploy_gateway_name/deploy_gateway_fqdn methods built the right workload but signing the deployment then failed with "unsupported live workload type gateway-name-proxy" — workload_challenge in deployment.rs had no arms for the new types and bumped on the default `other` branch. Encoding order matches the Go SDK's Challenge() for the same workload type: name (or fqdn) → backends... → tls_passthrough → network. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b8159b3 commit be9e52c

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

src/grid_client/deployment.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,28 @@ fn workload_challenge(out: &mut String, workload: &DeployWorkload) -> Result<(),
704704
out.push_str(&gpu);
705705
}
706706
}
707+
zos::GATEWAY_NAME_PROXY_TYPE => {
708+
let data: GatewayNameProxyData =
709+
serde_json::from_value(workload.data.clone()).map_err(GridError::from)?;
710+
out.push_str(&data.name);
711+
for backend in &data.backends {
712+
out.push_str(backend);
713+
}
714+
write!(out, "{}", data.tls_passthrough)
715+
.map_err(|err| GridError::backend(err.to_string()))?;
716+
out.push_str(&data.network);
717+
}
718+
zos::GATEWAY_FQDN_PROXY_TYPE => {
719+
let data: GatewayFqdnProxyData =
720+
serde_json::from_value(workload.data.clone()).map_err(GridError::from)?;
721+
out.push_str(&data.fqdn);
722+
for backend in &data.backends {
723+
out.push_str(backend);
724+
}
725+
write!(out, "{}", data.tls_passthrough)
726+
.map_err(|err| GridError::backend(err.to_string()))?;
727+
out.push_str(&data.network);
728+
}
707729
other => {
708730
return Err(GridError::validation(format!(
709731
"unsupported live workload type {other}"

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ pub use calculator::Calculator;
1414
pub use error::GridError;
1515
pub use grid_client::{
1616
DEV_NETWORK, DeploymentOutcome, ExistingNetworkSpec, FullNetworkSpec, FullNetworkSpecBuilder,
17-
FullNetworkTarget, GridClient, GridClientConfig, GridClientConfigBuilder, MAIN_NETWORK,
18-
NetworkLightSpec, NetworkLightSpecBuilder, NetworkTarget, NodePlacement, NodeRequirements,
17+
FullNetworkTarget, GatewayDeploymentOutcome, GatewayFqdnDeployment, GatewayNameDeployment,
18+
GridClient, GridClientConfig, GridClientConfigBuilder, MAIN_NETWORK, NetworkLightSpec,
19+
NetworkLightSpecBuilder, NetworkTarget, NodePlacement, NodeRequirements,
1920
NodeRequirementsBuilder, QA_NETWORK, TEST_NETWORK, VmDeployment, VmDeploymentBuilder,
2021
VmLightDeployment, VmLightDeploymentBuilder, VmLightMount, VmLightSpec, VmLightSpecBuilder,
2122
VmSpec, VmSpecBuilder, VolumeMountSpec,

0 commit comments

Comments
 (0)