parent
3215eaf710
commit
bf9f36b2bb
|
|
@ -972,9 +972,9 @@ func (st *HelmState) PrepareCharts(helm helmexec.Interface, dir string, concurre
|
||||||
}
|
}
|
||||||
|
|
||||||
var builds []*chartPrepareResult
|
var builds []*chartPrepareResult
|
||||||
pullChan := make(chan *PullCommand)
|
pullChan := make(chan PullCommand)
|
||||||
defer func() {
|
defer func() {
|
||||||
pullChan <- nil
|
close(pullChan)
|
||||||
}()
|
}()
|
||||||
go st.pullChartWorker(pullChan, helm)
|
go st.pullChartWorker(pullChan, helm)
|
||||||
|
|
||||||
|
|
@ -3020,7 +3020,7 @@ func (st *HelmState) Reverse() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (st *HelmState) getOCIChart(pullChan chan *PullCommand, release *ReleaseSpec, tempDir string, helm helmexec.Interface) (*string, error) {
|
func (st *HelmState) getOCIChart(pullChan chan PullCommand, release *ReleaseSpec, tempDir string, helm helmexec.Interface) (*string, error) {
|
||||||
repo, name := st.GetRepositoryAndNameFromChartName(release.Chart)
|
repo, name := st.GetRepositoryAndNameFromChartName(release.Chart)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|
@ -3070,22 +3070,17 @@ func (st *HelmState) getOCIChart(pullChan chan *PullCommand, release *ReleaseSpe
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pull charts one by one to prevent concurrent pull problems with Helm
|
// Pull charts one by one to prevent concurrent pull problems with Helm
|
||||||
func (st *HelmState) pullChartWorker(pullChan chan *PullCommand, helm helmexec.Interface) {
|
func (st *HelmState) pullChartWorker(pullChan chan PullCommand, helm helmexec.Interface) {
|
||||||
for {
|
for pullCmd := range pullChan {
|
||||||
pullCmd := <-pullChan
|
err := helm.ChartPull(pullCmd.ChartRef)
|
||||||
if pullCmd != nil {
|
pullCmd.responseChan <- err
|
||||||
err := helm.ChartPull(pullCmd.ChartRef)
|
|
||||||
pullCmd.responseChan <- err
|
|
||||||
} else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send a pull command to the pull worker
|
// Send a pull command to the pull worker
|
||||||
func (st *HelmState) pullChart(pullChan chan *PullCommand, chartRef string) error {
|
func (st *HelmState) pullChart(pullChan chan PullCommand, chartRef string) error {
|
||||||
response := make(chan error, 1)
|
response := make(chan error, 1)
|
||||||
cmd := &PullCommand{
|
cmd := PullCommand{
|
||||||
responseChan: response,
|
responseChan: response,
|
||||||
ChartRef: chartRef,
|
ChartRef: chartRef,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue