mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
Fix: The error of cannot fetch addon package breaks the loop to continue looking for addon package in the remaining registries (#5188)
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
(cherry picked from commit 9263633db7)
Co-authored-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
This commit is contained in:
co-authored by
zhaohuihui
parent
f36c8f8fbb
commit
18639ccbae
@@ -43,6 +43,9 @@ var (
|
||||
|
||||
// ErrBothCueAndYamlTmpl means yaml and cue app template are exist in addon
|
||||
ErrBothCueAndYamlTmpl = NewAddonError("yaml and cue app template are exist in addon, should only keep one of them")
|
||||
|
||||
// ErrFetch means fetch addon package error(package not exist or parse archive error and so on)
|
||||
ErrFetch = NewAddonError("cannot fetch addon package")
|
||||
)
|
||||
|
||||
// WrapErrRateLimit return ErrRateLimit if is the situation, or return error directly
|
||||
|
||||
@@ -174,7 +174,7 @@ func (i versionedRegistry) loadAddon(ctx context.Context, name, version string)
|
||||
addonPkg.Meta.SystemRequirements = LoadSystemRequirements(addonVersion.Annotations)
|
||||
return addonPkg, nil
|
||||
}
|
||||
return nil, fmt.Errorf("cannot load addon '%s'(%s) package from registry '%s'", addonVersion.Name, addonVersion.Version, i.name)
|
||||
return nil, ErrFetch
|
||||
}
|
||||
|
||||
// loadAddonVersions Load all available versions of the addon
|
||||
|
||||
@@ -575,7 +575,7 @@ func enableAddon(ctx context.Context, k8sClient client.Client, dc *discovery.Dis
|
||||
continue
|
||||
}
|
||||
err = pkgaddon.EnableAddon(ctx, addonName, version, k8sClient, dc, apply.NewAPIApplicator(k8sClient), config, registry, args, nil, pkgaddon.FilterDependencyRegistries(i, registries), opts...)
|
||||
if errors.Is(err, pkgaddon.ErrNotExist) {
|
||||
if errors.Is(err, pkgaddon.ErrNotExist) || errors.Is(err, pkgaddon.ErrFetch) {
|
||||
continue
|
||||
}
|
||||
if unMatchErr := new(pkgaddon.VersionUnMatchError); errors.As(err, unMatchErr) {
|
||||
|
||||
Reference in New Issue
Block a user