mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Bump @types/js-yaml from 4.0.2 to 4.0.4 (#4124)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
88f7f46ea5
commit
25c7c1a496
@ -276,7 +276,7 @@
|
||||
"@types/html-webpack-plugin": "^3.2.6",
|
||||
"@types/http-proxy": "^1.17.7",
|
||||
"@types/jest": "^26.0.24",
|
||||
"@types/js-yaml": "^4.0.2",
|
||||
"@types/js-yaml": "^4.0.4",
|
||||
"@types/jsdom": "^16.2.13",
|
||||
"@types/jsonpath": "^0.2.0",
|
||||
"@types/lodash": "^4.14.155",
|
||||
|
||||
@ -121,30 +121,32 @@ export class ResourceStack {
|
||||
for(const filename of files) {
|
||||
const file = path.join(folderPath, filename);
|
||||
const raw = await fse.readFile(file);
|
||||
let resourceData: string;
|
||||
const data = (
|
||||
filename.endsWith(".hb")
|
||||
? hb.compile(raw.toString())(templateContext)
|
||||
: raw.toString()
|
||||
).trim();
|
||||
|
||||
if (filename.endsWith(".hb")) {
|
||||
const template = hb.compile(raw.toString());
|
||||
|
||||
resourceData = template(templateContext);
|
||||
} else {
|
||||
resourceData = raw.toString();
|
||||
if (!data) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!resourceData.trim()) continue;
|
||||
for (const entry of yaml.loadAll(data)) {
|
||||
if (typeof entry !== "object" || !entry) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const resourceArray = yaml.loadAll(resourceData.toString());
|
||||
const resource = entry as Record<string, any>;
|
||||
|
||||
resourceArray.forEach((resource) => {
|
||||
if (resource?.metadata) {
|
||||
resource.metadata.labels ||= {};
|
||||
if (typeof resource.metadata === "object") {
|
||||
resource.metadata.labels ??= {};
|
||||
resource.metadata.labels["app.kubernetes.io/name"] = this.name;
|
||||
resource.metadata.labels["app.kubernetes.io/managed-by"] = productName;
|
||||
resource.metadata.labels["app.kubernetes.io/created-by"] = "resource-stack";
|
||||
}
|
||||
|
||||
resources.push(yaml.dump(resource));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return resources;
|
||||
|
||||
@ -1596,10 +1596,10 @@
|
||||
jest-diff "^26.0.0"
|
||||
pretty-format "^26.0.0"
|
||||
|
||||
"@types/js-yaml@^4.0.1", "@types/js-yaml@^4.0.2":
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.2.tgz#4117a7a378593a218e9d6f0ef44ce6d5d9edf7fa"
|
||||
integrity sha512-KbeHS/Y4R+k+5sWXEYzAZKuB1yQlZtEghuhRxrVRLaqhtoG5+26JwQsa4HyS3AWX8v1Uwukma5HheduUDskasA==
|
||||
"@types/js-yaml@^4.0.1", "@types/js-yaml@^4.0.4":
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.4.tgz#cc38781257612581a1a0eb25f1709d2b06812fce"
|
||||
integrity sha512-AuHubXUmg0AzkXH0Mx6sIxeY/1C110mm/EkE/gB1sTRz3h2dao2W/63q42SlVST+lICxz5Oki2hzYA6+KnnieQ==
|
||||
|
||||
"@types/jsdom@^16.2.13":
|
||||
version "16.2.13"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user