
                         n    S 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\R                  5      rg	)
zList images command.    )docker_image)util)base)log)
propertiesc                   P   ^  \ rS rSrSrSSS.r\S 5       rS rS
U 4S jjr	S	r
U =r$ )List   zList existing images.z          The container images list command of gcloud lists metadata about
          existing container images in a specified repository. Repositories
          must be hosted by the Google Container Registry.
      a8            List the images in a specified repository:

            $ {command} --repository=gcr.io/myproject

          List the images in the default repository:

            $ {command}

          List images with names prefixed with 'test-project':

            $ {command} --filter="name:test-project"

      )DESCRIPTIONEXAMPLESc                 \    U R                  SSSS9  U R                  R                  S5        g)zRegister flags for this command.

Args:
  parser: An argparse.ArgumentParser-like object. It is mocked out in order
    to capture some information, but behaves like an ArgumentParser.
z--repositoryFznThe name of the repository. Format: *.gcr.io/repository. Defaults to gcr.io/<project>, for the active project.)requiredhelpztable(name)N)add_argumentdisplay_info	AddFormat)parsers    $lib/surface/container/images/list.pyArgs	List.Args4   s:     F  H
 !!-0    c           	        ^	 UR                   nSU l        U(       d  [        R                  R                  R
                  R                  SS9nUR                  SSS5      nSR                  U5      nSR                  U5      U l        U =R                  S	-  sl        [        R                  " U5      m	U	4S
 jn[        R                  " 5       n[        R                  " T	5         [        R                  " [        R                  " 5       T	US9 nUR!                  5        Vs/ s H  nSU" U5      0PM     nnUsSSS5        sSSS5        $ s  snf ! , (       d  f       O= f SSS5        g! , (       d  f       g= f)a  This is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Some value that we want to have printed later.

Raises:
  exceptions.Error: If the repository could not be found, or access was
  denied.
  docker_http.V2DiagnosticException: Any other error occurred while
  accessing GCR.
NT)r   :/   z
gcr.io/{0}zOnly listing images in {0}. z6Use --repository to list images in other repositories.c                 (   > SR                  TU 5      $ )z!Display the fully-qualified name.z{0}/{1})format)c
repositorys    r   _DisplayNameList.Run.<locals>._DisplayName`   s    j!,,r   )basic_credsname	transportr#   )r   _epilogr   VALUEScoreprojectGetreplacer   r   ValidateRepositoryPathHttpWrapExpectedDockerlessErrorsr   FromRegistryCredentialProviderchildren)
selfargsrepository_arg
project_idr    http_objrr   imagesr   s
            @r   RunList.RunC   s3     __NDL$$))1155t5Dj%%c32j#**:6n3::>Jdl
llNNl ,,^<J- yy{H		*	*:	6$$--/ "#56ZZ\B\6<?+\B  
7	6
 C	   
7	6	6s6   #*E*E E
4E7	E*
E
E	E**
E8c                    > [         [        U ]  U5        U R                  (       a*  [        R
                  R                  U R                  5        g g )N)superr	   Epilogr%   r   statusPrint)r1   resources_were_displayed	__class__s     r   r<   List.Epilogm   s5    	$56||	jjt||$ r   )r%   )T)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r8   r<   __static_attributes____classcell__)r@   s   @r   r	   r	      s;    

-0 1 1(T% %r   r	   N)rF   containerregistry.client.v2_2r   'googlecloudsdk.api_lib.container.imagesr   googlecloudsdk.callioper   googlecloudsdk.corer   r   ListCommandr	    r   r   <module>rQ      s/     7 8 ( # *X%4 X%r   