Skip to content

Commit

Permalink
fix: Print version in error after @, not before (#325)
Browse files Browse the repository at this point in the history
#### Summary

Follow up to #323, @bbernays let me know if I missed anything with this
---
  • Loading branch information
erezrokah authored May 24, 2024
1 parent ef2b882 commit 9c40790
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions managedplugin/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ func getHubClient(logger zerolog.Logger, ops HubDownloadOptions) (*cloudquery_ap
func isDockerPlugin(ctx context.Context, c *cloudquery_api.ClientWithResponses, ops HubDownloadOptions) (bool, error) {
p, err := c.GetPluginVersionWithResponse(ctx, ops.PluginTeam, cloudquery_api.PluginKind(ops.PluginKind), ops.PluginName, ops.PluginVersion)
if err != nil {
return false, fmt.Errorf("failed to get %s plugin (name: %s/%s@%s) information: %w", cloudquery_api.PluginKind(ops.PluginKind), ops.PluginTeam, ops.PluginVersion, ops.PluginName, err)
return false, fmt.Errorf("failed to get %s plugin (name: %s/%s@%s) information: %w", cloudquery_api.PluginKind(ops.PluginKind), ops.PluginTeam, ops.PluginName, ops.PluginVersion, err)
}
if p.StatusCode() != http.StatusOK {
return false, fmt.Errorf("failed to get %s plugin (name: %s/%s@%s) information: %s", cloudquery_api.PluginKind(ops.PluginKind), ops.PluginTeam, ops.PluginVersion, ops.PluginName, p.Status())
return false, fmt.Errorf("failed to get %s plugin (name: %s/%s@%s) information: %s", cloudquery_api.PluginKind(ops.PluginKind), ops.PluginTeam, ops.PluginName, ops.PluginVersion, p.Status())
}
if p.JSON200 == nil {
return false, fmt.Errorf("failed to get %s plugin (name: %s/%s@%s) information: response body is empty", cloudquery_api.PluginKind(ops.PluginKind), ops.PluginVersion, ops.PluginTeam, ops.PluginName)
return false, fmt.Errorf("failed to get %s plugin (name: %s/%s@%s) information: response body is empty", cloudquery_api.PluginKind(ops.PluginKind), ops.PluginTeam, ops.PluginName, ops.PluginVersion)
}
return p.JSON200.PackageType == "docker", nil
}

0 comments on commit 9c40790

Please sign in to comment.