File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,14 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88
99## [ Unreleased]
1010
11+ ## [ 1.1.0] - 2025-10-08
12+
13+ [ Compare with previous version] ( https://github.com/sparkfabrik/terraform-gitlab-kubernetes-gitlab-agent/compare/1.0.0...1.1.0 )
14+
15+ ### Added
16+
17+ - refs platform/board #3920 : add GitLab provider user as Maintainers of ` local.project_id ` project.
18+
1119## [ 1.0.0] - 2025-10-02
1220
1321[ Compare with previous version] ( https://github.com/sparkfabrik/terraform-gitlab-kubernetes-gitlab-agent/compare/0.13.0...1.0.0 )
Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ locals {
5454}
5555
5656# Gitlab resources
57+ data "gitlab_current_user" "this" {}
58+
59+ data "gitlab_user" "this" {
60+ username = data. gitlab_current_user . this . username
61+ }
62+
5763data "gitlab_metadata" "this" {}
5864
5965data "gitlab_project" "this" {
@@ -89,6 +95,13 @@ resource "gitlab_project" "project" {
8995 namespace_id = var. operate_at_root_group_level ? data. gitlab_group . root_namespace . group_id : data. gitlab_group . parent_group [0 ]. group_id
9096}
9197
98+ resource "gitlab_project_membership" "project" {
99+ count = var. autoassign_current_user_as_maintainer ? 1 : 0
100+ project = local. project_id
101+ user_id = data. gitlab_user . this . id
102+ access_level = " maintainer"
103+ }
104+
92105resource "gitlab_cluster_agent" "this" {
93106 project = local. project_id
94107 name = var. gitlab_agent_name
Original file line number Diff line number Diff line change @@ -155,3 +155,9 @@ variable "create_default_pod_anti_affinity" {
155155 type = bool
156156 default = true
157157}
158+
159+ variable "autoassign_current_user_as_maintainer" {
160+ description = " Automatically assign the current Gitlab user (from the Gitlab provider) as a maintainer of the created project. This is useful to ensure that the user has rights to commit and push the Gitlab Agent configuration file."
161+ type = bool
162+ default = true
163+ }
You can’t perform that action at this time.
0 commit comments