vesoft-inc / nebula-importer

Nebula Graph Importer with Go
Apache License 2.0
90 stars 60 forks source link

GCS: fix the WithoutAuthentication option #290

Closed haoxins closed 1 year ago

haoxins commented 1 year ago

What type of PR is this?

What problem(s) does this PR solve?

When you run the application in the GCP ENVs, such as GKE or GCE. The GCS client will try to get credentials underlying the ENVs.

See https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity

Unless the user specifies that, we shouldn't set the WithoutAuthentication option.

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

veezhang commented 1 year ago

@haoxins Thanks! Can you fix the testing ? BTW, do you know which env has the effect?

haoxins commented 1 year ago

I need to find a solution to fix the test. The test failed because it is not running on the GKE/GCE environment.

https://cloud.google.com/docs/authentication/application-default-credentials?hl=zh-cn#attached-sa

veezhang commented 1 year ago

@haoxins Setting WithoutAuthentication to true may solve the problem.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (1cbec84) 87.89% compared to head (feb24d8) 87.89%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #290 +/- ## ======================================= Coverage 87.89% 87.89% ======================================= Files 79 79 Lines 3857 3857 ======================================= Hits 3390 3390 Misses 458 458 Partials 9 9 ``` | [Files Changed](https://app.codecov.io/gh/vesoft-inc/nebula-importer/pull/290?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc) | Coverage Δ | | |---|---|---| | [pkg/source/gcs.go](https://app.codecov.io/gh/vesoft-inc/nebula-importer/pull/290?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-cGtnL3NvdXJjZS9nY3MuZ28=) | `85.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

haoxins commented 1 year ago

@haoxins Setting WithoutAuthentication to true may solve the problem.

fixed

veezhang commented 1 year ago

@haoxins Thanks a lot!