Hello. I am using Octopus.Deployment.SpecificMachines variable to deploy only to the list of specific machines among available. However if I use variable with tenant tag in the project, it seems like my deployment do not respect Octopus.Deployment.SpecificMachines variable even though my deployment is untenanted. I can see deployment went to machines that are not in the list.
I have configured a project to test that behavior and shave off anything else that could affect the deployment. You can see in the screenshot that there are machines that are not in the Octopus.Deployment.SpecificMachines variable. Keep in mind that deployment is untenanted in this case. Also I can see that the value(A) of the variable is taken correctly. Then, if I delete variable with tenant tag scope deployment will proceed correctly.
Thank you for contacting Octopus support and for the precise instructions for the issue.
It does look like a bug. Let me try to reproduce it in our environment.
Hi @sergei.dubovsky
Thanks for getting back to me. I have uploaded the file with project variables. There is more variables in library attached to the project. I have uploaded it as well.
If you would like, I can compile only the variables that is used by this test and put them into project for better understanding.
Thank you for keeping in touch, and for your report and details so far! I’ll jump in here for Sergei for the time being as he’s now offline as part of our US-based team.
Just a quick note that I’ve been able to reproduce this behavior locally, and I myself would lean towards this being a bug. I’m going to continue our discussion internally on this behavior, but as we do so and continue trying to better understand what’s going on here I thought I’d share a potential workaround I was able to implement while I was trying to simplify the situation as much as I could.
Instead of the layers of variable bindings to evaluate the machines to set this variable to, it looks like setting this Octopus.Deployment.SpecificMachines in the project and manually entering the machines you expect it to resolve for as they’re values, the unscoped value will evaluate correctly when there’s a tag-scoped value as well. In my example it looks like this:
It’s of course not ideal, but I’m hoping that might at least help get you unstuck. Let me know what you think or if you have any questions as we continue looking at this one.
@Kenneth_Bates Thank you for your suggestion.
I trimmed everything down in the project and removed all of the variable sets from the project. Issue is still reproduceable, but much easier to understand:
Left only 1 machine in Octopus.Deployment.SpecificMachines
Empty value with tenant tag scope
Deploying untenanted and seeing deploy run on 3 machines instead of 1.
Thank you for following up and providing those additional details. That was quite helpful, and I’ve been able to reproduce this in exactly the same way as you’ve shown. In short, this certainly still feels like a bug, which I will get reported shortly. The only way around this that I can figure out at this point is to use some other scoping on this tenant tag-scoped value to get it excluded from consideration here, like an additional environment-scope. Absolutely not an ideal solution, but I’ll get this bug raised and follow up with a link that you can track.