
    _                        S 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Jr  SSKJr  SSKJr  SSKJr  SSKr\R2                  " SS9r\R7                  SSSSS9  \R7                  SSSSS9  \R8                  " \5        \R7                  SSSS9  \R7                  SSSS9  SrS r\S:X  a"  \R@                  " 5          \" 5         SSS5        gg! , (       d  f       g= f) zmThis package pulls images from a Docker Registry.

Unlike docker_puller the format this uses is proprietary.
    N)docker_creds)docker_name)docker_image)docker_http)docker_image_list)save)	v2_compat)logging_setup)patched)platform_args)retry)transport_poolz-Pull images from a Docker Registry, faaaaast.)descriptionz--namestorezaThe name of the docker image to pull and save. Supports fully-qualified tag or digest references.T)actionhelprequiredz--directoryz Where to save the image's files.z--client-config-dirzrThe path to the directory where the client configuration files are located. Overiddes the value from DOCKER_CONFIG)r   r   z--cachezImage's files cache directory.   c            	         [         R                  " [        5        [        R                  5       n [         R                  " U S9  [
        R                  " 5       nUR                  [        R                  5      n[        R                  " UR                  [        S9nSU R                  ;   a!  [        R                  " U R                  5      nO [        R                   " U R                  5      nU R"                  b)  [$        R&                  R)                  U R"                  5        [*        R,                  n [$        R&                  R/                  U5      n [2        R:                  " SU5        [<        R>                  " UWU5       nURA                  5       (       ai  [B        RD                  " U 5      nURG                  U5       n	[H        RJ                  " U	U RL                  [        U RN                  S9   S S S 5        S S S 5        g S S S 5        [2        R:                  " SU5        [P        R>                  " X5X$5       n
U
RA                  5       (       a9  [H        RJ                  " U
U RL                  [        U RN                  S9   S S S 5        g  S S S 5        [2        R:                  " S	U5        [R        R>                  " X5U5       n[T        RV                  " U5       n
[H        RJ                  " U
U RL                  [        U RN                  S9   S S S 5        S S S 5        g ! [0         a8  n[2        R4                  " SX65        [6        R8                  " S5         S nAGNS nAff = f! , (       d  f       GNi= f! , (       d  f       GNs= f! , (       d  f       N= f! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f! [0         a7  n[2        R4                  " S
X65        [6        R8                  " S5         S nAg S nAff = f)N)args)size@z&Error resolving credentials for %s: %s   z!Pulling manifest list from %r ...)threadscache_directoryzPulling v2.2 image from %r ...zPulling v2 image from %r ...z%Error pulling and saving image %s: %s),r
   DefineCommandLineArgsparser
parse_argsInitr   FactoryWithSourceTransportCallablehttplib2Httpr   Build_THREADSnamer   DigestTagclient_config_dirr   DefaultKeychainsetCustomConfigDirr   SUPPORTED_MANIFEST_MIMESResolve	Exceptionloggingfatalsysexitinfo
image_listFromRegistryexistsr   FromArgsresolver   fast	directorycache
v2_2_imagev2_imager	   	V22FromV2)r   retry_factory	transportr&   acceptcredseimg_listplatformdefault_childv2_2_imgv2_imgs               7lib/third_party/containerregistry/tools/fast_puller_.pymainrJ   C   s   %%f-				$$--/-;;HMMJ-!!-"5"5HE)DIIdii(D??499%D 
'  33D4J4JK //&((006E%LL4d;		 	 ui	8H			 ))$/h'=
))nn"jj	*
  (	 
9	8	8 LL148		 	 i	@H					NN JJ		(
 	 
A	@	 
A LL/6			tI	6&v&(		NN JJ		(
 	 ' 
7	6= 
 MM:DDHHQKK ('	 
9	8 
A	@ '&& 
7	6	6 
 MM94CHHQKKs   2L /N; =M,>1M/M,7N;  6N; 6AM><N; 6N; <N*1NN*N; 
M-MM
M)	$M,,
M;6N; >
NN; 
N	N*!N; *
N84N; 8N; ;
O<-O77O<__main__)!__doc__argparser/   r1   containerregistry.clientr   r   containerregistry.client.v2r   r=   containerregistry.client.v2_2r   r<   r   r4   r   r	   containerregistry.toolsr
   r   r   containerregistry.transportr   r   r"   ArgumentParserr   add_argumentAddArgumentsr%   rJ   __name__Httplib2     rI   <module>rZ      s!  
   
 1 0 @ 5 D I . 3 1 + 1 - 6  
	 	 ?
A   ?     '(K     6 "   
6  7
   g$E  G JZ zF  s   %C77
D