Skip to content

Commit

Permalink
Allow overriding bastion storage pool
Browse files Browse the repository at this point in the history
Fixes #520

Signed-off-by: Yussuf Shaikh <yussuf.shaikh1@ibm.com>
  • Loading branch information
yussufsh committed Mar 8, 2024
1 parent 82c0202 commit 1ae214d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions modules/1_prepare/prepare.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,10 @@ locals {
length(local.project_bastion_image) == 0 ? ibm_pi_image.bastion[0].image_id : local.project_bastion_image[0].id
)
)
# If invalid then use hardcoded value; else if project image pool is not empty use catalog image pool; else if project image pool is empty use catalog image pool; else use project image pool
bastion_storage_pool = (
local.invalid_bastion_image ? "Tier3-Flash-1" : (
length(local.project_bastion_image) == 0 ? local.catalog_bastion_image[0].storage_pool : (
local.project_bastion_image[0].storage_pool == "" ? local.catalog_bastion_image[0].storage_pool : local.project_bastion_image[0].storage_pool
)
)
)
# Use project image pool; Further processing if it is a catalog image OR project image pool is ""
project_bastion_image_pool = !local.invalid_bastion_image && length(local.project_bastion_image) != 0 ? local.project_bastion_image[0].storage_pool : ""
# Use bastion["storage_pool"] if given else use project_bastion_image_pool or let use default (null)
bastion_storage_pool = lookup(var.bastion, "storage_pool", (local.project_bastion_image_pool == "" ? null : local.project_bastion_image_pool))
}

# Copy image from catalog if not in the project and present in catalog
Expand Down

0 comments on commit 1ae214d

Please sign in to comment.