Skip to content

Commit d8cd657

Browse files
DCL Teamcopybara-github
DCL Team
authored andcommitted
Automated DCL import.
- f6148ff1d4427427e6b630030dd736249be5bd1e Automatic import from cloud_mmv2_dcl_20241114_0931_RC00 by DCL Team <[email protected]> GitOrigin-RevId: f6148ff1d4427427e6b630030dd736249be5bd1e
1 parent d3b7800 commit d8cd657

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+8127
-1758
lines changed

python/proto/clouddeploy/alpha/delivery_pipeline.proto

+6
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ message ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntim
9191
string route_update_wait_time = 4;
9292
string stable_cutback_duration = 5;
9393
string pod_selector_label = 6;
94+
ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations route_destinations = 7;
95+
}
96+
97+
message ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
98+
repeated string destination_ids = 1;
99+
bool propagate_service = 2;
94100
}
95101

96102
message ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesServiceNetworking {

python/proto/clouddeploy/alpha/target.proto

+16
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ message ClouddeployAlphaTarget {
4949
ClouddeployAlphaTargetMultiTarget multi_target = 17;
5050
map<string, string> deploy_parameters = 18;
5151
ClouddeployAlphaTargetCustomTarget custom_target = 19;
52+
map<string, ClouddeployAlphaTargetAssociatedEntities> associated_entities = 20;
5253
}
5354

5455
message ClouddeployAlphaTargetGke {
@@ -82,6 +83,21 @@ message ClouddeployAlphaTargetCustomTarget {
8283
string custom_target_type = 1;
8384
}
8485

86+
message ClouddeployAlphaTargetAssociatedEntities {
87+
repeated ClouddeployAlphaTargetAssociatedEntitiesGkeClusters gke_clusters = 1;
88+
repeated ClouddeployAlphaTargetAssociatedEntitiesAnthosClusters anthos_clusters = 2;
89+
}
90+
91+
message ClouddeployAlphaTargetAssociatedEntitiesGkeClusters {
92+
string cluster = 1;
93+
bool internal_ip = 2;
94+
string proxy_url = 3;
95+
}
96+
97+
message ClouddeployAlphaTargetAssociatedEntitiesAnthosClusters {
98+
string membership = 1;
99+
}
100+
85101
message ApplyClouddeployAlphaTargetRequest {
86102
ClouddeployAlphaTarget resource = 1;
87103
repeated LifecycleDirective lifecycle_directives = 2;

python/proto/clouddeploy/beta/delivery_pipeline.proto

+6
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ message ClouddeployBetaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntime
9191
string route_update_wait_time = 4;
9292
string stable_cutback_duration = 5;
9393
string pod_selector_label = 6;
94+
ClouddeployBetaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations route_destinations = 7;
95+
}
96+
97+
message ClouddeployBetaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
98+
repeated string destination_ids = 1;
99+
bool propagate_service = 2;
94100
}
95101

96102
message ClouddeployBetaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesServiceNetworking {

python/proto/clouddeploy/beta/target.proto

+16
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ message ClouddeployBetaTarget {
4949
ClouddeployBetaTargetMultiTarget multi_target = 17;
5050
map<string, string> deploy_parameters = 18;
5151
ClouddeployBetaTargetCustomTarget custom_target = 19;
52+
map<string, ClouddeployBetaTargetAssociatedEntities> associated_entities = 20;
5253
}
5354

5455
message ClouddeployBetaTargetGke {
@@ -82,6 +83,21 @@ message ClouddeployBetaTargetCustomTarget {
8283
string custom_target_type = 1;
8384
}
8485

86+
message ClouddeployBetaTargetAssociatedEntities {
87+
repeated ClouddeployBetaTargetAssociatedEntitiesGkeClusters gke_clusters = 1;
88+
repeated ClouddeployBetaTargetAssociatedEntitiesAnthosClusters anthos_clusters = 2;
89+
}
90+
91+
message ClouddeployBetaTargetAssociatedEntitiesGkeClusters {
92+
string cluster = 1;
93+
bool internal_ip = 2;
94+
string proxy_url = 3;
95+
}
96+
97+
message ClouddeployBetaTargetAssociatedEntitiesAnthosClusters {
98+
string membership = 1;
99+
}
100+
85101
message ApplyClouddeployBetaTargetRequest {
86102
ClouddeployBetaTarget resource = 1;
87103
repeated LifecycleDirective lifecycle_directives = 2;

python/proto/clouddeploy/delivery_pipeline.proto

+6
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ message ClouddeployDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConf
9191
string route_update_wait_time = 4;
9292
string stable_cutback_duration = 5;
9393
string pod_selector_label = 6;
94+
ClouddeployDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations route_destinations = 7;
95+
}
96+
97+
message ClouddeployDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
98+
repeated string destination_ids = 1;
99+
bool propagate_service = 2;
94100
}
95101

96102
message ClouddeployDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesServiceNetworking {

python/proto/clouddeploy/target.proto

+16
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ message ClouddeployTarget {
4949
ClouddeployTargetMultiTarget multi_target = 17;
5050
map<string, string> deploy_parameters = 18;
5151
ClouddeployTargetCustomTarget custom_target = 19;
52+
map<string, ClouddeployTargetAssociatedEntities> associated_entities = 20;
5253
}
5354

5455
message ClouddeployTargetGke {
@@ -82,6 +83,21 @@ message ClouddeployTargetCustomTarget {
8283
string custom_target_type = 1;
8384
}
8485

86+
message ClouddeployTargetAssociatedEntities {
87+
repeated ClouddeployTargetAssociatedEntitiesGkeClusters gke_clusters = 1;
88+
repeated ClouddeployTargetAssociatedEntitiesAnthosClusters anthos_clusters = 2;
89+
}
90+
91+
message ClouddeployTargetAssociatedEntitiesGkeClusters {
92+
string cluster = 1;
93+
bool internal_ip = 2;
94+
string proxy_url = 3;
95+
}
96+
97+
message ClouddeployTargetAssociatedEntitiesAnthosClusters {
98+
string membership = 1;
99+
}
100+
85101
message ApplyClouddeployTargetRequest {
86102
ClouddeployTarget resource = 1;
87103
repeated LifecycleDirective lifecycle_directives = 2;

python/services/clouddeploy/alpha/delivery_pipeline.py

+72
Original file line numberDiff line numberDiff line change
@@ -767,13 +767,15 @@ def __init__(
767767
route_update_wait_time: str = None,
768768
stable_cutback_duration: str = None,
769769
pod_selector_label: str = None,
770+
route_destinations: dict = None,
770771
):
771772
self.http_route = http_route
772773
self.service = service
773774
self.deployment = deployment
774775
self.route_update_wait_time = route_update_wait_time
775776
self.stable_cutback_duration = stable_cutback_duration
776777
self.pod_selector_label = pod_selector_label
778+
self.route_destinations = route_destinations
777779

778780
@classmethod
779781
def to_proto(self, resource):
@@ -799,6 +801,16 @@ def to_proto(self, resource):
799801
)
800802
if Primitive.to_proto(resource.pod_selector_label):
801803
res.pod_selector_label = Primitive.to_proto(resource.pod_selector_label)
804+
if DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.to_proto(
805+
resource.route_destinations
806+
):
807+
res.route_destinations.CopyFrom(
808+
DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.to_proto(
809+
resource.route_destinations
810+
)
811+
)
812+
else:
813+
res.ClearField("route_destinations")
802814
return res
803815

804816
@classmethod
@@ -817,6 +829,9 @@ def from_proto(self, resource):
817829
resource.stable_cutback_duration
818830
),
819831
pod_selector_label=Primitive.from_proto(resource.pod_selector_label),
832+
route_destinations=DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.from_proto(
833+
resource.route_destinations
834+
),
820835
)
821836

822837

@@ -844,6 +859,63 @@ def from_proto(self, resources):
844859
]
845860

846861

862+
class DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations(
863+
object
864+
):
865+
866+
def __init__(self, destination_ids: list = None, propagate_service: bool = None):
867+
self.destination_ids = destination_ids
868+
self.propagate_service = propagate_service
869+
870+
@classmethod
871+
def to_proto(self, resource):
872+
if not resource:
873+
return None
874+
875+
res = (
876+
delivery_pipeline_pb2.ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations()
877+
)
878+
if Primitive.to_proto(resource.destination_ids):
879+
res.destination_ids.extend(Primitive.to_proto(resource.destination_ids))
880+
if Primitive.to_proto(resource.propagate_service):
881+
res.propagate_service = Primitive.to_proto(resource.propagate_service)
882+
return res
883+
884+
@classmethod
885+
def from_proto(self, resource):
886+
if not resource:
887+
return None
888+
889+
return DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations(
890+
destination_ids=Primitive.from_proto(resource.destination_ids),
891+
propagate_service=Primitive.from_proto(resource.propagate_service),
892+
)
893+
894+
895+
class DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinationsArray(
896+
object
897+
):
898+
@classmethod
899+
def to_proto(self, resources):
900+
if not resources:
901+
return resources
902+
return [
903+
DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.to_proto(
904+
i
905+
)
906+
for i in resources
907+
]
908+
909+
@classmethod
910+
def from_proto(self, resources):
911+
return [
912+
DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations.from_proto(
913+
i
914+
)
915+
for i in resources
916+
]
917+
918+
847919
class DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesServiceNetworking(
848920
object
849921
):

python/services/clouddeploy/alpha/delivery_pipeline_server.go

+31
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,21 @@ func ProtoToClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRu
152152
RouteUpdateWaitTime: dcl.StringOrNil(p.GetRouteUpdateWaitTime()),
153153
StableCutbackDuration: dcl.StringOrNil(p.GetStableCutbackDuration()),
154154
PodSelectorLabel: dcl.StringOrNil(p.GetPodSelectorLabel()),
155+
RouteDestinations: ProtoToClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations(p.GetRouteDestinations()),
156+
}
157+
return obj
158+
}
159+
160+
// ProtoToDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations converts a DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations object from its proto representation.
161+
func ProtoToClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations(p *alphapb.ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations) *alpha.DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
162+
if p == nil {
163+
return nil
164+
}
165+
obj := &alpha.DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations{
166+
PropagateService: dcl.Bool(p.GetPropagateService()),
167+
}
168+
for _, r := range p.GetDestinationIds() {
169+
obj.DestinationIds = append(obj.DestinationIds, r)
155170
}
156171
return obj
157172
}
@@ -495,6 +510,22 @@ func ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeCo
495510
p.SetRouteUpdateWaitTime(dcl.ValueOrEmptyString(o.RouteUpdateWaitTime))
496511
p.SetStableCutbackDuration(dcl.ValueOrEmptyString(o.StableCutbackDuration))
497512
p.SetPodSelectorLabel(dcl.ValueOrEmptyString(o.PodSelectorLabel))
513+
p.SetRouteDestinations(ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinationsToProto(o.RouteDestinations))
514+
return p
515+
}
516+
517+
// DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinationsToProto converts a DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations object to its proto representation.
518+
func ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinationsToProto(o *alpha.DeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations) *alphapb.ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations {
519+
if o == nil {
520+
return nil
521+
}
522+
p := &alphapb.ClouddeployAlphaDeliveryPipelineSerialPipelineStagesStrategyCanaryRuntimeConfigKubernetesGatewayServiceMeshRouteDestinations{}
523+
p.SetPropagateService(dcl.ValueOrEmptyBool(o.PropagateService))
524+
sDestinationIds := make([]string, len(o.DestinationIds))
525+
for i, r := range o.DestinationIds {
526+
sDestinationIds[i] = r
527+
}
528+
p.SetDestinationIds(sDestinationIds)
498529
return p
499530
}
500531

0 commit comments

Comments
 (0)