From dcd02874d268c0e0e6d72f3973c58dfe91882ef6 Mon Sep 17 00:00:00 2001 From: Qi Feng Huo Date: Thu, 21 Sep 2023 15:35:37 +0800 Subject: [PATCH] peerpod-ctl: Fix problem in LoadEnv in IBMCloud Provider Fixes: #1454 Signed-off-by: Qi Feng Huo --- pkg/adaptor/cloud/ibmcloud/manager.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/adaptor/cloud/ibmcloud/manager.go b/pkg/adaptor/cloud/ibmcloud/manager.go index 4b3874267..2fa2f4ef8 100644 --- a/pkg/adaptor/cloud/ibmcloud/manager.go +++ b/pkg/adaptor/cloud/ibmcloud/manager.go @@ -43,12 +43,17 @@ func (*Manager) LoadEnv() { cloud.DefaultToEnv(&ibmcloudVPCConfig.VpcServiceURL, "IBMCLOUD_VPC_ENDPOINT", "") cloud.DefaultToEnv(&ibmcloudVPCConfig.ResourceGroupID, "IBMCLOUD_RESOURCE_GROUP_ID", "") cloud.DefaultToEnv(&ibmcloudVPCConfig.ProfileName, "IBMCLOUD_PODVM_INSTANCE_PROFILE_NAME", "") - cloud.DefaultToEnv(&ibmcloudVPCConfig.InstanceProfiles, "IBMCLOUD_PODVM_INSTANCE_PROFILE_LIST", "") cloud.DefaultToEnv(&ibmcloudVPCConfig.ZoneName, "IBMCLOUD_ZONE", "") cloud.DefaultToEnv(&ibmcloudVPCConfig.PrimarySubnetID, "IBMCLOUD_VPC_SUBNET_ID", "") cloud.DefaultToEnv(&ibmcloudVPCConfig.PrimarySecurityGroupID, "IBMCLOUD_VPC_SG_ID", "") cloud.DefaultToEnv(&ibmcloudVPCConfig.KeyID, "IBMCLOUD_SSH_KEY_ID", "") cloud.DefaultToEnv(&ibmcloudVPCConfig.VpcID, "IBMCLOUD_VPC_ID", "") + + var instanceProfilesStr string + cloud.DefaultToEnv(&instanceProfilesStr, "IBMCLOUD_PODVM_INSTANCE_PROFILE_LIST", "") + if instanceProfilesStr != "" { + ibmcloudVPCConfig.InstanceProfiles.Set(instanceProfilesStr) + } } func (*Manager) NewProvider() (cloud.Provider, error) {