Repository navigation
gateway: enforce a task's bound Gateway rules - #585
Conversation
CreateTask looks up the bound Gateway, and its rules are copied once to the task's suspended actor. A task whose rules Substrate refuses fails.
mayawang
left a comment
There was a problem hiding this comment.
Nice, this is the piece that makes Gateway real. One question: the rules are only copied when the actor comes back SUSPENDED, and otherwise skipped silently. Since fetchGateway only reloads for Pending/Failed tasks, a task whose actor isn't suspended at that moment never gets its rules and nothing reports it (fails closed, but quietly). Substrate applies a policy to a running actor within ~5s, so could we drop the state check, or mark the task not ready when it's skipped?
Suspend and resume now check the actor's egress policy on Substrate and copy the Gateway's rules if it has none. Inferring that from the actor's state and the task's phase could leave a task running without rules.
Good catch, thanks! It should've been addressed now. I dropped the state check. The suspend and resume now ask Substrate whether the actor has a policy and copy the rules if it has none. |
mayawang
left a comment
There was a problem hiding this comment.
Thanks, that's much safer. LGTM
Enforce
Task.spec.gatewayon Substrate (part of #549): a task that binds a Gateway can reach only what its rules allow.CreateTaskrequires the bound Gateway to exist (FailedPreconditionotherwise) and copies its rules to the task's actor once, while the actor is suspended.Failedwith reasonGatewayBindingFailedand the gateway's name in the message.Follow-up: Kind E2E with the Kubernetes credential provider.