Add support for YAML anchors and aliases in 'docker-compose.yml'

This allows project files to define services from generic fragments by leveraging YAML's anchors and aliases. See here for an example: 43f6537b2c/spec.md (fragments)

Removing the FAILSAFE_SCHEMA flag is not expected to break existing project files, since the default behaviour is more liberal, or cause problems down the road given we perform validation immediately after. Docs for the flag: https://github.com/nodeca/js-yaml#load-string---options-

Change-type: minor
This commit is contained in:
dfunckt 2021-10-20 15:07:20 +03:00 committed by Akis Kesoglou
parent c401ed35ac
commit 8e712ac910

View File

@ -63,9 +63,7 @@ export function createProject(
const compose = require('resin-compose-parse');
// both methods below may throw.
const rawComposition = yml.load(composeStr, {
schema: yml.FAILSAFE_SCHEMA,
});
const rawComposition = yml.load(composeStr);
const composition = compose.normalize(rawComposition);
projectName ||= path.basename(composePath);