fix: use contextName to generate container name#303
fix: use contextName to generate container name#303jirimoravcik wants to merge 3 commits intoactions:mainfrom
contextName to generate container name#303Conversation
There was a problem hiding this comment.
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.
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.
|
Hello @nikola-jokic, Thank you! |
|
Hey, sorry for the delay |
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.