Skip to content

Commit b255d95

Browse files
ElderMattsvcAPLBot
andauthored
feat: only allow container creation when tekton is enabled (#960)
* feat: only allow container creation when tekton is enabled * fix: add check for harbor on build create --------- Co-authored-by: svcAPLBot <174728082+svcAPLBot@users.noreply.github.com>
1 parent 89d7661 commit b255d95

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/otomi-stack.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,10 @@ export default class OtomiStack {
13971397
}
13981398

13991399
async createAplBuild(teamId: string, data: AplBuildRequest): Promise<AplBuildResponse> {
1400+
const tekton = this.getApp('tekton')
1401+
const harbor = this.getApp('harbor')
1402+
if (!tekton?.values?.enabled || !harbor?.values?.enabled)
1403+
throw new ForbiddenError('Tekton and Harbor need to be enabled, cannot create container image')
14001404
const buildName = `${data?.spec?.imageName}-${data?.spec?.tag}`
14011405
if (data.spec.secretName && data.spec.secretName.length < 2)
14021406
throw new ValidationError('Secret name must be at least 2 characters long')

0 commit comments

Comments
 (0)