-
Notifications
You must be signed in to change notification settings - Fork 86
fix: use contextName to generate container name
#303
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
base: main
Are you sure you want to change the base?
fix: use contextName to generate container name
#303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes container name generation to prevent collisions when creating multiple containers from the same image. The implementation now incorporates both the contextName and image name when generating container names, which is particularly useful for scenarios like Redis clusters with multiple shards.
Changes:
- Updated
generateContainerNamefunction to acceptServiceContainerInfoobject instead of just an image string - Modified container name format to combine
contextNameand image name - Updated all call sites and tests to reflect the new API
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| packages/k8s/src/k8s/utils.ts | Modified generateContainerName to accept service object and generate names using both contextName and image name |
| packages/k8s/src/hooks/prepare-job.ts | Updated all call sites to pass the full service object instead of just the image string |
| packages/k8s/tests/k8s-utils-test.ts | Updated test cases to use service objects and validate the new naming format |
| packages/k8s/tests/prepare-job-test.ts | Updated test call site to pass service object to generateContainerName |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR fixes an issue caused by generating the container name using only the image name. Instead, we now include the contextName as well. This is useful when creating multiple containers from the same image, for example a Redis cluster with several shards.