Skip to content

Commit

Permalink
fix: add http request header timeout to help stalling image push (#2319)
Browse files Browse the repository at this point in the history
## Description

This is a test for fixes to intermittent hanging.

## Related Issue

Relates to #1444

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [X] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
  • Loading branch information
Racer159 committed Feb 23, 2024
1 parent ed8319c commit 51b78e1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/internal/packager/images/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package images
import (
"fmt"
"net/http"
"time"

"github.com/defenseunicorns/zarf/src/config"
"github.com/defenseunicorns/zarf/src/pkg/cluster"
Expand Down Expand Up @@ -50,6 +51,8 @@ func (i *ImageConfig) PushToZarfRegistry() error {

httpTransport := http.DefaultTransport.(*http.Transport).Clone()
httpTransport.TLSClientConfig.InsecureSkipVerify = i.Insecure
// TODO (@WSTARR) This is set to match the TLSHandshakeTimeout to potentially mitigate effects of https://github.com/defenseunicorns/zarf/issues/1444
httpTransport.ResponseHeaderTimeout = 10 * time.Second
progressBar := message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images to the zarf registry", len(i.ImageList)))
defer progressBar.Stop()
craneTransport := utils.NewTransport(httpTransport, progressBar)
Expand Down

0 comments on commit 51b78e1

Please sign in to comment.