Skip to content

Commit 1032497

Browse files
authored
fix: Fallback to cached plugin in case docker plugin check fails (#571)
#### Summary In case our API is down we should still try to use a cached version of the plugin. At the moment it won't work since `validateDockerPlugin` calls our API ---
1 parent a2b751a commit 1032497

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

managedplugin/plugin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ func (c *Client) downloadPlugin(ctx context.Context, typ PluginType) (AssetSourc
223223
}
224224
isDocker, err := validateDockerPlugin(ctx, c.logger, hubClient, ops)
225225
if err != nil {
226-
return AssetSourceUnknown, err
226+
c.logger.Error().Err(err).Msg("failed to validate docker plugin, falling back to download from hub or using cached plugin")
227+
return DownloadPluginFromHub(ctx, c.logger, hubClient, ops, dops)
227228
}
228229
if isDocker {
229230
path := fmt.Sprintf(c.cqDockerHost+"/%s/%s-%s:%s", ops.PluginTeam, ops.PluginKind, ops.PluginName, ops.PluginVersion)

0 commit comments

Comments
 (0)