-
Notifications
You must be signed in to change notification settings - Fork 0
deps: bump the pending Go module and GitHub Actions updates #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
789511a
044791c
652f63c
ddcd80a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -184,6 +184,7 @@ func refuseUnsupportedFields(proj *composetypes.Project) error { | |
| Reason: "multi-replica services not supported", | ||
| }) | ||
| } | ||
| found = append(found, unsupportedHooks(name, svc)...) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [MEDIUM] [D12] Native compose rejects lifecycle hooks only after building images and can leave those build side effects behind
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved — the reviewer verified this was fixed. Verified: Verified at head ddcd80a: Engine.createFreshCompose loads the project and calls refuseUnsupportedComposeProject at up.go:~670 before PrimaryService, prepareComposeServiceImage, layerFeatures, or sidecar builds. That helper invokes the same side-effect-free Plan.Validate used by Orchestrator.Up, so unsupported native compose hooks now fail before image/build side effects. The review comment above records what was claimed at the time, and is left unedited. |
||
| } | ||
|
|
||
| if len(found) == 0 { | ||
|
|
@@ -192,6 +193,40 @@ func refuseUnsupportedFields(proj *composetypes.Project) error { | |
| return &UnsupportedFieldError{Fields: sortFields(found)} | ||
| } | ||
|
|
||
| // unsupportedHooks refuses the compose lifecycle hooks. compose-go | ||
| // parses pre_start, post_start and pre_stop, but this orchestrator | ||
| // creates the service container directly and has no ephemeral | ||
| // init-container step to run them in, so it would drop them | ||
| // silently. Accepting them loses the hook's work — and worse: the | ||
| // hooks are part of the ServiceConfig that ConfigHash is computed | ||
| // over, so editing a hook that never runs reads as a config change | ||
| // and stops and removes the existing container, destroying its | ||
| // writable layer for work the backend never performed. Refused in | ||
| // Validate, before any infrastructure side effect. | ||
| // | ||
| // Only the native orchestrator reaches this. The shell-out backend | ||
| // delegates to `docker compose`, which implements the hooks itself. | ||
| func unsupportedHooks(service string, svc composetypes.ServiceConfig) []UnsupportedField { | ||
| var out []UnsupportedField | ||
| for _, h := range []struct { | ||
| field string | ||
| hooks []composetypes.ServiceHook | ||
| }{ | ||
| {"pre_start", svc.PreStart}, | ||
| {"post_start", svc.PostStart}, | ||
| {"pre_stop", svc.PreStop}, | ||
| } { | ||
| if len(h.hooks) == 0 { | ||
| continue | ||
| } | ||
| out = append(out, UnsupportedField{ | ||
| Service: service, Field: h.field, | ||
| Reason: "lifecycle hooks are not executed by the native orchestrator", | ||
| }) | ||
| } | ||
| return out | ||
| } | ||
|
|
||
| // deployUnsupported collects refusals for sub-fields of deploy: that | ||
| // this orchestrator can't honor. We accept deploy when it only carries | ||
| // resources.limits with memory/cpus — that's how compose v3+ users | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.