Skip to content

Commit

Permalink
Merge pull request #3578 from uselagoon/fix-unlimited-env-quota
Browse files Browse the repository at this point in the history
fix: support unlimited env quota in commons
  • Loading branch information
tobybellwood authored Oct 29, 2023
2 parents 1bd9dfc + adfe006 commit 35965a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node-packages/commons/src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,9 @@ export const createDeployTask = async function(deployData: any) {
if (!environments.project.environments.map(e => e.name).find(i => i === branchName)) {
// check the environment quota, this prevents environments being deployed by the api or webhooks
const curOrg = await getOrganizationById(project.organization);
if (curOrg.environments.length >= curOrg.quotaEnvironment) {
if (curOrg.environments.length >= curOrg.quotaEnvironment && curOrg.quotaEnvironment != -1) {
throw new OrganizationEnvironmentLimit(
`'${branchName}' would exceed the organization environment quota of ${curOrg.quotaEnvironment}`
`'${branchName}' would exceed organization environment quota: ${curOrg.environments.length}/${curOrg.quotaEnvironment}`
);
}
}
Expand Down

0 comments on commit 35965a8

Please sign in to comment.