代码拉取完成,页面将自动刷新
package manager
import (
helmlib "github.com/rancher/rancher/pkg/catalog/helm"
v3 "github.com/rancher/types/apis/management.cattle.io/v3"
"github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/cache"
)
func (m *Manager) updateClusterCatalogError(clusterCatalog *v3.ClusterCatalog, err error) (runtime.Object, error) {
setRefreshedError(&clusterCatalog.Catalog, err)
m.clusterCatalogClient.Update(clusterCatalog)
return nil, err
}
func (m *Manager) ClusterCatalogSync(key string, obj *v3.ClusterCatalog) (runtime.Object, error) {
ns, name, err := cache.SplitMetaNamespaceKey(key)
if err != nil {
return nil, err
}
if obj == nil {
return nil, m.deleteTemplates(name, ns)
}
// always get a refresh catalog from etcd
clusterCatalog, err := m.clusterCatalogClient.GetNamespaced(ns, name, metav1.GetOptions{})
if err != nil {
return nil, err
}
commit, helm, err := helmlib.NewForceUpdate(&clusterCatalog.Catalog)
if err != nil {
return m.updateClusterCatalogError(clusterCatalog, err)
}
if isUpToDate(commit, &clusterCatalog.Catalog) {
if setRefreshed(&clusterCatalog.Catalog) {
m.clusterCatalogClient.Update(clusterCatalog)
}
return nil, nil
}
cmt := &CatalogInfo{
catalog: &clusterCatalog.Catalog,
clusterCatalog: clusterCatalog,
}
logrus.Infof("Updating cluster catalog %s", clusterCatalog.Name)
return nil, m.traverseAndUpdate(helm, commit, cmt)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。