Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit 69a02d1

Browse files
committed
Better checks for compose version in template for swarm
Cherry pick from: #16
1 parent bfdb08f commit 69a02d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/docker/templates/compose.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const updateCompose = ({username, baseName, serverConfig, composePath, util, res
2323
// read compose file
2424
const compose = yaml.safeLoad(fs.readFileSync(composePath, 'utf8'));
2525

26-
if (serverConfig.swarm && compose.version !== '3') {
26+
if (serverConfig.swarm && typeof compose.version === 'string' && !compose.version.startsWith('3')) {
2727
util.logger.debug('Compose file should be of version 3!');
2828
util.writeStatus(resultStream, {
2929
message: 'Running in swarm mode, can only deploy docker-compose file of version 3!',

0 commit comments

Comments
 (0)