Skip to content

[19.03 backport] Introduce .zip import for docker context#1912

Merged
thaJeztah merged 1 commit intodocker:19.03from
thaJeztah:19.03_backport_import_zip
May 29, 2019
Merged

[19.03 backport] Introduce .zip import for docker context#1912
thaJeztah merged 1 commit intodocker:19.03from
thaJeztah:19.03_backport_import_zip

Conversation

@thaJeztah
Copy link
Member

backport of #1895 for 19.03

Adds capabilities to import a .zip file with importZip.
Detects the content type of source by checking bytes & DetectContentType.
Adds LimitedReader reader, a fork of io.LimitedReader,
was needed for better error messaging instead of just getting back EOF.
We are using limited reader to avoid very big files causing memory issues.
Adds a new file size limit for context imports,
this limit is used for the main file for .zip & .tar and individual compressed
files for .zip.
Added TestImportZip that will check the import content type
Then will assert no err on Importing .zip file

Signed-off-by: Goksu Toprak goksu.toprak@docker.com
(cherry picked from commit 291e862)
Signed-off-by: Sebastiaan van Stijn github@gone.nl

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Adds capabilities to import a .zip file with importZip.
Detects the content type of source by checking bytes & DetectContentType.
Adds LimitedReader reader, a fork of io.LimitedReader,
was needed for better error messaging instead of just getting back EOF.
We are using limited reader to avoid very big files causing memory issues.
Adds a new file size limit for context imports,
this limit is used for the main file for .zip & .tar and individual compressed
files for .zip.
Added TestImportZip that will check the import content type
Then will assert no err on Importing .zip file

Signed-off-by: Goksu Toprak <goksu.toprak@docker.com>
(cherry picked from commit 291e862)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 19.03.0 milestone May 29, 2019
@thaJeztah
Copy link
Member Author

ping @tiborvass @goksu PTAL

Copy link
Contributor

@goksu goksu left a comment

Choose a reason for hiding this comment

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

Looks good to me, all changes are here as well.

@codecov-io
Copy link

Codecov Report

Merging #1912 into 19.03 will increase coverage by 0.01%.
The diff coverage is 62.79%.

@@            Coverage Diff             @@
##            19.03    #1912      +/-   ##
==========================================
+ Coverage   56.67%   56.69%   +0.01%     
==========================================
  Files         309      310       +1     
  Lines       21707    21778      +71     
==========================================
+ Hits        12303    12346      +43     
- Misses       8505     8519      +14     
- Partials      899      913      +14

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #1912 into 19.03 will increase coverage by 0.01%.
The diff coverage is 62.79%.

@@            Coverage Diff             @@
##            19.03    #1912      +/-   ##
==========================================
+ Coverage   56.67%   56.69%   +0.01%     
==========================================
  Files         309      310       +1     
  Lines       21707    21778      +71     
==========================================
+ Hits        12303    12346      +43     
- Misses       8505     8519      +14     
- Partials      899      913      +14

@thaJeztah
Copy link
Member Author

thanks! merging

@thaJeztah thaJeztah merged commit f913afa into docker:19.03 May 29, 2019
@thaJeztah thaJeztah deleted the 19.03_backport_import_zip branch May 29, 2019 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants