Skip to content

Commit

Permalink
check has own property
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Nov 7, 2024
1 parent ae09273 commit e4e1640
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/migrations/src/removeDnsFromComposeFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export function removeDnsFromPackageComposeFile(dnpName: string, isCore: boolean

for (const serviceName of Object.keys(services)) {
const composeService = services[serviceName].get();
if (composeService.dns) {
// check composeService has the key dns

if (Object.prototype.hasOwnProperty.call(composeService, "dns")) {
logs.info(`Removing DNS from ${serviceName} in ${dnpName} compose file`);
// setting undefined a yaml property might result into an error afterwards making js-yaml
// adding the following value to the undefined `Error parsing YAML: unknown tag !<tag:yaml.org,2002:js/undefined>`
Expand Down

0 comments on commit e4e1640

Please sign in to comment.