-
Notifications
You must be signed in to change notification settings - Fork 965
Check for Environment Scope in ReadVariable #746
Comments
As an intermediate solution, can't you just query the list of all variables and then pick the variable from there?
I know that this is not a "nice" solution, but it would solve the issue we also have in the terraform project. |
There is an update coming (probably end of July 2020) addressing this issue with a feature flag to be enabled ci_variables_api_filter_environment_scope
edit: it's not a request, only a heads up; I'll try to take a look and send a PR once it's released |
Any news? Gitlab fix the issue and released it. |
made an attempt here don't forget to enable the Gitlab feature through Gitlab console |
@remil1000 do you plan to submit a PR with your changes? |
@remil1000 It would be really nice to get this into a PR so we can finally get the Terraform resource working properly, do you plan to submit this? If not, I will reimplement it and submit it myself, but I don't see the point in doing this, if you've already done it. |
I should make a PR, but in the mean time I discovered there may be a simpler and prettier way of doing this
so probably adding an if you have any suggestion let me know |
@remil1000 Any progress on this? |
Looks like |
I guess fixing this would then allow fixing external-secrets/external-secrets#3379. |
I am coming here from https://github.com/terraform-providers/terraform-provider-gitlab.
Problem
We are using go-gitlab to create resources using terraform. We face an issue, however, where project or group variables do not consider the scope. So if you have 2 variables with the same name but different scopes, it will cause terraform to always try to update them. See discussion here: https://github.com/terraform-providers/terraform-provider-gitlab/issues/213
I think the issue lie here:
https://github.com/xanzy/go-gitlab/blob/master/group_variables.go#L84
https://github.com/xanzy/go-gitlab/blob/master/project_variables.go#L86
Possible Solutions
Currently, the Gitlab API does not allow to filter them. You can follow the issue here: https://gitlab.com/gitlab-org/gitlab/issues/20661
Once that bug is fixed, we can enhance the above mentioned functions to incorporate the filtering solution.
The text was updated successfully, but these errors were encountered: