
                            S r SSKJr  SSKJr  SSKrSSKrSSKJr  SSKJr  SSK	J
r
  SSK	Jr  SS	K	Jr  SS
KJr  SSKJr  SSKJr  SSKr\R(                  " SS9r\R-                  SSSSS9  \R-                  SSSSS9  \R-                  SSSSS9  SrS r\S:X  a"  \R4                  " 5          \" 5         SSS5        gg! , (       d  f       g= f)z@This package appends a tarball to an image in a Docker Registry.    )absolute_import)print_functionN)docker_creds)docker_name)append)docker_image)docker_session)logging_setup)patched)transport_poolz1Append tarballs to an image in a Docker Registry.)descriptionz--src-imagestorez*The name of the docker image to append to.T)actionhelprequiredz	--tarballzThe tarball to append.z--dst-imagezThe name of the new image.   c                  0   [         R                  " [        5        [        R                  5       n [         R                  " U S9  [
        R                  " [        R                  [        S9n[        R                  " U R                  5      n[        R                  " U R                  5      n[        R                  R                  U5      n[         R"                  " SU5        [$        R&                  " X$U5       n[)        U R*                  S5       n[,        R.                  " XVR1                  5       5      nS S S 5        S S S 5        [        R                  R                  U5      n[2        R4                  " X4U[        UR7                  5       /S9 n[         R"                  " S5        UR9                  W5        UR;                  5       n	[=        SR?                  X9S95        S S S 5        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       g = f)	N)args)sizezPulling v2.2 image from %r ...rb)threadsmountzStarting upload ...z*{name} was published with digest: {digest})namedigest) r
   DefineCommandLineArgsparser
parse_argsInitr   Httphttplib2_THREADSr   Tag	src_image	dst_imager   DefaultKeychainResolvelogginginfo
v2_2_imageFromRegistryopentarballr   Layerreadr	   Pushas_repositoryuploadr   printformat)
r   	transportsrcdstcredsr#   fnew_imgsessionr   s
             ;lib/third_party/containerregistry/tools/docker_appender_.pymainr<   4   sw   %%f-				$$!!(--h?)
 	'#'# 
&
&
.
.s
3%	,,/5s95	dllD	!QY1g 
" 6 
&
&
.
.s
3%3y("%"3"3"5!68;BLL&'NN7^^F	7>> ? ! #8 8	 
"	! 65
8 8s1   7G6%G%3G6AH%
G3	/G66
H
H__main__)__doc__
__future__r   r   argparser'   containerregistry.clientr   r   containerregistry.client.v2_2r   r   r)   r	   containerregistry.toolsr
   r   containerregistry.transportr   r    ArgumentParserr   add_argumentr!   r<   __name__Httplib2     r;   <module>rK      s    G & %   1 0 0 D 8 1 + 6 		 	 C
E   	5	     K6N!  #   '(D   #@ zF  s   -B??
C