Skip to content

Commit 6c90567

Browse files
Merge pull request openshift#8177 from mjturek/fix-vsi-image-missing
OCPBUGS-31013: Fix vsi image missing
2 parents aa76f02 + 6bfd134 commit 6c90567

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

data/data/powervs/cluster/dns/dns.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,16 @@ resource "ibm_is_security_group_rule" "dns_vm_sg_squid_all" {
147147
}
148148
}
149149

150+
data "ibm_is_images" "images" {
151+
count = local.proxy_count
152+
status = "available"
153+
}
154+
150155
data "ibm_is_image" "dns_vm_image" {
151156
count = local.proxy_count
152-
name = var.dns_vm_image_name
157+
name = [for image in data.ibm_is_images.images[0].images : image if startswith(image.os, var.dns_vm_image_os)][0].name
153158
}
154159

155-
156160
locals {
157161
dns_zone = var.publish_strategy == "Internal" ? data.ibm_dns_zones.dns_zones[0].dns_zones[index(data.ibm_dns_zones.dns_zones[0].dns_zones.*.name, var.base_domain)] : null
158162
proxy_count = var.publish_strategy == "Internal" ? 1 : 0

data/data/powervs/cluster/dns/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ variable "vpc_permitted" {
5858
description = "Specifies whether an existing VPC is already a Permitted Network for DNS Instance, for Private clusters."
5959
}
6060

61-
variable "dns_vm_image_name" {
61+
variable "dns_vm_image_os" {
6262
type = string
63-
description = "The image name for the DNS VM."
64-
default = "ibm-centos-7-9-minimal-amd64-6"
63+
description = "The image OS for the DNS VM."
64+
default = "centos-stream-9"
6565
}
6666

6767
variable "ssh_key" {

0 commit comments

Comments
 (0)