Skip to content

Commit

Permalink
feat: removed clutter
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderMatt committed Dec 12, 2023
1 parent 0cda52c commit f7d6119
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/operator/gitea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ async function execGiteaCLICommand(object: k8s.V1Pod) {
const containerStatuses = object.status?.containerStatuses || []
const giteaContainer = containerStatuses.find((container) => container.name === 'gitea')
// Check if the gitea container is 'READY'
console.debug('GiteaContainer: ', giteaContainer)
if (giteaContainer === undefined) {
console.debug('Gitea container is not found')
return
Expand All @@ -56,19 +55,14 @@ async function execGiteaCLICommand(object: k8s.V1Pod) {
.map((namespace) => namespace.metadata?.name)
.filter((name) => name && name.startsWith('team-') && name !== 'team-admin')
} catch (error) {
console.debug('Teamnamespace, exited with error:', error)
console.debug('Teamnamespaces exited with error:', error)
}
if (teamNamespaces.length > 0) {
console.debug('giteapod namespace:', object.metadata?.namespace)
console.debug('giteapod name:', object.metadata?.name)
console.debug('Creating exec command')
const execCommand = [
'sh',
'-c',
`gitea admin auth update-oauth --id 1 --group-team-map '${buildTeamString(teamNamespaces)}'`,
]
console.debug('Trying to run the following commands:')
console.debug(execCommand)
if (object && object.metadata && object.metadata.namespace && object.metadata.name) {
const exec = new k8s.Exec(kc)
// Run gitea CLI command to update the gitea oauth group mapping
Expand Down

0 comments on commit f7d6119

Please sign in to comment.