
                         6    S r SSKrSSKJr  SrSrS rS rS rg)	z+Helper methods to generate a skaffold file.    N)yamlzcapiVersion: skaffold/v3alpha1
kind: Config
manifests:
  rawYaml:
  - {}
deploy:
  cloudrun: {{}}
  zZapiVersion: skaffold/v2beta28
kind: Config
deploy:
  kubectl:
    manifests:
      - {}
  c                     [        5       nU R                  R                   H'  nUR                   H  nUR	                  U5        M     M)     U$ )z'Gets unique profiles from pipeline_obj.)setserialPipelinestagesprofilesadd)pipeline_objr   stageprofiles       6lib/googlecloudsdk/command_lib/deploy/skaffold_util.py_GetUniqueProfilesr   ,   s@    U(**11e>>ll7 " 2 
/    c                     [        U5      nU(       d  g/ U S'   U H.  nU S   R                  [        R                  " SU4/5      5        M0     g)zIAdds the profiles in the provided pipeline to the skaffold configuration.Nr   name)r   appendcollectionsOrderedDict)skaffoldr
   r   r   s       r   _AddProfilesr   5   sO    -(	
(:gZ 7 7&'9J8K LM r   c                 d    [         R                  " UR                  U5      SS9n[        X05        U$ )aX  Creates skaffold file when a cloud run or GKE manifest is provided to the release create command.

Args:
  pipeline_obj: A Delivery Pipeline object, the profiles in the Delivery
    Pipeline stages will be added to the skaffold file.
  manifest: The name of the manifest file.
  template: The skaffold.yaml template.

Returns:
  skaffold yaml.
T)
round_trip)r   loadformatr   )r
   manifesttemplater   s       r   CreateSkaffoldFileForManifestr   B   s0     YYooh(
 x&	/r   )	__doc__r   googlecloudsdk.corer   %CLOUD_RUN_GENERATED_SKAFFOLD_TEMPLATEGKE_GENERATED_SKAFFOLD_TEMPLATEr   r   r    r   r   <module>r#      s1    2  $) %# 
	r   