Skip to content

Commit

Permalink
Merge pull request #7564 from hamzy/PowerVS-MULTIARCH-3791
Browse files Browse the repository at this point in the history
PowerVS: MULTIARCH-3791 Remove cloud connection reuse functionality
  • Loading branch information
openshift-ci[bot] committed Oct 11, 2023
2 parents a7f89b2 + cdf24d0 commit 6a7ddfe
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 28 deletions.
4 changes: 0 additions & 4 deletions data/data/install.openshift.io_installconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4121,10 +4121,6 @@ spec:
description: PowerVS is the configuration used when installing on
Power VS.
properties:
cloudConnectionName:
description: CloudConnctionName is the name of an existing Power
VS Cloud connection. If empty, one is created by the installer.
type: string
clusterOSImage:
description: ClusterOSImage is a pre-created Power VS boot image
that overrides the default image for cluster nodes.
Expand Down
1 change: 0 additions & 1 deletion data/data/powervs/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ module "pi_network" {
resource_group = var.powervs_resource_group
pvs_network_name = var.powervs_network_name
machine_cidr = var.machine_v4_cidrs[0]
cloud_conn_name = var.powervs_ccon_name
vpc_crn = module.vpc.vpc_crn
dns_server = module.dns.dns_server
enable_snat = var.powervs_enable_snat
Expand Down
4 changes: 2 additions & 2 deletions data/data/powervs/cluster/power_network/pi_network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource "ibm_pi_dhcp" "new_dhcp_service" {
}

resource "ibm_pi_cloud_connection" "new_cloud_connection" {
count = (var.transit_gateway_enabled || var.cloud_conn_name != "") ? 0 : 1
count = var.transit_gateway_enabled ? 0 : 1
pi_cloud_instance_id = var.cloud_instance_id
pi_cloud_connection_name = "cloud-con-${var.cluster_id}"
pi_cloud_connection_speed = 50
Expand All @@ -31,7 +31,7 @@ resource "ibm_pi_cloud_connection" "new_cloud_connection" {

data "ibm_pi_cloud_connection" "cloud_connection" {
count = var.transit_gateway_enabled ? 0 : 1
pi_cloud_connection_name = var.cloud_conn_name == "" ? ibm_pi_cloud_connection.new_cloud_connection[0].pi_cloud_connection_name : var.cloud_conn_name
pi_cloud_connection_name = ibm_pi_cloud_connection.new_cloud_connection[0].pi_cloud_connection_name
pi_cloud_instance_id = var.cloud_instance_id
}

Expand Down
6 changes: 0 additions & 6 deletions data/data/powervs/variables-powervs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ variable "powervs_wait_for_vpc" {
default = "60s"
}

variable "powervs_ccon_name" {
type = string
description = "The name of a pre-created Power VS Cloud connection"
default = ""
}

variable "powervs_network_name" {
type = string
description = "The name of a pre-created Power VS DHCP network"
Expand Down
1 change: 0 additions & 1 deletion pkg/asset/cluster/tfvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,6 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
VPCPermitted: vpcPermitted,
VPCGatewayName: vpcGatewayName,
VPCGatewayAttached: vpcGatewayAttached,
CloudConnectionName: installConfig.Config.PowerVS.CloudConnectionName,
CISInstanceCRN: cisCRN,
DNSInstanceCRN: dnsCRN,
PublishStrategy: installConfig.Config.Publish,
Expand Down
9 changes: 3 additions & 6 deletions pkg/asset/quota/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,9 @@ func (a *PlatformQuotaCheck) Generate(dependencies asset.Parents) error {
transitGatewayEnabled := configpowervs.TransitGatewayEnabledZone(ic.Config.Platform.PowerVS.Zone)

if !transitGatewayEnabled {
// Only check that there isn't an existing Cloud connection if we're not re-using one
if ic.Config.Platform.PowerVS.CloudConnectionName == "" {
err = bxCli.ValidateCloudConnectionInPowerVSRegion(context.TODO(), ic.Config.Platform.PowerVS.ServiceInstanceID)
if err != nil {
return fmt.Errorf("failed to meet the prerequisite for Cloud Connections: %w", err)
}
err = bxCli.ValidateCloudConnectionInPowerVSRegion(context.TODO(), ic.Config.Platform.PowerVS.ServiceInstanceID)
if err != nil {
return fmt.Errorf("failed to meet the prerequisite for Cloud Connections: %w", err)
}
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/tfvars/powervs/powervs.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ type config struct {
VPCPermitted bool `json:"powervs_vpc_permitted"`
VPCGatewayName string `json:"powervs_vpc_gateway_name"`
VPCGatewayAttached bool `json:"powervs_vpc_gateway_attached"`
CloudConnectionName string `json:"powervs_ccon_name"`
BootstrapMemory int32 `json:"powervs_bootstrap_memory"`
BootstrapProcessors string `json:"powervs_bootstrap_processors"`
MasterMemory int32 `json:"powervs_master_memory"`
Expand All @@ -57,7 +56,6 @@ type TFVarsSources struct {
ImageBucketFileName string
NetworkName string
PowerVSResourceGroup string
CloudConnectionName string
CISInstanceCRN string
DNSInstanceCRN string
VPCRegion string
Expand Down Expand Up @@ -123,7 +121,6 @@ func TFVars(sources TFVarsSources) ([]byte, error) {
VPCPermitted: sources.VPCPermitted,
VPCGatewayName: sources.VPCGatewayName,
VPCGatewayAttached: sources.VPCGatewayAttached,
CloudConnectionName: sources.CloudConnectionName,
BootstrapMemory: masterConfig.MemoryGiB,
BootstrapProcessors: processor,
MasterMemory: masterConfig.MemoryGiB,
Expand Down
5 changes: 0 additions & 5 deletions pkg/types/powervs/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,4 @@ type Platform struct {
// platform configuration.
// +optional
DefaultMachinePlatform *MachinePool `json:"defaultMachinePlatform,omitempty"`

// CloudConnctionName is the name of an existing Power VS Cloud connection.
// If empty, one is created by the installer.
// +optional
CloudConnectionName string `json:"cloudConnectionName,omitempty"`
}

0 comments on commit 6a7ddfe

Please sign in to comment.