How does Garden.io determine the envID of the curr...
# 🌱|help-and-getting-started
a
Hello, When we change git branches, and try to deploy something new, we always get an error message that the ephemeral namespace doesn't exist and we have to create it. To clarify my question, consider these steps. 1. We are in repo X with branch Y. We create a new environment, suppose this new environment has the namespace: Y 2. We deploy and everything is good and happy. 3. Switch branch, or even just create a new branch based off the current branch. 4. Now if we try to deploy, Garden complains that namespace
Z
does not exist. It does not keep using the namespace
Y
that was already established and deployed to. Please note that
.garden
is ignored and not part of the git repo, so no issues there. Alternatively is there a garden cli command to force the usage of a namespace? Thank you.
b
Hey @aloof-lamp-69262! Thanks a lot for asking this question🌸 I would love to replicate this issue with you!🪴 Just to make sure I'm tackling the question in a good way I would like to ask you the following: 1. Are you using a local-kubernetes cluster or a remote-cluster? 2. Your intention at the end is deploy different environments according to the branch? Or the behaviour you are expecting is that every time you deploy (no matter if it's from a different branch) the namespace should be the same, but probably the code/configuration will be different depending on the branch? 3. When you say, you deploy with branch Y and you have that namespace, but if you change branch Garden complains that namespace Z doesn't exist? Does this mean that in each run your Garden is trying to create a different namespace with a different name? 4. Would it be possible to share some examples of your configuration and/or logs where the error is present to be able to reproduce this? Thanks a lot!
a
Hi Shanky again 🙂
1. Remote cluster 2. My intentions actually is to keep the same namespace regardless of whether or not I have to change branches, work on new tickets and so on... (second option). Now it's forcing me to regenerate the namespace when I have to change branch. 3. Exactly, when I say for example
garden deploy service x
or
garden deploy
again, it's happy. If I change branch and I try to use either to deploy any changes, I get that error message that namespace Z doesn't exist. If I change back to my previous branch, it works again. 4. Let me know what you need, I am not very familiar with the namespace preparation part but I can try to understand and respond 🙂 Thank you.
One more question, is there a way to generate or figure out the dependencies flow of the entire project? We need to look at them to validate proper dependencies and troubleshoot some race conditions. Thanks
b
Hey @aloof-lamp-69262 thanks for all those details for the first issue. Today I'll be reproducing your issue to try to find the root cause of it! For your second question, I would do: -
garden get modules
(to understand the modules you have) Then you can do: -
garden get graph
Which
Outputs the dependency relationships specified in this project's garden.yml files.
a
Nice, thanks, I'll have a look
5 Views