Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Improved config loading guards for generic Lando 3 service

## v3.24.0-beta.10 - [January 15, 2025](https://github.com/lando/core/releases/tag/v3.24.0-beta.10)

### New Features
Expand Down
17 changes: 10 additions & 7 deletions builders/_lando.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ module.exports = {
// Add custom to list of supported
supported.push('custom');

// rebase remoteFiles on testing data
remoteFiles = _.merge({}, {'_lando_test_': '/tmp/rooster'}, remoteFiles);

// If this version is not supported throw an error
// @TODO: get this someplace else for unit tezting
if (!supportedIgnore && !_.includes(supported, version)) {
Expand Down Expand Up @@ -139,17 +142,17 @@ module.exports = {
if (refreshCerts) volumes.push(`${refreshCertsScript}:/scripts/999-refresh-certs`);

// Add in any custom pre-runscripts
_.forEach(scripts, script => {
for (const script of scripts) {
const local = path.resolve(root, script);
const remote = path.join('/scripts', path.basename(script));
volumes.push(`${local}:${remote}`);
});

// rebase remoteFiles
remoteFiles = _.merge({}, {'_lando_': '/tmp/rooster'}, remoteFiles);
}

// Handle custom config files
_.forEach(config, (local, remote) => {
for (let [remote, local] of Object.entries(config)) {
// if we dont have entries we can work with then just go to the next iteration
if (!_.has(remoteFiles, remote) && typeof remote !== 'string') continue;

// if this is special type then get it from remoteFile
remote = _.has(remoteFiles, remote) ? remoteFiles[remote] : path.resolve('/', remote);

Expand All @@ -168,7 +171,7 @@ module.exports = {
}

volumes.push(`${path.resolve(root, local)}:${remote}`);
});
}

// Add named volumes and other thingz into our primary service
const namedVols = {};
Expand Down
2 changes: 1 addition & 1 deletion examples/config/.lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
api: 3
type: lando
config:
_lando_: rooster
_lando_test_: rooster
/tmp/somewhere: rooster
/tmp/somewhere-else: !import rooster
/tmp/somewhere-else-else: |
Expand Down
Loading