Skip to content

Commit

Permalink
Automated DCL import.
Browse files Browse the repository at this point in the history
  - f6148ff1d4427427e6b630030dd736249be5bd1e Automatic import from cloud_mmv2_dcl_20241114_0931_RC00 by DCL Team <[email protected]>

GitOrigin-RevId: f6148ff1d4427427e6b630030dd736249be5bd1e
  • Loading branch information
DCL Team authored and copybara-github committed Nov 14, 2024
1 parent d3b7800 commit d8cd657
Show file tree
Hide file tree
Showing 54 changed files with 8,127 additions and 1,758 deletions.
6 changes: 6 additions & 0 deletions python/proto/clouddeploy/alpha/delivery_pipeline.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ message ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntim
string route_update_wait_time = 4;
string stable_cutback_duration = 5;
string pod_selector_label = 6;
ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations route_destinations = 7;
}

message ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
repeated string destination_ids = 1;
bool propagate_service = 2;
}

message ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesServiceNetworking {
Expand Down
16 changes: 16 additions & 0 deletions python/proto/clouddeploy/alpha/target.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ message ClouddeployAlphaTarget {
ClouddeployAlphaTargetMultiTarget multi_target = 17;
map<string, string> deploy_parameters = 18;
ClouddeployAlphaTargetCustomTarget custom_target = 19;
map<string, ClouddeployAlphaTargetAssociatedEntities> associated_entities = 20;
}

message ClouddeployAlphaTargetGke {
Expand Down Expand Up @@ -82,6 +83,21 @@ message ClouddeployAlphaTargetCustomTarget {
string custom_target_type = 1;
}

message ClouddeployAlphaTargetAssociatedEntities {
repeated ClouddeployAlphaTargetAssociatedEntitiesGkeClusters gke_clusters = 1;
repeated ClouddeployAlphaTargetAssociatedEntitiesAnthosClusters anthos_clusters = 2;
}

message ClouddeployAlphaTargetAssociatedEntitiesGkeClusters {
string cluster = 1;
bool internal_ip = 2;
string proxy_url = 3;
}

message ClouddeployAlphaTargetAssociatedEntitiesAnthosClusters {
string membership = 1;
}

message ApplyClouddeployAlphaTargetRequest {
ClouddeployAlphaTarget resource = 1;
repeated LifecycleDirective lifecycle_directives = 2;
Expand Down
6 changes: 6 additions & 0 deletions python/proto/clouddeploy/beta/delivery_pipeline.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ message ClouddeployBetaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntime
string route_update_wait_time = 4;
string stable_cutback_duration = 5;
string pod_selector_label = 6;
ClouddeployBetaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations route_destinations = 7;
}

message ClouddeployBetaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
repeated string destination_ids = 1;
bool propagate_service = 2;
}

message ClouddeployBetaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesServiceNetworking {
Expand Down
16 changes: 16 additions & 0 deletions python/proto/clouddeploy/beta/target.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ message ClouddeployBetaTarget {
ClouddeployBetaTargetMultiTarget multi_target = 17;
map<string, string> deploy_parameters = 18;
ClouddeployBetaTargetCustomTarget custom_target = 19;
map<string, ClouddeployBetaTargetAssociatedEntities> associated_entities = 20;
}

message ClouddeployBetaTargetGke {
Expand Down Expand Up @@ -82,6 +83,21 @@ message ClouddeployBetaTargetCustomTarget {
string custom_target_type = 1;
}

message ClouddeployBetaTargetAssociatedEntities {
repeated ClouddeployBetaTargetAssociatedEntitiesGkeClusters gke_clusters = 1;
repeated ClouddeployBetaTargetAssociatedEntitiesAnthosClusters anthos_clusters = 2;
}

message ClouddeployBetaTargetAssociatedEntitiesGkeClusters {
string cluster = 1;
bool internal_ip = 2;
string proxy_url = 3;
}

message ClouddeployBetaTargetAssociatedEntitiesAnthosClusters {
string membership = 1;
}

message ApplyClouddeployBetaTargetRequest {
ClouddeployBetaTarget resource = 1;
repeated LifecycleDirective lifecycle_directives = 2;
Expand Down
6 changes: 6 additions & 0 deletions python/proto/clouddeploy/delivery_pipeline.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ message ClouddeployDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConf
string route_update_wait_time = 4;
string stable_cutback_duration = 5;
string pod_selector_label = 6;
ClouddeployDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations route_destinations = 7;
}

message ClouddeployDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
repeated string destination_ids = 1;
bool propagate_service = 2;
}

message ClouddeployDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesServiceNetworking {
Expand Down
16 changes: 16 additions & 0 deletions python/proto/clouddeploy/target.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ message ClouddeployTarget {
ClouddeployTargetMultiTarget multi_target = 17;
map<string, string> deploy_parameters = 18;
ClouddeployTargetCustomTarget custom_target = 19;
map<string, ClouddeployTargetAssociatedEntities> associated_entities = 20;
}

message ClouddeployTargetGke {
Expand Down Expand Up @@ -82,6 +83,21 @@ message ClouddeployTargetCustomTarget {
string custom_target_type = 1;
}

message ClouddeployTargetAssociatedEntities {
repeated ClouddeployTargetAssociatedEntitiesGkeClusters gke_clusters = 1;
repeated ClouddeployTargetAssociatedEntitiesAnthosClusters anthos_clusters = 2;
}

message ClouddeployTargetAssociatedEntitiesGkeClusters {
string cluster = 1;
bool internal_ip = 2;
string proxy_url = 3;
}

message ClouddeployTargetAssociatedEntitiesAnthosClusters {
string membership = 1;
}

message ApplyClouddeployTargetRequest {
ClouddeployTarget resource = 1;
repeated LifecycleDirective lifecycle_directives = 2;
Expand Down
72 changes: 72 additions & 0 deletions python/services/clouddeploy/alpha/delivery_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,13 +767,15 @@ def __init__(
route_update_wait_time: str = None,
stable_cutback_duration: str = None,
pod_selector_label: str = None,
route_destinations: dict = None,
):
self.http_route = http_route
self.service = service
self.deployment = deployment
self.route_update_wait_time = route_update_wait_time
self.stable_cutback_duration = stable_cutback_duration
self.pod_selector_label = pod_selector_label
self.route_destinations = route_destinations

@classmethod
def to_proto(self, resource):
Expand All @@ -799,6 +801,16 @@ def to_proto(self, resource):
)
if Primitive.to_proto(resource.pod_selector_label):
res.pod_selector_label = Primitive.to_proto(resource.pod_selector_label)
if DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.to_proto(
resource.route_destinations
):
res.route_destinations.CopyFrom(
DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.to_proto(
resource.route_destinations
)
)
else:
res.ClearField("route_destinations")
return res

@classmethod
Expand All @@ -817,6 +829,9 @@ def from_proto(self, resource):
resource.stable_cutback_duration
),
pod_selector_label=Primitive.from_proto(resource.pod_selector_label),
route_destinations=DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.from_proto(
resource.route_destinations
),
)


Expand Down Expand Up @@ -844,6 +859,63 @@ def from_proto(self, resources):
]


class DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations(
object
):

def __init__(self, destination_ids: list = None, propagate_service: bool = None):
self.destination_ids = destination_ids
self.propagate_service = propagate_service

@classmethod
def to_proto(self, resource):
if not resource:
return None

res = (
delivery_pipeline_pb2.ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations()
)
if Primitive.to_proto(resource.destination_ids):
res.destination_ids.extend(Primitive.to_proto(resource.destination_ids))
if Primitive.to_proto(resource.propagate_service):
res.propagate_service = Primitive.to_proto(resource.propagate_service)
return res

@classmethod
def from_proto(self, resource):
if not resource:
return None

return DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations(
destination_ids=Primitive.from_proto(resource.destination_ids),
propagate_service=Primitive.from_proto(resource.propagate_service),
)


class DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinationsArray(
object
):
@classmethod
def to_proto(self, resources):
if not resources:
return resources
return [
DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.to_proto(
i
)
for i in resources
]

@classmethod
def from_proto(self, resources):
return [
DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.from_proto(
i
)
for i in resources
]


class DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesServiceNetworking(
object
):
Expand Down
31 changes: 31 additions & 0 deletions python/services/clouddeploy/alpha/delivery_pipeline_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ func ProtoToClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRu
RouteUpdateWaitTime: dcl.StringOrNil(p.GetRouteUpdateWaitTime()),
StableCutbackDuration: dcl.StringOrNil(p.GetStableCutbackDuration()),
PodSelectorLabel: dcl.StringOrNil(p.GetPodSelectorLabel()),
RouteDestinations: ProtoToClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations(p.GetRouteDestinations()),
}
return obj
}

// ProtoToDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations converts a DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations object from its proto representation.
func ProtoToClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations(p *alphapb.ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations) *alpha.DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
if p == nil {
return nil
}
obj := &alpha.DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations{
PropagateService: dcl.Bool(p.GetPropagateService()),
}
for _, r := range p.GetDestinationIds() {
obj.DestinationIds = append(obj.DestinationIds, r)
}
return obj
}
Expand Down Expand Up @@ -495,6 +510,22 @@ func ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeCo
p.SetRouteUpdateWaitTime(dcl.ValueOrEmptyString(o.RouteUpdateWaitTime))
p.SetStableCutbackDuration(dcl.ValueOrEmptyString(o.StableCutbackDuration))
p.SetPodSelectorLabel(dcl.ValueOrEmptyString(o.PodSelectorLabel))
p.SetRouteDestinations(ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinationsToProto(o.RouteDestinations))
return p
}

// DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinationsToProto converts a DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations object to its proto representation.
func ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinationsToProto(o *alpha.DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations) *alphapb.ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
if o == nil {
return nil
}
p := &alphapb.ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations{}
p.SetPropagateService(dcl.ValueOrEmptyBool(o.PropagateService))
sDestinationIds := make([]string, len(o.DestinationIds))
for i, r := range o.DestinationIds {
sDestinationIds[i] = r
}
p.SetDestinationIds(sDestinationIds)
return p
}

Expand Down
Loading

0 comments on commit d8cd657

Please sign in to comment.