Skip to content

Commit

Permalink
feat(helmTool): update comments
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Marshall <[email protected]>
  • Loading branch information
alexhq committed Jul 26, 2023
1 parent 9232047 commit 914a24a
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/helmTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import * as util from 'util'
import { ChartTable, Edition, HelmRepository } from './edition-type'
import { getLogger } from './logging'
import { Store } from './store'
import { response } from 'express'
import * as yaml from 'js-yaml'
import { HelmChart } from './store/model/model-types'

const logger = getLogger({
name: 'helmTool',
Expand Down Expand Up @@ -185,21 +183,9 @@ export class HelmTool {
}
}

// // for each repo that is in the database, for each get the index yaml, and parse that into chart table
// async syncDbCharts() {
// // Get list of helm repos from the database
// const dbRepos = await this.store.helmrepository.list()
// // For each helm in the database get the index.yaml
// for (const repo of dbRepos) {
// // Get the index.yaml file
// const repoindex = await this.getIndexYaml(repo)
// console.log('syncDBcharts', repoindex)
// }
// }

// Take a helm repository and chart name.
// Get the helm repository index.yaml
// Populate the database with the helm chart information from the index.yaml
// For the given helm repository, get the index.yaml
// file and populate the database with the helm charts,
// or update the helm charts if they already exist
async syncDbCharts(repo: HelmRepository) {
// Get the index.yaml file
const repoindex = await this.getIndexYaml(repo)
Expand Down Expand Up @@ -264,6 +250,8 @@ export class HelmTool {
}
}

// For each helm repository that is in the edition,
// check if it is in the database. If it is, update it, if not add it
async syncDbRepositories() {
// Get list of helm repos from the edition
const editionRepos = this.helmRepos
Expand Down Expand Up @@ -304,10 +292,11 @@ export class HelmTool {
})
}

// For each helm repository that is in the database, run syncDbCharts
async updateDbHelmCharts() {
// Get list of helm repos from the database
// Get list of helm repositories from the database
const dbRepos = await this.store.helmrepository.list()
// for each helm repo in the database, run syncDbHelmChart
// Run syncDbHelmChart for each repository
for (const repo of dbRepos) {
await this.syncDbCharts(repo)
}
Expand Down

0 comments on commit 914a24a

Please sign in to comment.