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

0.13: [Bug]: Similarly named deploy actions causing sync issues #5313

Closed
dentonalford opened this issue Oct 27, 2023 · 1 comment · Fixed by #5409
Closed

0.13: [Bug]: Similarly named deploy actions causing sync issues #5313

dentonalford opened this issue Oct 27, 2023 · 1 comment · Fixed by #5409

Comments

@dentonalford
Copy link

Garden Bonsai (0.13) Bug

Current Behavior

We have two similarly named services, monolith and monolith-frontend. These both have deploy actions and set up several sync paths.

When doing a deploy where both services are in sync mode, the similar name will cause the monolith deployment to terminate syncs from the monolith-frontend deployment

Deploy command:

garden deploy --env=dns --sync monolith,monolith-frontend

Termination errors:
Screenshot 2023-10-27 at 4 26 08 PM

Expected behavior

Both services are able to deploy their syncs simultaneously without issue.

Workaround

After deploying with the above command, we can restart the monolith-frontend syncs with sync restart monolith-frontend. This lets the syncs get set up successfully without intervention from the monolith deployment.

Suggested solution(s)

The error is coming from this check for unexpected or previously created syncs.

Because the getSyncKeyPrefix method is using kebabCase and is compared via startsWith, the monolith-frontend action name collides with the monolith action.

# Full sync keys from `sync status`:
k-8-s-dns-dev-dentonalford-monolith-frontend-deployment-monolith-frontend-some-sync-path
k-8-s-dns-dev-dentonalford-monolith-deployment-monolith-different-sync-path

# presumed prefix key result:
k-8-s-dns-dev-dentonalford-monolith-frontend-
k-8-s-dns-dev-dentonalford-monolith- # this will match both prefix keys when using `startsWith`

Ensuring the full action name is present in the check should resolve the issue.

Additional context

To validate the issue, I updated the monolith-frontend service name to monolithfrontend. This resolved the issue in my environment.

Your environment

  • OS: macOS 13.5.2
  • How I'm running Kubernetes: Azure

garden version: 0.13.18

@vvagaytsev
Copy link
Collaborator

vvagaytsev commented Oct 31, 2023

@dentonalford, thanks for reporting this and for pointing to the problematic piece of the code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants