Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Support urls as ADD sources #91

Merged
merged 26 commits into from
Apr 22, 2016
Merged

Support urls as ADD sources #91

merged 26 commits into from
Apr 22, 2016

Conversation

diunko
Copy link
Contributor

@diunko diunko commented Apr 13, 2016

No description provided.

@@ -259,11 +305,28 @@ func listFiles(srcPath string, includes, excludes []string) ([]*uploadFile, erro
return nil, err
}

// XXX How should we get this guy here?
urlCache = b.urlCache
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ybogdanov @romank87 any ideas, how should we bring this guy here?

@diunko diunko changed the title [WIP] support urls as ADD sources support urls as ADD sources Apr 20, 2016
@diunko
Copy link
Contributor Author

diunko commented Apr 20, 2016

@ybogdanov @romank87 PTAL

return false
}

var httpClient *http.Client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move the fallback to the default http client to the NewURLFetcherFS constructor.

diunko added 2 commits April 21, 2016 11:31
  * add Grammarly copyrights
  * uncomment cleanup defers
  * remove unnecessary comments
  * move httpClient initialization to constructor
  * use golang-style ifs more often
  * use Header.Get to retrieve response etag
  * use os.IsNotExist to detect non-existent file errors
  * add test for not-existent file
  * fail in listFiles if the command is COPY and url is present
  * adapt copy_test to new listFiles signature
@diunko diunko mentioned this pull request Apr 22, 2016
@@ -309,6 +309,10 @@ func listFiles(srcPath string, includes, excludes []string, urlFetcher URLFetche
for _, pattern := range includes {

if isURL(pattern) {
if cmdName == "COPY" {
return nil, fmt.Errorf("can't list downloaded url in COPY command: '%s'", pattern)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't use url in COPY command

@diunko diunko merged commit 35c0980 into dev Apr 22, 2016
@diunko diunko deleted the f-urls-in-add-command branch May 16, 2016 09:53
@ybogdanov ybogdanov changed the title support urls as ADD sources Support urls as ADD sources Jul 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants