feat(gateway): add deploy_gateway_name and deploy_gateway_fqdn#2
Merged
Conversation
Closes the gap that prevented Rust callers from deploying ZOS gateway-name-proxy and gateway-fqdn-proxy workloads. The structs existed already but only with from_workload() — there was no path to push one onto the chain. What's added: - `GatewayNameProxy::new() / validate() / zos_workload()` and the same for `GatewayFQDNProxy` — forward conversion mirroring the existing from_workload() parsers. - `workloads::Deployment` now carries `gateway_name_proxies` and `gateway_fqdn_proxies` Vecs, included in `zos_deployment()` and `validate()`. - `grid_client::build_gateway_name_proxy` / `build_gateway_fqdn_proxy` internal builders producing DeployWorkload with the correct JSON data shape ZOS expects (`name`/`fqdn`, `tls_passthrough`, `backends`, optional `network`). - Public request types `GatewayNameDeployment` / `GatewayFqdnDeployment` and the result type `GatewayDeploymentOutcome`. - `GridClient::deploy_gateway_name(req)` — submits a substrate name contract, polls grid_proxy for its id, then creates a node contract, RMB-deploys the workload, waits for `ok`, and reads back the assigned FQDN. - `GridClient::deploy_gateway_fqdn(req)` — skips the name-contract step (user owns the domain) and follows the rest of the flow. - `GridClient::cancel_gateway(outcome)` — convenience that deletes the RMB deployment and cancels both contracts. - Three new unit tests covering the workload round-trip and validation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
The previous arms used (name → backends → tls_passthrough → network), which produced a different challenge byte sequence than the ZOS node expected. The on-chain RMB deploy then failed with `failed to verify signature`. ZOS canonical order (pkg/gridtypes/zos/gw_name.go and gw_fqdn.go in threefoldtech/zos v0.5.5): Name → TLSPassthrough → Backends, with no `network` field. Updated both arms to match exactly, including the `%t` boolean formatting used by Go's fmt.Fprintf. Verified end-to-end on dev grid against gent02.dev.grid.tf — a gateway-name-proxy now deploys to ready state and the assigned FQDN is returned from the workload result. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the gap that prevented Rust callers from deploying ZOS
gateway-name-proxy and gateway-fqdn-proxy workloads. The structs
existed already but only with from_workload() — there was no path to
push one onto the chain.
What's added:
GatewayNameProxy::new() / validate() / zos_workload()and the samefor
GatewayFQDNProxy— forward conversion mirroring the existingfrom_workload() parsers.
workloads::Deploymentnow carriesgateway_name_proxiesandgateway_fqdn_proxiesVecs, included inzos_deployment()andvalidate().grid_client::build_gateway_name_proxy/build_gateway_fqdn_proxyinternal builders producing DeployWorkload with the correct JSON
data shape ZOS expects (
name/fqdn,tls_passthrough,backends, optionalnetwork).Public request types
GatewayNameDeployment/GatewayFqdnDeploymentand the result type
GatewayDeploymentOutcome.GridClient::deploy_gateway_name(req)— submits a substrate namecontract, polls grid_proxy for its id, then creates a node contract,
RMB-deploys the workload, waits for
ok, and reads back theassigned FQDN.
GridClient::deploy_gateway_fqdn(req)— skips the name-contract step(user owns the domain) and follows the rest of the flow.
GridClient::cancel_gateway(outcome)— convenience that deletes theRMB deployment and cancels both contracts.
Three new unit tests covering the workload round-trip and validation.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.comCloses the gap that prevented Rust callers from deploying ZOS
gateway-name-proxy and gateway-fqdn-proxy workloads. The structs
existed already but only with from_workload() — there was no path to
push one onto the chain.
What's added:
GatewayNameProxy::new() / validate() / zos_workload()and the samefor
GatewayFQDNProxy— forward conversion mirroring the existingfrom_workload() parsers.
workloads::Deploymentnow carriesgateway_name_proxiesandgateway_fqdn_proxiesVecs, included inzos_deployment()andvalidate().grid_client::build_gateway_name_proxy/build_gateway_fqdn_proxyinternal builders producing DeployWorkload with the correct JSON
data shape ZOS expects (
name/fqdn,tls_passthrough,backends, optionalnetwork).Public request types
GatewayNameDeployment/GatewayFqdnDeploymentand the result type
GatewayDeploymentOutcome.GridClient::deploy_gateway_name(req)— submits a substrate namecontract, polls grid_proxy for its id, then creates a node contract,
RMB-deploys the workload, waits for
ok, and reads back theassigned FQDN.
GridClient::deploy_gateway_fqdn(req)— skips the name-contract step(user owns the domain) and follows the rest of the flow.
GridClient::cancel_gateway(outcome)— convenience that deletes theRMB deployment and cancels both contracts.
Three new unit tests covering the workload round-trip and validation.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.comCloses the gap that prevented Rust callers from deploying ZOS
gateway-name-proxy and gateway-fqdn-proxy workloads. The structs
existed already but only with from_workload() — there was no path to
push one onto the chain.
What's added:
GatewayNameProxy::new() / validate() / zos_workload()and the samefor
GatewayFQDNProxy— forward conversion mirroring the existingfrom_workload() parsers.
workloads::Deploymentnow carriesgateway_name_proxiesandgateway_fqdn_proxiesVecs, included inzos_deployment()andvalidate().grid_client::build_gateway_name_proxy/build_gateway_fqdn_proxyinternal builders producing DeployWorkload with the correct JSON
data shape ZOS expects (
name/fqdn,tls_passthrough,backends, optionalnetwork).Public request types
GatewayNameDeployment/GatewayFqdnDeploymentand the result type
GatewayDeploymentOutcome.GridClient::deploy_gateway_name(req)— submits a substrate namecontract, polls grid_proxy for its id, then creates a node contract,
RMB-deploys the workload, waits for
ok, and reads back theassigned FQDN.
GridClient::deploy_gateway_fqdn(req)— skips the name-contract step(user owns the domain) and follows the rest of the flow.
GridClient::cancel_gateway(outcome)— convenience that deletes theRMB deployment and cancels both contracts.
Three new unit tests covering the workload round-trip and validation.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com