Skip to content
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

getStatus Command return result in exec module is ignored #2671

Closed
tedchang77 opened this issue Nov 24, 2021 · 0 comments · Fixed by #2677
Closed

getStatus Command return result in exec module is ignored #2671

tedchang77 opened this issue Nov 24, 2021 · 0 comments · Fixed by #2677

Comments

@tedchang77
Copy link

Bug

Current Behavior

the return value from the getStatus command script in the exec module is ignored and the service is always deployed.

Expected behavior

if the getStatus command script returns the value 0 then don't deploy.

Reproducible example

https://github.com/tedchang77/garden-exec-status-check
output of command:
`garden get status
Get status

Running in namespace default

✔ providers → Getting status... → Cached
ℹ Run with --force-refresh to force a refresh of provider statuses.
providers:
exec:
ready: true
outputs: {}
cached: true
container:
ready: true
outputs: {}
cached: true
templated:
ready: true
outputs: {}
cached: true
services:
service1:
state: ready
forwardablePorts: []
outputs: {}
service2:
state: outdated
forwardablePorts: []
outputs: {}
tests: {}
tasks: {}
tc@L109033:~/thx/garden-exec-status-check$ garden deploy service2 -l=debug
Deploy

Initializing enterprise API client.
Enterprise domain and/or project ID missing. Aborting.

Running in namespace default

Scanning project root at /home/tc/thx/garden-exec-status-check
→ Includes: /garden.yml
→ Excludes: .garden/
/,.git,.gitmodules,.garden/**/,debug-info*/**
Found 3 files in project root /home/tc/thx/garden-exec-status-check
ℹ providers → Getting status...
✔ providers → Getting status... → Cached
ℹ Run with --force-refresh to force a refresh of provider statuses.
Scanning module root at /home/tc/thx/garden-exec-status-check/service1
→ Includes: (none)
→ Excludes: (none)
Scanning module root at /home/tc/thx/garden-exec-status-check/service2
→ Includes: (none)
→ Excludes: (none)
Found 4 files in module root /home/tc/thx/garden-exec-status-check/service1
Found 4 files in module root /home/tc/thx/garden-exec-status-check/service2
ℹ service1 → Syncing module sources (3 files)...
ℹ service2 → Syncing module sources (3 files)...
✔ service1 → Syncing module sources (3 files)... → Done (took 0 sec)
✔ service2 → Syncing module sources (3 files)... → Done (took 0 sec)
ℹ service1 → Getting build status for v-dc127e3779...
ℹ service2 → Getting build status for v-72bf65eaaf...
ℹ service1 → Building version v-dc127e3779...
ℹ service2 → Building version v-72bf65eaaf...
✔ service1 → Building version v-dc127e3779... → Done (took 0.1 sec)
ℹ service1 → Deploying version v-42ceb3520a...
✔ service2 → Building version v-72bf65eaaf... → Done (took 0.1 sec)

Finished deploying service service1. Here is the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
in service1 deploy script
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✔ service1 → Deploying version v-42ceb3520a... → Done (took 0 sec)
ℹ service2 → Deploying version v-ad249993dd...

Finished deploying service service2. Here is the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
in service2 deploy script
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✔ service2 → Deploying version v-ad249993dd... → Done (took 0 sec)

Done!
Done flushing all events and log entries.
Done flushing all events and log entries.
`

Workaround

none

Suggested solution(s)

exec module should capture return value from exec module's getStatus command script.

Additional context

Your environment

WSL2- Ubuntu-20.04

0.12.30-edge-b705c6f7

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 a pull request may close this issue.

1 participant