Skip to content

gitlab_pipeline_schedule.take_ownership does not claim ownership on additional plans

Bug Report

According to the documentation (https://registry.terraform.io/providers/gitlabhq/gitlab/latest/docs/resources/pipeline_schedule#take_ownership), setting this value to true should detect drifts on the pipeline configuration and claim the ownership on additional TF plans. At least in our case, doesn't seem to be the case. The change is ignored and the usage of pipeline_schedule_variable on the meant scheduled pipeline fails on GitLab API with a forbidden error. As the pipeline is now owned by a different user than the ones used by TF.

Relevant Terraform Configuration

resource "gitlab_pipeline_schedule" "infra_patching_schedule" {
  # https://docs.gitlab.com/ee/topics/cron/index.html
  project        = gitlab_project.infrastructure.id
  description    = "Patching Process"
  ref            = "master"
  cron           = "0 3 * * tue#2"
  active         = true
  cron_timezone  = "Europe/Amsterdam"
  take_ownership = true
}

resource "gitlab_pipeline_schedule_variable" "infra_patching_step" {
  project              = gitlab_project.infrastructure.id
  pipeline_schedule_id = gitlab_pipeline_schedule.infra_patching_schedule.pipeline_schedule_id
  key                  = "STEP"
  value                = "renovate"
}

Relevant Terraform Command

terraform ...

Relevant Log Output

These are the debug logs of the `terraform` command output:

Additional Details

  • GitLab Terraform Provider Version: v16.6.0
  • GitLab Version: v16.4.2-ee
  • Terraform Version: v1.6.4