Skip to content

Commit

Permalink
Tags subset fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HaveAGitGat committed Jun 10, 2024
1 parent 354b2ae commit b154da7
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,26 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {

let isSubset = true;

for (let i = 0; i < currentTags.length; i += 1) {
if (!requiredTags.includes(currentTags[i])) {
for (let i = 0; i < requiredTags.length; i += 1) {
if (!currentTags.includes(requiredTags[i])) {
isSubset = false;
break;
}
}
// requiredTags needs to be subset of currentTags
args.jobLog(`Current tags: ${currentTags}`);
args.jobLog(`Required tags: ${requiredTags}`);
args.jobLog(`Is Subset: ${isSubset}`);

if (isSubset) {
// eslint-disable-next-line no-param-reassign
args.variables.queueTags = '';
args.jobLog('Worker type and tags are subset of required tags');
args.jobLog('Required tags are subset of current tags, continuing to next plugin.');
} else {
args.jobLog('Required tags are not subset of current tags, requeueing.');
// eslint-disable-next-line no-param-reassign
args.variables.queueTags = requiredTags.join(',');
args.jobLog('Worker type and tags are not subset of required tags,'
+ ` requeueing with tags ${args.variables.queueTags}`);
args.jobLog(`Requeueing with tags ${args.variables.queueTags}`);
}

return {
Expand Down

0 comments on commit b154da7

Please sign in to comment.