Fix: resolve openpitrix resources
Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
@@ -927,11 +927,12 @@ func (t *tenantOperator) collectOpenPitrixComponents(cluster, ns string) map[str
|
|||||||
}
|
}
|
||||||
for _, object := range app.ReleaseInfo {
|
for _, object := range app.ReleaseInfo {
|
||||||
unstructuredObj := object.(*unstructured.Unstructured)
|
unstructuredObj := object.(*unstructured.Unstructured)
|
||||||
if unstructuredObj.GetKind() == "Service" ||
|
kind := unstructuredObj.GetKind()
|
||||||
unstructuredObj.GetKind() == "Deployment" ||
|
if kind == "Service" ||
|
||||||
unstructuredObj.GetKind() == "Daemonset" ||
|
kind == "Deployment" ||
|
||||||
unstructuredObj.GetKind() == "Statefulset" {
|
kind == "DaemonSet" ||
|
||||||
opComponentsMap[op+":"+unstructuredObj.GetKind()] = append(opComponentsMap[unstructuredObj.GetKind()], unstructuredObj.GetName())
|
kind == "StatefulSet" {
|
||||||
|
opComponentsMap[op+":"+strings.ToLower(kind)] = append(opComponentsMap[kind], unstructuredObj.GetName())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -950,7 +951,7 @@ func (t *tenantOperator) isOpenPitrixComponent(cluster, ns, kind, componentName
|
|||||||
return false, ""
|
return false, ""
|
||||||
}
|
}
|
||||||
opName := kk[0]
|
opName := kk[0]
|
||||||
if kk[1] == strings.Title(kind) {
|
if kk[1] == kind {
|
||||||
for _, svc := range v {
|
for _, svc := range v {
|
||||||
if componentName == svc {
|
if componentName == svc {
|
||||||
return true, opName
|
return true, opName
|
||||||
|
|||||||
Reference in New Issue
Block a user