terraform-provider-huaweicloud
terraform-provider-huaweicloud copied to clipboard
Call to config.CheckUpgrade(Version) waits untill timeout in air-gapped environments and no options to skip this check
Hello,
We have environment with strict restrictions for outbound connections. With TF_LOG=DEBUG variable I can see that provider tries to check for updates at some resource in the Internet. Due to network restrictions this request fails and retries around 9 minutes blocking terraform plan/apply operations.
2024-10-18T12:24:40.903Z [DEBUG] provider.terraform-provider-huaweicloud_v1.67.1: current version: 1.67.1: timestamp=2024-10-18T12:24:40.903Z
2024-10-18T12:29:06.235Z [DEBUG] provider.terraform-provider-huaweicloud_v1.67.1: [1729254280903-4] connection error, retry number 1: dial tcp 121.36.121.227:443: connect: connection timed out: timestamp=2024-10-18T12:29:06.235Z
2024-10-18T12:33:30.427Z [DEBUG] provider.terraform-provider-huaweicloud_v1.67.1: [1729254280903-4] connection error, retries exhausted. Aborting: timestamp=2024-10-18T12:33:30.427Z
2024-10-18T12:33:30.427Z [DEBUG] provider.terraform-provider-huaweicloud_v1.67.1: [1729254280903-4] API Request URL: GET https://provider.obs.cn-north-4.myhuaweicloud.com/terraform-provider-huaweicloud/version.json
API Request Headers:: timestamp=2024-10-18T12:33:30.427Z
2024-10-18T12:33:30.427Z [WARN] provider.terraform-provider-huaweicloud_v1.67.1: failed to query version config : Get "https://provider.obs.cn-north-4.myhuaweicloud.com/terraform-provider-huaweicloud/version.json": connection error, retries exhausted. Aborting. Last error was: dial tcp 121.36.121.226:443: connect: connection timed out: timestamp=2024-10-18T12:33:30.427Z
It would be great to have some kind of provider configuration option to disable this version upgrade check, but for now I don't see any way how to do it as a terraform user without source code fixes.
Code in mention:
- provider.go (https://github.com/huaweicloud/terraform-provider-huaweicloud/blob/master/huaweicloud/provider.go#L2434)
- upgrade.go (https://github.com/huaweicloud/terraform-provider-huaweicloud/blob/master/huaweicloud/config/upgrade.go#L29)