Ejemplo n.º 1
0
def MatchClusters(ref, args, req):
    if args.match_clusters:
        req = utils.AddFieldToUpdateMask('cluster_selectors.labels', req)
        if req.scalingPolicy is None:
            req.scalingPolicy = utils.GetApiMessage(ref).ScalingPolicy()
        req.scalingPolicy.clusterSelectors = utils.ParseMatchClusters(
            ref, args.match_clusters)
    return req
Ejemplo n.º 2
0
def MatchClusters(ref, args, req):
  if args.match_clusters or args.clear_match_clusters:
    req = utils.AddFieldToUpdateMask('cluster_selectors', req)
    if req.allocationPolicy is None:
      req.allocationPolicy = utils.GetApiMessage(ref).AllocationPolicy()
    req.allocationPolicy.clusterSelectors = []
  if args.match_clusters:
    req.allocationPolicy.clusterSelectors = utils.ParseMatchClusters(
        ref, args.match_clusters)
  return req
Ejemplo n.º 3
0
def MatchClusters(ref, args, req):
    req.scalingPolicy.clusterSelectors = utils.ParseMatchClusters(
        ref, args.match_clusters)
    return req
Ejemplo n.º 4
0
def MatchClusters(ref, args, req):
    if args.match_clusters:
        req.allocationPolicy.clusterSelectors = utils.ParseMatchClusters(
            ref, args.match_clusters)
    return req