Repository navigation
fix(controller): fail task when ActorTemplate creation fails - #472
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates the task reconciler to stop and report an error directly when the creation of a custom ActorTemplate fails (for example, due to a tag-only image reference), rather than silently falling back to the default template. It also adds documentation regarding image digest requirements and a unit test to verify this failure behavior. The feedback suggests improving the user-facing error message by using status.Convert(err).Message() instead of err.Error() to strip out gRPC-specific boilerplate.
069bfa6 to
0ed1dd7
Compare
|
/ok-to-test |
|
Thanks @itssimrank, this is exactly what #468 asks for, and the digest note in the docs is really helpful. Two things: it needs a rebase (a test conflict with main after #457 and #464), and once #463 lands, could the template error check substrate.IsTransientError first? A template call that runs out of Unavailable retries should leave the task Pending, not Failed. |
bcef9b6 to
c8e73b6
Compare
| resumeActorErr error | ||
| crashedActor string | ||
| revertedActors []string | ||
| // createTemplateErr, when set, is returned by CreateActorTemplate to simulate |
There was a problem hiding this comment.
nit: redundant comment, this is idiomatic mock structure in golang
| // by tag rather than digest), the task must report that error directly instead of | ||
| // silently falling back to the default template. | ||
| func TestTaskReconciler_TemplateCreationFailed(t *testing.T) { | ||
| ctx := context.Background() |
mayawang
left a comment
There was a problem hiding this comment.
LGTM, thanks @itssimrank. Approving.
c8e73b6 to
341cc53
Compare
Template creation errors were logged and the reconciler fell back to the default template, which hid the real cause behind a misleading "ActorCreationFailed: actor template not found". Make the error terminal: Ready=False with reason TemplateCreationFailed and the bare Substrate message, phase Failed, return. Transient errors (substrate.IsTransientError) leave the task Pending instead, matching the other Substrate call sites. Document the image digest requirement and add regression tests for both paths. Fixes #366
341cc53 to
987a8fa
Compare
When Substrate rejects the per-task ActorTemplate (most commonly because spec.image is referenced by tag instead of digest), the reconciler only logged a warning and fell back to the default template. In a stock deployment that template does not exist, so the task failed later with a misleading "ActorCreationFailed: actor template not found" and the real cause was only visible in the controller log.
Treat the template error as terminal for the reconcile: set Ready=False with reason TemplateCreationFailed and the Substrate error as the message, set phase Failed, and return. Falling back to a template that carries a different image is never what the user asked for.
Also document the digest requirement under Task in docs/manifests.md and add a regression test that reproduces the tag-referenced image case.
Ref: https://github.com/ericcurtin/ax/tree/fix/terminal-template-creation-failure