-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade google terraform provider #1978
Conversation
Important Auto Review SkippedReview was skipped due to path filters Files ignored due to path filters (26)
WalkthroughThe overall change across various Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files ignored due to path filters (17)
agents/go.mod
is excluded by:!**/*.mod
agents/go.sum
is excluded by:!**/*.sum
contrib/git-changes-action/go.mod
is excluded by:!**/*.mod
contrib/git-changes-action/go.sum
is excluded by:!**/*.sum
contrib/promexporter/go.mod
is excluded by:!**/*.mod
contrib/promexporter/go.sum
is excluded by:!**/*.sum
contrib/release-copier-action/go.mod
is excluded by:!**/*.mod
contrib/release-copier-action/go.sum
is excluded by:!**/*.sum
contrib/screener-api/go.mod
is excluded by:!**/*.mod
contrib/screener-api/go.sum
is excluded by:!**/*.sum
contrib/tfcore/generated/google/doc.go
is excluded by:!**/generated/**
contrib/tfcore/generated/google/generate.go
is excluded by:!**/generated/**
contrib/tfcore/generated/google/getters.go
is excluded by:!**/generated/**
contrib/tfcore/generated/google/google_gen.go
is excluded by:!**/generated/**
contrib/tfcore/go.mod
is excluded by:!**/*.mod
contrib/tfcore/go.sum
is excluded by:!**/*.sum
go.work.sum
is excluded by:!**/*.sum
Files selected for processing (8)
- contrib/terraform-provider-helmproxy/provider/provider.go (2 hunks)
- contrib/terraform-provider-iap/provider/iap-tunnel.go (3 hunks)
- contrib/terraform-provider-iap/provider/keep_alive.go (3 hunks)
- contrib/terraform-provider-iap/provider/provider.go (1 hunks)
- contrib/terraform-provider-kubeproxy/provider/main_provider.go (2 hunks)
- contrib/terraform-provider-kubeproxy/provider/manifest_provider.go (2 hunks)
- contrib/tfcore/utils/tunnel.go (3 hunks)
- contrib/tfcore/utils/utils.go (1 hunks)
Additional comments: 6
contrib/terraform-provider-iap/provider/provider.go (1)
- 6-6: Ensure the updated import path
github.com/hashicorp/terraform-provider-google/google/provider
is correct and compatible with the rest of the codebase.contrib/terraform-provider-helmproxy/provider/provider.go (1)
- 18-18: Confirm that the replacement of
google.Config
withtransport.Config
is correctly implemented and compatible with the provider's configuration logic.contrib/terraform-provider-kubeproxy/provider/main_provider.go (1)
- 16-16: Ensure that the transition to
transport.Config
fromgoogle.Config
is correctly handled and does not affect the provider's functionality adversely.contrib/tfcore/utils/tunnel.go (1)
- 18-18: Confirm that the change of the
config
parameter type to*transport.Config
in theStartTunnel
function is correctly implemented and integrated.contrib/terraform-provider-iap/provider/iap-tunnel.go (1)
- 89-89: Ensure that the switch to
transport.Config
and the use ofutils.GetTokenSource
for token source assignment indataSourceProxy
function are correctly implemented.contrib/terraform-provider-kubeproxy/provider/manifest_provider.go (1)
- 195-195: Confirm that the type assertion to
*transport.Config
in thegoogConfigureContextFunc
function is correctly implemented and does not introduce any compatibility issues.
func GetTokenSource(config *transport.Config) oauth2.TokenSource { | ||
cfgReflection := reflect.ValueOf(config) | ||
accessToken := GetUnexportedField(cfgReflection.FieldByName("tokenSource")).(oauth2.TokenSource) | ||
return accessToken | ||
} | ||
|
||
func GetUnexportedField(field reflect.Value) interface{} { | ||
return reflect.NewAt(field.Type(), unsafe.Pointer(field.UnsafeAddr())).Elem().Interface() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using reflection and the unsafe
package to access unexported fields can lead to maintenance challenges and potential runtime issues. Confirm the necessity of these approaches and ensure their safe use.
cfgReflection := reflect.ValueOf(config) | ||
context := utils.GetUnexportedField(cfgReflection.FieldByName("context")).(context2.Context) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of reflection to handle context in dataSourceKeepAlive
function raises concerns about potential side effects. Verify the necessity and correctness of this approach.
This reverts commit 0a3c464.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1978 +/- ##
===================================================
- Coverage 50.41387% 42.68385% -7.73003%
===================================================
Files 404 124 -280
Lines 28028 9233 -18795
Branches 307 0 -307
===================================================
- Hits 14130 3941 -10189
+ Misses 12509 4828 -7681
+ Partials 1389 464 -925
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Description
As part of golang/go#65363 attempt to upgrade
terraform-provider-google
. This involves some unsafe ops, may revert laterSummary by CodeRabbit
transport.Config
instead ofgoogle.Config
, enhancing compatibility and code maintainability.