
    6
                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ej                   G d dej                               Zy	)
z&Check autopilot compatibility command.    )absolute_import)division)unicode_literals)base)logc                   6    e Zd ZdZdddZed        Zd Zd Zy)	CheckAutopilotCompatibilityz3Check autopilot compatibility of a running cluster.a  {description}

For clusters with GKE version 1.31.6-gke.1027000 or later, you must enable the control plane component that performs the check by running the `gcloud container clusters update` command with the [`--enable-autopilot-compatiblity-auditing`](https://cloud.google.com/sdk/gcloud/reference/container/clusters/update#--%5Bno-%5Denable-autopilot-compatibility-auditing)  flag.zz          To check autopilot compatibility of an existing cluster, run:

            $ {command} sample-cluster
          )DESCRIPTIONEXAMPLESc                 *    | j                  dd       y )NnamezThe name of this cluster.)help)add_argument)parsers    ?lib/surface/container/clusters/check_autopilot_compatibility.pyArgsz CheckAutopilotCompatibility.Args.   s    
%@A    c                    | j                   d   }| j                   d   } ||      }d }|j                  |j                  |j                  |            }t	        |j
                  |      |_        |j                  | _        |j
                  S )zThis 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.
    api_adapterlocation_getc                 2    | j                   | j                  fS )N)incompatibilityTypeconstraintType)issues    r   sort_keyz1CheckAutopilotCompatibility.Run.<locals>.sort_key@   s    '')=)=>>r   )key)contextr	   ParseClusterr   sortedissuessummary_summary)selfargsadapterr   locationr   resps          r   RunzCheckAutopilotCompatibility.Run2   s|     ll=)G<</LD!H? ..TYY13D(3DKLLDM;;r   c                 v    | j                   r-t        j                  j                  d| j                   z          y y )Nz

Summary:
)r"   r   outPrint)r#   results_were_displayeds     r   Epilogz"CheckAutopilotCompatibility.EpilogJ   s'    }}	ggmmNT]]23 r   N)	__name__
__module____qualname____doc__detailed_helpstaticmethodr   r(   r-    r   r   r	   r	      s6    ;-" B B04r   r	   N)r1   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.corer   UniverseCompatibleListCommandr	   r4   r   r   <module>r:      s@    - &  ' ( # 24$"2"2 24 24r   