oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
758 stars 676 forks source link

OCI SDK env OCI_SDK_APPEND_USER_AGENT is ignored or overriden by oci terraform #1947

Open s-vo opened 1 year ago

s-vo commented 1 year ago

Terraform Version and Provider Version

Oracle-GoSDK/65.37.1 (go/go1.18.8; darwin/amd64; terraform/2.7.0; terraform-cli/1.4.2) TerraformProvider/4.120.0

Affected Resource(s)

All

Debug Output

export OCI_SDK_APPEND_USER_AGENT=Oracle-CrossPlane/1.0

Value of OCI_SDK_APPEND_USER_AGENT is not used according to logged User-Agent

OCI terraform GO SDK verbose log:

DEBUG 2023/08/24 11:21:50.381928 client.go:692: Dump Request GET /20160918/compartments/ocid1.compartment.oc1..aaaaaaaavb42zbqxfwfryi54pxt7mounggvrl56ptpyc4t3lsx2vp5u3isya HTTP/1.1 Host: identity.ca-montreal-1.oci.oraclecloud.com User-Agent: Oracle-GoSDK/65.37.1 (go/go1.18.8; darwin/amd64; terraform/2.7.0; terraform-cli/1.4.2) Oracle-TerraformProvider/4.120.0

Expected Behavior

export OCI_SDK_APPEND_USER_AGENT=Oracle-CrossPlane/1.0

Expect the value of OCI_SDK_APPEND_USER_AGENT is appended to the SDK User-Agent header.

e.g: User-Agent: Oracle-GoSDK/65.37.1 (go/go1.18.8; darwin/amd64; terraform/2.7.0; terraform-cli/1.4.2) Oracle-TerraformProvider/4.120.0 Oracle-CrossPlane/1.0

or

User-Agent: Oracle-GoSDK/... ... Oracle-CrossPlane/1.0

Actual Behavior

OCI terraform appears to override the SDK default User-Agent and ignores the SDK env OCI_SDK_APPEND_USER_AGENT.

Verbose GO SDK log:

User-Agent: Oracle-GoSDK/65.37.1 (go/go1.18.8; darwin/amd64; terraform/2.7.0; terraform-cli/1.4.2) Oracle-TerraformProvider/4.120.0

Steps to Reproduce

References

OCI_SDK_APPEND_USER_AGENT is supported in OCI Go SK https://github.com/oracle/oci-go-sdk/blob/master/common/client.go

tf-oci-pub commented 1 year ago

Thank you for reporting the issue. We observed the affected resources are not provided in the description or it's incorrect. We request you to add it in issue description as mentioned in below format. Example: affected_resources = oci_core_instance , oci_core_instances

If it's not related to any particular resource then mention affected resource as terraform. Example: affected_resources = terraform

As this works through automation, request you to follow exact syntax.

tf-oci-pub commented 1 year ago

Thank you for reporting the issue. We observed the affected resources are not provided in the description or it's incorrect. We request you to add it in issue description as mentioned in below format. Example: affected_resources = oci_core_instance , oci_core_instances

If it's not related to any particular resource then mention affected resource as terraform. Example: affected_resources = terraform

As this works through automation, request you to follow exact syntax.