Skip to content

Commit

Permalink
Merge pull request #27 from udx/develop-vova
Browse files Browse the repository at this point in the history
Develop vova -> latest
  • Loading branch information
planv authored Apr 3, 2024
2 parents 0e9ed67 + 0b0040d commit e719e71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions bin/controller.keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ module.exports.updateKeys = function updateKeys(options, taskCallback) {

singleItem.Labels = _.get(singleItem, 'metadata.labels');

singleItem.Labels['ci.rabbit.name'] = singleItem.Labels['name'];

singleItem.Labels['ci.rabbit.ssh.user'] = singleItem.Labels['ci.rabbit.ssh.user'] || null;
return singleItem;
// Prevents the application from being added to the list if it does not have the required labels
if ( _.get(singleItem.Labels, 'name', false) && _.get(singleItem.Labels, 'ci.rabbit.ssh.user', false) ) {
singleItem.Labels['ci.rabbit.name'] = singleItem.Labels['name'];
singleItem.Labels['ci.rabbit.ssh.user'] = singleItem.Labels['ci.rabbit.ssh.user'] || null;
return singleItem;
}

});

Expand Down
4 changes: 2 additions & 2 deletions bin/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ setInterval(function() {

var _containers = body = _.map(body.items, function(singleItem) {
singleItem.Labels = _.get(singleItem, 'metadata.labels');
singleItem.Labels['ci.rabbit.name'] = singleItem.Labels['name'];
singleItem.Labels['ci.rabbit.ssh.user'] = singleItem.Labels['ci.rabbit.ssh.user'] || null;
singleItem.Labels['ci.rabbit.name'] = _.get(singleItem.Labels,'name', null);
singleItem.Labels['ci.rabbit.ssh.user'] = _.get(singleItem.Labels,'ci.rabbit.ssh.user', null);
return singleItem;
});

Expand Down

0 comments on commit e719e71

Please sign in to comment.