Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@
"tasks:copy-certs": "node dist/src/tasks/otomi/copy-certs.js",
"tasks:copy-certs-argo": "node dist/src/tasks/otomi/copy-certs-argo.js",
"tasks:keycloak-users-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 tsx ./src/tasks/keycloak/users.ts",
"tasks:otomi-chart-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 tsx ./src/tasks/otomi/otomi-chart.ts",
"tasks:otomi-chart": "node dist/src/tasks/otomi/otomi-chart.js",
"tasks:wait-for-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 tsx ./src/tasks/otomi/wait-for.ts",
"tasks:wait-for": "node dist/src/tasks/otomi/wait-for.js",
"operator:secrets-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 tsx ./src/operators/secrets/secrets.ts",
Expand All @@ -128,4 +126,4 @@
}
},
"version": "3.17.0"
}
}
1 change: 0 additions & 1 deletion src/operators/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export const orgName = 'otomi'
export const teamNameOwners = 'Owners'
export const teamNameViewer = 'otomi-viewer'
export const otomiValuesRepoName = 'values'
export const otomiChartsRepoName = 'charts'
16 changes: 1 addition & 15 deletions src/operators/gitea/gitea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import stream from 'stream'
import { getRepoNameFromUrl, setServiceAccountSecret } from '../../gitea-utils'
import { getTektonPipeline } from '../../k8s'
import { getSanitizedErrorMessage } from '../../utils'
import { orgName, otomiChartsRepoName, otomiValuesRepoName, teamNameOwners, teamNameViewer } from '../common'
import { orgName, otomiValuesRepoName, teamNameOwners, teamNameViewer } from '../common'
import { giteaEnv } from './lib/env'

// Interfaces
Expand Down Expand Up @@ -688,12 +688,9 @@ async function createReposAndAddToTeam(
) {
// create main organization repo: otomi/values
await upsertRepo(existingRepos, orgApi, repoApi, repoOption)
// create otomi/charts repo for auto image updates
await upsertRepo(existingRepos, orgApi, repoApi, { ...repoOption, name: otomiChartsRepoName })

// add repo: otomi/values to the team: otomi-viewer
const existingValuesRepo = existingRepos.find((repo) => repo.name === otomiValuesRepoName)
Comment thread
j-zimnowoda marked this conversation as resolved.
const existingChartsRepo = existingRepos.find((repo) => repo.name === otomiChartsRepoName)
if (!existingValuesRepo) {
try {
console.info(`Adding repo "${otomiValuesRepoName}" to team "${teamNameViewer}"`)
Expand All @@ -704,17 +701,6 @@ async function createReposAndAddToTeam(
}
}
}
if (!existingChartsRepo) {
// add repo: otomi/charts to the team: otomi-viewer
try {
console.info(`Adding repo "${otomiChartsRepoName}" to team "${teamNameViewer}"`)
await repoApi.repoAddTeam({ owner: orgName, repo: otomiChartsRepoName, team: teamNameViewer })
} catch (e) {
if (!isUnprocessableError(e)) {
errors.push(`Error adding repo ${otomiChartsRepoName} to team ${teamNameViewer}: ${e}`)
}
}
}
}

// Logic to create a webhook for repos in an organization
Expand Down
Loading