Skip to content

Commit

Permalink
update (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakanechi authored Dec 19, 2024
1 parent cea3593 commit c74e3dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,13 @@ async function getManagedBuildClusterName({ annotations, pipeline, isPipelineUpd
const buildCluster = findBuildCluster(allBuildClusters, buildClusterName, pipeline.scmContext);

if (!buildCluster) {
throw new Error(
const error = new Error(
`Cluster specified in screwdriver.cd/buildCluster ${buildClusterName} ` +
`for scmContext ${pipeline.scmContext} and group ${groupName} does not exist.`
);

error.statusCode = 400;
throw error;
}

if (buildCluster.scmContext !== pipeline.scmContext || !hasClusterAccess(pipeline.name, buildCluster)) {
Expand Down
1 change: 1 addition & 0 deletions test/lib/buildFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ describe('Build Factory', () => {
'Cluster specified in screwdriver.cd/buildCluster iOS ' +
`for scmContext ${scmContext} and group default does not exist.`
);
assert.strictEqual(err.statusCode, 400);
});
});

Expand Down
1 change: 1 addition & 0 deletions test/lib/pipeline.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3213,6 +3213,7 @@ describe('Pipeline Model', () => {
'Cluster specified in screwdriver.cd/buildCluster iOS ' +
`for scmContext ${pipeline.scmContext} and group default does not exist.`
);
assert.strictEqual(err.statusCode, 400);
});
});

Expand Down

0 comments on commit c74e3dd

Please sign in to comment.