mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
Fix: add comments for checkDependencyNeedInstall
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
This commit is contained in:
+5
-2
@@ -1079,7 +1079,7 @@ func checkDependencyNeedInstall(ctx context.Context, k8sClient client.Client, de
|
||||
if !apierrors.IsNotFound(err) {
|
||||
return false, nil, err
|
||||
}
|
||||
// depApp is not exist
|
||||
// dependent addon is not exist
|
||||
return true, addonClusters, nil
|
||||
}
|
||||
topologyPolicyValue := map[string]interface{}{}
|
||||
@@ -1092,15 +1092,18 @@ func checkDependencyNeedInstall(ctx context.Context, k8sClient client.Client, de
|
||||
break
|
||||
}
|
||||
}
|
||||
// nil clusters indicates that the dependent addon is installed on all clusters
|
||||
if topologyPolicyValue["clusters"] == nil {
|
||||
return false, nil, nil
|
||||
}
|
||||
// nil addonClusters indicates the addon will be installed,
|
||||
// thus we should set the dependent addon's clusters arg to be nil so that it is installed on all clusters
|
||||
if addonClusters == nil {
|
||||
return true, nil, nil
|
||||
}
|
||||
// Determine whether the dependent addon's existing clusters can cover the new addon's clusters
|
||||
var needInstallAddonDep = false
|
||||
var depClusters []string
|
||||
// 判断原有的clusters是否能cover住addonClusters
|
||||
originClusters := topologyPolicyValue["clusters"].([]interface{})
|
||||
for _, r := range originClusters {
|
||||
depClusters = append(depClusters, r.(string))
|
||||
|
||||
Reference in New Issue
Block a user