Skip to content

Add a dependsOn condition to wait for successful completion#134

Merged
ndeloof merged 6 commits intocompose-spec:masterfrom
mikesir87:add-condition-for-finished-successfully
Feb 5, 2021
Merged

Add a dependsOn condition to wait for successful completion#134
ndeloof merged 6 commits intocompose-spec:masterfrom
mikesir87:add-condition-for-finished-successfully

Conversation

@mikesir87
Copy link
Contributor

What this PR does / why we need it:

Updates the spec to add a dependsOn.condition that waits for the successful completion of a dependent service. This is important to help support init container workflows.

Which issue(s) this PR fixes:

Fixes #11

Signed-off-by: Michael Irwin <mikesir87@gmail.com>

Resolves compose-spec#11
@ndeloof
Copy link
Collaborator

ndeloof commented Jan 27, 2021

LGTM, two notes:

- Adjust service_finished_successfully to
  service_completed_successfully
- Remove exit code text, as that's platform specific

Signed-off-by: Michael Irwin <mikesir87@gmail.com>
@mikesir87
Copy link
Contributor Author

I'm not native english but https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdependency.html uses "COMPLETE" and not "FINISHED" for such a state, maybe the former would be a better noun?

I had the same debate myself and like completed more. So, I switched it to service_completed_successfully

if we adopt this I'd expect we also define a service_completed value that would not check exit code

Honestly, I'm trying to think of the scenario where someone might need that. If the dependent service failed, when would you still want the dependent service to run? Seems quite risky to me, but probably only because I can't think of a use case for it.

Copy link
Collaborator

@ndeloof ndeloof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to update the json schema to reflect this new value

Signed-off-by: Michael Irwin <mikesir87@gmail.com>
@mikesir87
Copy link
Contributor Author

don't forget to update the json schema to reflect this new value

And done. Thanks @ndeloof!

@EricHripko
Copy link
Collaborator

also CC @kohidave

Copy link
Collaborator

@EricHripko EricHripko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good ✅

@ndeloof ndeloof merged commit 183d7ab into compose-spec:master Feb 5, 2021
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: ojab <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 16, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ojab added a commit to ojab/compose that referenced this pull request Feb 18, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
ulyssessouza pushed a commit to timoxley/compose that referenced this pull request Apr 6, 2021
Fixes docker#6855

See compose-spec/compose-spec#134

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

investigate support for init container

3 participants