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

Fix csi-driver, logging and monitoring default values when autopilot … #883

Merged
merged 5 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions default-versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ terraform {
source = "hashicorp/google-beta"
version = ">= 4.36.0" # tftest
}
# used in modules
archive = {
source = "hashicorp/archive"
}
# used in fast
local = {
source = "hashicorp/local"
Expand Down
10 changes: 7 additions & 3 deletions modules/gke-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ resource "google_container_cluster" "cluster" {
)
}
gce_persistent_disk_csi_driver_config {
enabled = var.enable_addons.gce_persistent_disk_csi_driver
enabled = (
var.enable_features.autopilot
? true
: var.enable_addons.gce_persistent_disk_csi_driver
)
}
dynamic "gcp_filestore_csi_driver_config" {
for_each = !var.enable_features.autopilot ? [""] : []
Expand Down Expand Up @@ -169,7 +173,7 @@ resource "google_container_cluster" "cluster" {
}

dynamic "logging_config" {
for_each = var.logging_config != null ? [""] : []
for_each = var.logging_config != null && !var.enable_features.autopilot ? [""] : []
content {
enable_components = var.logging_config
}
Expand Down Expand Up @@ -234,7 +238,7 @@ resource "google_container_cluster" "cluster" {
}

dynamic "monitoring_config" {
for_each = var.monitoring_config != null ? [""] : []
for_each = var.monitoring_config != null && !var.enable_features.autopilot ? [""] : []
content {
enable_components = var.monitoring_config
}
Expand Down