Skip to content

Commit

Permalink
fix: fixed creation of unsatisfied refs for missing patch files
Browse files Browse the repository at this point in the history
  • Loading branch information
olensmar committed Sep 30, 2021
1 parent aa75dfc commit 8385fe8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/redux/services/kustomize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ function extractPatches(
});
} else {
log.warn(`No resources in ${refNode.nodeValue()} - creating FileRef to ${kpath}`);
createFileRef(kustomization, refNode, kpath);
createFileRef(kustomization, refNode, kpath, fileMap);
}
} else {
log.warn(`Failed to find ${patchPath} ${refNode.nodeValue()} in ${kustomization.filePath}`);
// this will create an unsatisfied file ref
createFileRef(kustomization, refNode, kpath, fileMap);
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/redux/services/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ export function createResourceName(filePath: string, content: any) {
* Adds a file ref to the specified file to the specified resource
*/

export function createFileRef(resource: K8sResource, refNode: NodeWrapper, filePath: string) {
let refType = ResourceRefType.Outgoing;
export function createFileRef(resource: K8sResource, refNode: NodeWrapper, filePath: string, fileMap: FileMapType) {
let refType = fileMap[filePath] ? ResourceRefType.Outgoing : ResourceRefType.Unsatisfied;
resource.refs = resource.refs || [];
const refName = (refNode ? refNode.nodeValue() : filePath) || '<missing>';

Expand Down

0 comments on commit 8385fe8

Please sign in to comment.