
                            S r SSKJr  SSKJr  SSK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Jr  SSKrSSKJr  \R0                  " SS9r\R5                  SSSSS9  \R5                  SSSS9  \R5                  SSSS9  \R5                  SSSSS9  \R5                  SS S!S9  \R5                  S"S S#S9  \R5                  S$S SS%S9  \R5                  S&S'S(S9  \R5                  S)SS*S9  S+rS, rS- r\S.:X  a"  \R>                  " 5          \" 5         SSS5        gg! , (       d  f       g= f)/zThis package pushes images to a Docker Registry.

The format this tool *expects* to deal with is (unlike docker_pusher)
proprietary, however, unlike {fast,docker}_puller the signature of this tool is
compatible with docker_pusher.
    )absolute_import)print_functionN)docker_creds)docker_name)docker_image)docker_session)
oci_compat)logging_setup)patched)retry)transport_pool)zipz,Push images to a Docker Registry, faaaaaast.)descriptionz--namestorez%The name of the docker image to push.T)actionhelprequiredz	--tarballz&An optional legacy base image tarball.)r   r   z--configz.The path to the file storing the image config.z
--manifestFz0The path to the file storing the image manifest.)r   r   r   z--digestappendz,The list of layer digest filenames in order.z--layerz%The list of layer filenames in order.z--stamp-info-filezbA list of files from which to read substitutions to make in the provided --name, e.g. {BUILD_USER}z--oci
store_truez$Push the image with an OCI Manifest.z--client-config-dirzrThe path to the directory where the client configuration files are located. Overiddes the value from DOCKER_CONFIG   c           
         0 nU=(       d    /  Hb  n[        U5       nU HE  nUR                  S5      nUR                  SS5      u  pgXb;   a  [        SU< SU< S35        XrU'   MG     SSS5        Md     U R                  " S
0 UD6nU(       a  [        SR	                  XS	95        [
        R                  " U5      $ ! , (       d  f       M  = f)z/Perform substitutions in the provided tag name.
    z"WARNING: Duplicate value for key "z
": using ""Nz{name} was resolved to {fname})namefname )openstripsplitprintformatr   Tag)	r   filesformat_argsinfofileinfolinekeyvalueformatted_names	            7lib/third_party/containerregistry/tools/fast_pusher_.pyr$   r$   [   s    ++2+h	h4$zz$ZZQ'

!$e- / C  
  ;;--.
	+22 3 ) + 
	(( 
s   AB;;
C
	c            
      
   [         R                  " [        5        [        R                  5       n [         R                  " U S9  [        U R                  U R                  5      nU R                  (       dN  U R                  (       d  U R                  (       a,  [        R                  " S5        [        R                  " S5        U R                  (       d=  U R                  (       d,  [        R                  " S5        [        R                  " S5        U R                  nU R                   nU R                  (       aQ  [        R"                  " SU R                  5        [%        U R                  S5       nUR'                  5       nS S S 5        OkU R                  (       aZ  [        R"                  " SU R                  5        [(        R*                  " U R                  5       nUR-                  5       nS S S 5        U R                   (       a/  [%        U R                   S5       nUR'                  5       nS S S 5        [/        U R                  =(       d    / 5      [/        U R                  =(       d    / 5      :w  a,  [        R                  " S5        [        R                  " S5        U R0                  b)  [2        R4                  R7                  U R0                  5        [8        R:                  " 5       nUR=                  [>        R@                  5      n[B        R@                  " URD                  [F        S	9n[        R"                  " S
5        [(        RH                  " U[K        [M        U R                  =(       d    / U R                  =(       d    / 5      5      U R                  US9 n [2        R4                  RO                  U5      n	 [R        RT                  " UW	U[F        S9 n[        R"                  " S5        U RV                  (       aA  [X        RZ                  " U5       nUR]                  U5        UR                  5       nS S S 5        O!UR]                  U5        UR                  5       n[_        SRa                  UWS95        S S S 5        S S S 5        g ! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! [P         a8  n
[        R                  " SX5        [        R                  " S5         S n
A
GNCS n
A
ff = f! , (       d  f       N= f! , (       d  f       N= f! [P         a7  n
[        R                  " SX5        [        R                  " S5         S n
A
NS n
A
ff = f! , (       d  f       g = f)N)argsz<Using --layer or --digest requires --config to be specified.r   z/Either --config or --tarball must be specified.zReading config from %rrzReading config from tarball %rz0--digest and --layer must have matching lengths.)sizez Loading v2.2 image from disk ...)legacy_baseforeign_layers_manifestz&Error resolving credentials for %s: %s)threadszStarting upload ...z*{name} was published with digest: {digest})r   digestzError publishing %s: %s)1r
   DefineCommandLineArgsparser
parse_argsInitr$   r   stamp_info_fileconfiglayerr5   loggingfatalsysexittarballmanifestr(   r   read
v2_2_imageFromTarballconfig_filelenclient_config_dirr   DefaultKeychainsetCustomConfigDirr   FactoryWithSourceTransportCallablehttplib2Httpr   Build_THREADSFromDisklistr   Resolve	Exceptionr   Pushocir	   
OCIFromV22uploadr"   r#   )r/   r   r;   rB   readerbaseretry_factory	transportv2_2_imgcredsesessionoci_imgr5   s                 r-   mainrb   q   s   %%f-				$$
 
TYY,,	-$	$**MMFHHHQK	T\\MMCDHHQK ;;&]](	[[LL)4;;7	dkk3	6{{}f 
 	||LL14<<@				-!f 
. 
]]	dmmS	!Vh 
" 		s4::#344MMDEHHQK 
'  33D4J4JK--/-;;HMMJ-!!-"5"5HE)	,,12
3t{{ b$**"234,,&	( ,4**2248e
y(47>*+88$$X.'NN7#^^%F /. ..
"??$&;BBf C & 	(4( (3 
 	 
.	- 
"	!6  mm<dF	hhqkk /.	4 4  mm-t7	hhqkk;( (s   0RRR1U.S>T*>T"T9AT<T*
R
R.1
S 
T-T :U. TU.
TT
T'	#T*&U.'T**
U+4-U&!U.&U++U..
U<__main__) __doc__
__future__r   r   argparser=   r?   containerregistry.clientr   r   containerregistry.client.v2_2r   rD   r   r	   containerregistry.toolsr
   r   containerregistry.transportr   r   rM   	six.movesr   ArgumentParserr7   add_argumentrP   r$   rb   __name__Httplib2r       r-   <module>rq      s   ' %   
 1 0 D 8 4 1 + - 6   
	 	 >
@   W#J  
   &N  P   	9  ;
   	;	  =   	7  9
   h%L  N   >	  @   L'M  O   
6  7 ),Qh zF  s   &D88
E