Skip to content

Consolidate duplicate CRDs #56

@yaker-gh

Description

@yaker-gh

CRDs are duplicated between helm-charts/crds/ and terraform/manifests/. Every sync from pulp-operator requires updating both, and they can drift.

The terraform copies don't use template variables - they're static YAML. We could have terraform read directly from helm-charts/crds/ instead:

locals {
  manifests = fileset(path.module, "manifests/*.yaml")
  crds      = fileset("${path.module}/../helm-charts/crds", "*.yaml")
}

resource "kubernetes_manifest" "crds" {
  for_each = local.crds
  manifest = yamldecode(file("${path.module}/../helm-charts/crds/${each.value}"))
}

resource "kubernetes_manifest" "roles" {
  for_each   = local.manifests
  manifest   = yamldecode(templatefile("${each.value}", { ... }))
  depends_on = [kubernetes_manifest.crds]
}

Then delete the CRDs from terraform/manifests/.

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