Skip to content

Commit

Permalink
fix: ensured old refs are removed
Browse files Browse the repository at this point in the history
  • Loading branch information
olensmar committed Nov 17, 2021
1 parent 9f58e45 commit 1f24098
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/redux/services/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,21 @@ export function clearResourcesTemporaryObjects(resourceMap: ResourceMapType) {
return resourceMap;
}

/**
* Reprocess kustomization-specific references for all kustomizations
*/

function reprocessKustomizations(resourceMap: ResourceMapType, fileMap: FileMapType) {
Object.values(resourceMap)
.filter(r => isKustomizationResource(r))
.forEach(r => {
r.refs = [];
});

processKustomizations(resourceMap, fileMap);
clearResourcesTemporaryObjects(resourceMap);
}

/**
* Reprocesses the specified resourceIds in regard to refs/etc (called after updating...)
*
Expand Down Expand Up @@ -413,8 +428,7 @@ export function reprocessResources(
});

if (hasKustomizations) {
processKustomizations(resourceMap, fileMap);
clearResourcesTemporaryObjects(resourceMap);
reprocessKustomizations(resourceMap, fileMap);
}
}

Expand Down

0 comments on commit 1f24098

Please sign in to comment.