Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore_annotations does not work #2668

Open
satyamsareen opened this issue Jan 14, 2025 · 1 comment
Open

ignore_annotations does not work #2668

satyamsareen opened this issue Jan 14, 2025 · 1 comment
Assignees

Comments

@satyamsareen
Copy link

Hi Team,

The ignore_annotations setting at the provider level does not work.

My provider config:

provider "kubernetes" {
  config_path    = "./kubeconfig/config"
  ignore_annotations = [
    "kubectl\\.kubernetes\\.io\\/restartedAt"
  ]
}

Provider version: 2.35.1

Terraform plan output:

   ~ spec {
            # (5 unchanged attributes hidden)

          ~ template {
              ~ metadata {
                  ~ annotations = {
                      - "kubectl.kubernetes.io/restartedAt" = "<some-timestamp-here>" -> null
                    }
                    # (2 unchanged attributes hidden)
                }
                    # (2 unchanged attributes hidden)
                }

                # (1 unchanged block hidden)

                # (1 unchanged block hidden)
            }

            # (2 unchanged blocks hidden)
            }

            # (2 unchanged blocks hidden)
        }

        # (1 unchanged block hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

I don't have the restartedAt annotation in my state file.

The below config does work though:

  lifecycle {
    ignore_changes = [
      spec[0].template[0].metadata[0].annotations["kubectl.kubernetes.io/restartedAt"],
    ]
  }
@arybolovlev
Copy link
Contributor

Hi @satyamsareen,

When you report an issue, please fill in all the fields in the issue template. There is not enough information in your report to work on it.

Thanks.

@arybolovlev arybolovlev removed the bug label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants