def Adjust(self, resource):
   annotations = k8s_object.AnnotationsFromMetadata(
       resource.MessagesModule(), resource.metadata)
   annotations[configuration.USER_IMAGE_ANNOTATION] = (
       self.image)
   resource.template.image = self.image
   return resource
Example #2
0
 def Adjust(self, resource):
   annotations = k8s_object.AnnotationsFromMetadata(resource.MessagesModule(),
                                                    resource.template.metadata)
   if revision.VPC_ACCESS_ANNOTATION in annotations:
     del annotations[revision.VPC_ACCESS_ANNOTATION]
   if revision.EGRESS_SETTINGS_ANNOTATION in annotations:
     del annotations[revision.EGRESS_SETTINGS_ANNOTATION]
   return resource
Example #3
0
 def Adjust(self, resource):
   if self._launch_stage == base.ReleaseTrack.GA:
     return resource
   else:
     annotations = k8s_object.AnnotationsFromMetadata(
         resource.MessagesModule(), resource.metadata)
     annotations[revision.LAUNCH_STAGE_ANNOTATION] = (self._launch_stage.id)
     return resource
Example #4
0
 def AdjustConfiguration(self, conf, metadata):
     annotations = k8s_object.AnnotationsFromMetadata(
         conf.MessagesModule(), metadata)
     annotations[configuration.USER_IMAGE_ANNOTATION] = (
         self.source_ref.source_path)
     conf.image = self.source_ref.source_path
     # Unset the build if we're deploying an image.
     # TODO(b/112662240): Remove conditional once this field is public
     if hasattr(conf.spec, 'build'):
         conf.spec.build = None
Example #5
0
  def AdjustConfiguration(self, config, metadata):
    if _IsDigest(self._base_revision.image):
      return
    if not self._base_revision.image_digest:
      return

    annotations = k8s_object.AnnotationsFromMetadata(
        config.MessagesModule(), metadata)
    # Mutates through to metadata: Save the by-tag user intent.
    annotations[configuration.USER_IMAGE_ANNOTATION] = self._base_revision.image
    config.image = self._base_revision.image_digest
 def Adjust(self, resource):
   annotations = k8s_object.AnnotationsFromMetadata(resource.MessagesModule(),
                                                    resource.metadata)
   if 'run.googleapis.com/vpc-access-connector' in annotations:
     del annotations['run.googleapis.com/vpc-access-connector']
   return resource
 def Adjust(self, resource):
   annotations = k8s_object.AnnotationsFromMetadata(
       resource.MessagesModule(), resource.template.metadata)
   if self._key in annotations:
     del annotations[self._key]
   return resource
 def Adjust(self, resource):
   annotations = k8s_object.AnnotationsFromMetadata(
       resource.MessagesModule(), resource.template.metadata)
   annotations[self._key] = self._value
   return resource
Example #9
0
 def Adjust(self, resource):
     annotations = k8s_object.AnnotationsFromMetadata(
         resource.MessagesModule(), resource.metadata)
     annotations['run.googleapis.com/vpc-access-connector'] = (
         self._connector_name)
Example #10
0
 def Adjust(self, resource):
   annotations = k8s_object.AnnotationsFromMetadata(resource.MessagesModule(),
                                                    resource.template.metadata)
   annotations[revision.VPC_ACCESS_ANNOTATION] = (
       self._connector_name)
   return resource
 def revision_annotations(self):
     revision_meta = self.spec.revisionTemplate.metadata
     return k8s_object.AnnotationsFromMetadata(self._messages,
                                               revision_meta)
 def Adjust(self, resource):
     annotations = k8s_object.AnnotationsFromMetadata(
         resource.MessagesModule(), resource.metadata)
     annotations[_CLIENT_NAME_ANNOTATION] = 'gcloud'
     annotations[_CLIENT_VERSION_ANNOTATION] = config.CLOUD_SDK_VERSION
     return resource
Example #13
0
 def template_annotations(self):
     self.AssertFullObject()
     return k8s_object.AnnotationsFromMetadata(self._messages,
                                               self.template.metadata)
Example #14
0
 def revision_annotations(self):
     revision_meta = revision_meta = self._EnsureRevisionMeta()
     return k8s_object.AnnotationsFromMetadata(self._messages,
                                               revision_meta)