Skip to content

[Bug]: Flux Terraform Provider Not Updating Annotations & Comments To The Desired Version When Upgrading #759

@satyamsareen007

Description

@satyamsareen007

Describe the bug

Hi Team,

We are currently running 2.4.0 Flux version on EKS bootstrapped via GitLab. When we are trying to upgrade it to 2.5.1, we are seeing controller deployments, their images & CRDs getting updated in the terraform plan but the annotations app.kubernetes.io/version: v2.4.0 on all Flux resources are NOT getting updated to app.kubernetes.io/version: v2.5.1 & the comments which say the Flux version are also NOT getting updated.

                # This manifest was generated by flux. DO NOT EDIT.
                # Flux Version: v2.4.0

Can you please check if this is a bug and provide a fix for this.

Thankyou

Steps to reproduce

Install Flux 2.4.0 using the below config:

Flux version: 2.4.0
Flux Terraform provider: 1.4.0

provider "flux" {
  kubernetes = {
    config_path = "${path.root}/../config.yaml"
  }

  git = {
    url = gitlab_project.flux_bootstrap.web_url
    http = {
      username = var.gitlab_token
      password = var.gitlab_token
    }
  }
}


resource "flux_bootstrap_git" "bootstrap" {
  embedded_manifests   = true
  path                 = var.eks_cluster_name
  namespace            = "flux-cd"
  version              = var.flux_version
  watch_all_namespaces = true
  keep_namespace       = true
  depends_on           = [kubernetes_namespace.flux_cd]
}

Upgrade it in-place using the below config:

Flux version: 2.5.1
Flux Terraform provider: 1.5.1

provider "flux" {
  kubernetes = {
    config_path = "${path.root}/../config.yaml"
  }

  git = {
    url = gitlab_project.flux_bootstrap.web_url
    http = {
      username = var.gitlab_token
      password = var.gitlab_token
    }
  }
}


resource "flux_bootstrap_git" "bootstrap" {
  embedded_manifests   = true
  path                 = var.eks_cluster_name
  namespace            = "flux-cd"
  version              = var.flux_version
  watch_all_namespaces = true
  keep_namespace       = true
  depends_on           = [kubernetes_namespace.flux_cd]
}

Expected behavior

app.kubernetes.io/version annotations & Comments should get updated along with controller deployments, controller images & CRDs.

Screenshots and recordings

Image

Terraform and provider versions

Current Versions:

Flux version: 2.4.0
Flux Terraform provider: 1.4.0
Terraform version: 1.11.2

Versions To Which we are trying to upgrade:

Flux version: 2.5.1
Flux Terraform provider: 1.5.1
Terraform version: 1.11.2

Terraform provider configurations

Current Config:

provider "flux" {
  kubernetes = {
    config_path = "${path.root}/../config.yaml"
  }

  git = {
    url = gitlab_project.flux_bootstrap.web_url
    http = {
      username = var.gitlab_token
      password = var.gitlab_token
    }
  }
}

Config to which we are trying to upgrade:

provider "flux" {
  kubernetes = {
    config_path = "${path.root}/../config.yaml"
  }

  git = {
    url = gitlab_project.flux_bootstrap.web_url
    http = {
      username = var.gitlab_token
      password = var.gitlab_token
    }
  }
}

flux_bootstrap_git resource

Current Config:

resource "flux_bootstrap_git" "bootstrap" {
  embedded_manifests   = true
  path                 = var.eks_cluster_name
  namespace            = "flux-cd"
  version              = 2.4.0
  watch_all_namespaces = true
  keep_namespace       = true
  depends_on           = [kubernetes_namespace.flux_cd]
}

Config to which we are trying to upgrade:

resource "flux_bootstrap_git" "bootstrap" {
  embedded_manifests   = true
  path                 = var.eks_cluster_name
  namespace            = "flux-cd"
  version              = 2.5.1
  watch_all_namespaces = true
  keep_namespace       = true
  depends_on           = [kubernetes_namespace.flux_cd]
}

Flux version

2.5.1

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions