Skip to content

Commit

Permalink
fix(artifact)!: default https to any URL missing a scheme. Fixes #6973 (
Browse files Browse the repository at this point in the history
#6985)

Signed-off-by: Tianchu Zhao <evantczhao@gmail.com>
  • Loading branch information
tczhao committed Oct 20, 2021
1 parent 9ca9d2e commit 0446f52
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
Breaking changes typically (sometimes we don't realise they are breaking) have "!" in the commit message, as per
the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary).

## Upgrading to v3.3

### [bd49c630328d30206a5c5b78cbc9a00700a28e7d](https://github.com/argoproj/argo-workflows/commit/bd49c630328d30206a5c5b78cbc9a00700a28e7d) fix(artifact)!: default https to any URL missing a scheme. Fixes #6973

HTTPArtifact without a scheme will now defaults to https instead of http

user need to explicitly include a http prefix if they want to retrieve HTTPArtifact through http

## Upgrading to v3.2

## [e5b131a33](https://github.com/argoproj/argo-workflows/commit/e5b131a33) feat: Add template node to pod name. Fixes #1319 (#6712)
Expand Down
2 changes: 1 addition & 1 deletion workflow/artifacts/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var _ common.ArtifactDriver = &ArtifactDriver{}
// Load download artifacts from an HTTP URL
func (h *ArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error {
// Download the file to a local file path
args := []string{"-fsS", "-L", "--create-dirs", "-o", path, inputArtifact.HTTP.URL}
args := []string{"-fsS", "-L", "--create-dirs", "--proto-default", "https", "-o", path, inputArtifact.HTTP.URL}
headers := inputArtifact.HTTP.Headers
for _, v := range headers {
// Build curl -H string for each key-value header parameter
Expand Down
2 changes: 1 addition & 1 deletion workflow/artifacts/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestHTTPArtifactDriver_Load(t *testing.T) {
assert.NoError(t, err)
}
})
curl := "curl -fsS -L --create-dirs -o /tmp/found-with-request-headers https://github.com/argoproj/argo-workflows -H Accept: application/json -H Authorization: Bearer foo-bar"
curl := "curl -fsS -L --create-dirs --proto-default https -o /tmp/found-with-request-headers https://github.com/argoproj/argo-workflows -H Accept: application/json -H Authorization: Bearer foo-bar"
assert.Regexp(t, regexp.MustCompile(curl), output)
})
t.Run("NotFound", func(t *testing.T) {
Expand Down

0 comments on commit 0446f52

Please sign in to comment.