terraform-provider-gitlab
terraform-provider-gitlab copied to clipboard
Feature request - disallowing shared runners on group level
The gitlab_project resource has an attribute shared_runners_enabled
, which corresponds to similar setting in gitlab.
However this setting exists as well on the group level, along with another one that blocks override on subgroups/projects.
It would be nice to be able to set this on the group level as well.
This is a request to add the shared_runners_enabled
attribute to the gitlab_group
resource.
I was curious and took a look into this issue, but at a first glance, this does not look as straightforward. Isn't it an issue that the Create Group API does not support setting the shared_runners_setting
on creation? According to the documentation, it is only present on the Update Group.
Yep, there are some GitLab APIs like that. It's less straightforward, but we do have a way of handling it. In the provider "create" function...
- Call the create API
- Set the resource Id (
d.SetId(...)
) - Call the update API (conditional on if
shared_runners_setting
needs to be updated) - return
@torinthiel Can I work on this ?
@teekhandekar Yes, feel free to open a PR for that. @armsnyder has pretty much laid out the implementation steps already.
In addition, can you implement all the shared runners fields. Looking through the docs I can at least see these:
- Available on create:
- Available on update:
- Available on read:
For the shared_runners_enabled
field I've created a PR for go-gitlab to support it here:
- https://github.com/xanzy/go-gitlab/pull/1429