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

Replacements not working for TF provider, but work with kustomize build #228

Open
sandangel opened this issue Apr 12, 2023 · 0 comments
Open

Comments

@sandangel
Copy link

sandangel commented Apr 12, 2023

This terraform config does not replace NUMAFLOW_IMAGE env var value with the referenced image in replacements

data "kustomization_overlay" "this" {
  images {
    name     = "quay.io/numaproj/numaflow"
    new_name = "quay.artifactory-ha.tri-ad.tech/numaproj/numaflow"
    new_tag  = "latest"
  }

  # Not working yet due to TF provider bug
  replacements {
    source {
      kind       = "Deployment"
      name       = "numaflow-controller"
      field_path = "spec.template.spec.containers.[name=controller-manager].image"
    }
    target {
      select {
        name      = "Deployment"
        kind      = "numaflow-controller"
      }
      field_paths = [
        "spec.template.spec.containers.[name=controller-manager].env.[name=NUMAFLOW_IMAGE].value"
      ]
    }
  }


  resources = concat([
    "https://github.com/numaproj/numaflow/config/cluster-install",
  ])
}

However, using kustomize works correctly:

resources:
  - https://github.com/numaproj/numaflow/config/cluster-install

images:
  - name: quay.io/numaproj/numaflow
    newName: quay.artifactory-ha.tri-ad.tech/numaproj/numaflow

replacements:
  - source:
      name: numaflow-controller
      kind: Deployment
      fieldPath: spec.template.spec.containers.[name=controller-manager].image
    targets:
      - select:
          name: numaflow-controller
          kind: Deployment
        fieldPaths:
          - spec.template.spec.containers.[name=controller-manager].env.[name=NUMAFLOW_IMAGE].value
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

1 participant