Skip to content
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

🐛 Safeguard GCP connection in gcp init resources. #4278

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

preslavgerchev
Copy link
Contributor

No description provided.

Copy link
Contributor

github-actions bot commented Jun 20, 2024

Test Results

3 071 tests  ±0   3 070 ✅ ±0   1m 23s ⏱️ +2s
  363 suites ±0       1 💤 ±0 
   27 files   ±0       0 ❌ ±0 

Results for commit 3bb4546. ± Comparison against base commit 4384e5d.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@czunker czunker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: What happened that we need this now?

conn := runtime.Connection.(*connection.GcpConnection)
conn, ok := runtime.Connection.(*connection.GcpConnection)
if !ok {
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we extend this func to also return an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already code paths in the same func that return nil (when no matching platform exists) so I assume returning nil here would be ok too

@preslavgerchev
Copy link
Contributor Author

preslavgerchev commented Jun 20, 2024

Just curious: What happened that we need this now?

Using a GCP/Azure/AWS snapshot connection right now is a bit weird: We use the GCP provider and we return a file system connection. There are some query filters that do query GCP resources, e.g. gcp.organization.labels (this is a totally made up example). Since we're coming from an GCP provider, this query can be compiled so it will be tried. However, the connection underneath is not a GcpConnection so we get the panic. Long term I believe we want to fix this differently but that's a good fix for the time being

@czunker
Copy link
Contributor

czunker commented Jun 20, 2024

Just curious: What happened that we need this now?

Using a GCP/Azure/AWS snapshot connection right now is a bit weird: We use the GCP provider and we return a file system connection. There are some query filters that do query GCP resources, e.g. gcp.organization.labels (this is a totally made up example). Since we're coming from an GCP provider, this query can be compiled so it will be tried. However, the connection underneath is not a GcpConnection so we get the panic. Long term I believe we want to fix this differently but that's a good fix for the time being

Thanks for the explanation. That's really wired.

@preslavgerchev preslavgerchev merged commit bdacc74 into main Jun 20, 2024
15 checks passed
@preslavgerchev preslavgerchev deleted the preslav/safeguard-gcp branch June 20, 2024 09:57
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants