Skip to content

Commit

Permalink
Simplifly variables to use only var.infrastructure_provider (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
zioproto authored Apr 8, 2024
1 parent 3a67544 commit 67698d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
14 changes: 7 additions & 7 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ locals {
argocd_namespace = "argocd"

azure_addons = {
enable_azure_crossplane_upbound_provider = var.infrastructure_provider == "crossplane" && var.addons.enable_azure_crossplane_upbound_provider ? true : false
enable_cluster_api_operator = var.infrastructure_provider == "capz" && var.addons.enable_cluster_api_operator ? true : false
enable_azure_crossplane_upbound_provider = var.infrastructure_provider == "crossplane" ? true : false
enable_cluster_api_operator = var.infrastructure_provider == "capz" ? true : false
}

oss_addons = {
enable_argocd = try(var.addons.enable_argocd, false) # installed by default
enable_argocd = try(var.addons.enable_argocd, true) # installed by default
enable_argo_rollouts = try(var.addons.enable_argo_rollouts, false)
enable_argo_events = try(var.addons.enable_argo_events, false)
enable_argo_workflows = try(var.addons.enable_argo_workflows, false)
enable_cluster_proportional_autoscaler = try(var.addons.enable_cluster_proportional_autoscaler, false)
enable_cert_manager = var.infrastructure_provider == "capz" && var.addons.enable_cert_manager ? true : false
enable_cert_manager = var.infrastructure_provider == "capz" || try(var.addons.enable_cert_manager,false) ? true : false
enable_gatekeeper = try(var.addons.enable_gatekeeper, false)
enable_gpu_operator = try(var.addons.enable_gpu_operator, false)
enable_ingress_nginx = try(var.addons.enable_ingress_nginx, false)
Expand All @@ -33,9 +33,9 @@ locals {
enable_prometheus_adapter = try(var.addons.enable_prometheus_adapter, false)
enable_secrets_store_csi_driver = try(var.addons.enable_secrets_store_csi_driver, false)
enable_vpa = try(var.addons.enable_vpa, false)
enable_crossplane = var.infrastructure_provider == "crossplane" && var.addons.enable_crossplane ? true : false
enable_crossplane_helm_provider = var.infrastructure_provider == "crossplane" && var.addons.enable_crossplane_helm_provider ? true : false
enable_crossplane_kubernetes_provider = var.infrastructure_provider == "crossplane" && var.addons.enable_crossplane_kubernetes_provider? true : false
enable_crossplane = var.infrastructure_provider == "crossplane" ? true : false
enable_crossplane_helm_provider = var.infrastructure_provider == "crossplane" ? true : false
enable_crossplane_kubernetes_provider = var.infrastructure_provider == "crossplane" ? true : false
}
addons = merge(local.azure_addons, local.oss_addons)

Expand Down
6 changes: 0 additions & 6 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ variable "addons" {
type = any
default = {
enable_argocd = true # installs argocd
enable_cert_manager = true # installs cert manager
enable_crossplane = true # installs crossplane core
enable_azure_crossplane_upbound_provider = true # installs azure upbound provider
enable_cluster_api_operator = true # installs azure api operator
enable_crossplane_helm_provider = true # installs crossplane helm provider
enable_crossplane_kubernetes_provider = true # installs crossplane kubernetes provider
}
}

Expand Down

0 comments on commit 67698d8

Please sign in to comment.