mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 03:56:36 +00:00
Fix: gc resources without resourceversion (#4583)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
This commit is contained in:
@@ -113,7 +113,7 @@ func (cache *resourceCache) exists(manifest *unstructured.Unstructured) bool {
|
||||
return true
|
||||
}
|
||||
appKey, controlledBy := apply.GetAppKey(cache.app), apply.GetControlledBy(manifest)
|
||||
if appKey == controlledBy {
|
||||
if appKey == controlledBy || manifest.GetResourceVersion() == "" {
|
||||
return true
|
||||
}
|
||||
annotations := manifest.GetAnnotations()
|
||||
|
||||
@@ -139,8 +139,9 @@ func TestResourceCacheExistenceCheck(t *testing.T) {
|
||||
createResource := func(appName, appNs, sharedBy string) *unstructured.Unstructured {
|
||||
return &unstructured.Unstructured{Object: map[string]interface{}{
|
||||
"metadata": map[string]interface{}{
|
||||
"labels": map[string]interface{}{oam.LabelAppName: appName, oam.LabelAppNamespace: appNs},
|
||||
"annotations": map[string]interface{}{oam.AnnotationAppSharedBy: sharedBy},
|
||||
"labels": map[string]interface{}{oam.LabelAppName: appName, oam.LabelAppNamespace: appNs},
|
||||
"annotations": map[string]interface{}{oam.AnnotationAppSharedBy: sharedBy},
|
||||
"resourceVersion": "-",
|
||||
},
|
||||
}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user