Skip to content

Commit

Permalink
fix(core): use yaml 1.1 schema to render (#44)
Browse files Browse the repository at this point in the history
otherwise boolean strings are automatically converted to boolean values
  • Loading branch information
shinebayar-g authored Dec 17, 2024
1 parent 02e83c4 commit 6a8d79a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/Helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class Helm {
let tmpValuesDir = '';
if (args.valuesObject) {
try {
const content = yaml.stringify(args.valuesObject);
const content = yaml.stringify(args.valuesObject, { schema: 'yaml-1.1' });
tmpValuesDir = fs.mkdtempSync(path.join(os.tmpdir(), 'k8skonf-helm-values-'), {
encoding: 'utf-8',
});
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/K8sApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class K8sApp {
}

toYaml() {
return `---\n${this.resources.map((resource) => yaml.stringify(resource)).join('---\n')}`;
return `---\n${this.resources.map((resource) => yaml.stringify(resource, { schema: 'yaml-1.1' })).join('---\n')}`;
}

save() {
Expand All @@ -41,7 +41,7 @@ export class K8sApp {
);
fs.writeFileSync(
path.join(this.outputName, `${r.kind}.${r.metadata.name}.yaml`),
yaml.stringify(r),
yaml.stringify(r, { schema: 'yaml-1.1' }),
);
}
} else {
Expand Down

0 comments on commit 6a8d79a

Please sign in to comment.