Skip to content

Commit

Permalink
feat(helmTool): update logging
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Marshall <[email protected]>
  • Loading branch information
alexhq committed Jul 27, 2023
1 parent 914a24a commit 729c617
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/helmTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,17 @@ export class HelmTool {
// or update the helm charts if they already exist
async syncDbCharts(repo: HelmRepository) {
// Get the index.yaml file
logger.info({ action: 'syncing helm charts for', repo })
logger.info({ action: 'getting repository index.yaml' })
const repoindex = await this.getIndexYaml(repo)
console.log('repoindex', repoindex)
logger.debug({ action: 'repoindex', repoindex })
// From the repoindex make an array of charts
const indexcharts = Object.keys(repoindex.entries)
console.log('indexcharts', indexcharts)
logger.debug({ action: 'indexcharts', indexcharts })
// For each chart in the index.yaml
for (const chartKey of indexcharts) {
const chartVersions = repoindex.entries[chartKey]
console.log('chartVersions', chartVersions)
logger.debug({ action: 'chartVersions', chartVersions })
// Get the chart's helm repository details from the database
const dbRepository = await this.store.helmrepository.getByUrl({
url: repo.url,
Expand All @@ -210,6 +212,7 @@ export class HelmTool {
})
if (chartInDb) {
// update the helm chart in the database
logger.debug({ action: 'updating helm chart', chartInDb })
await this.store.helmchart.update({
id: chartInDb.id,
data: {
Expand All @@ -229,6 +232,7 @@ export class HelmTool {
})
} else {
// add the helm chart to the database
logger.debug({ action: 'adding helm chart', chart })
await this.store.helmchart.create({
data: {
active: true,
Expand Down Expand Up @@ -296,6 +300,7 @@ export class HelmTool {
async updateDbHelmCharts() {
// Get list of helm repositories from the database
const dbRepos = await this.store.helmrepository.list()
logger.debug({ action: 'dbRepos', dbRepos })
// Run syncDbHelmChart for each repository
for (const repo of dbRepos) {
await this.syncDbCharts(repo)
Expand Down

0 comments on commit 729c617

Please sign in to comment.