Skip to content

Commit

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

GitOrigin-RevId: 058f275
  • Loading branch information
DCL Team authored and copybara-github committed May 2, 2022
1 parent ef54811 commit 46d3dfd
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 974 deletions.
89 changes: 28 additions & 61 deletions python/proto/run/alpha/job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,16 @@ enum RunAlphaJobTerminalConditionReasonEnum {
RunAlphaJobTerminalConditionReasonEnumROUTE_MISSING = 3;
RunAlphaJobTerminalConditionReasonEnumREVISION_FAILED = 4;
RunAlphaJobTerminalConditionReasonEnumPROGRESS_DEADLINE_EXCEEDED = 5;
RunAlphaJobTerminalConditionReasonEnumBUILD_STEP_FAILED = 6;
RunAlphaJobTerminalConditionReasonEnumCONTAINER_MISSING = 7;
RunAlphaJobTerminalConditionReasonEnumCONTAINER_PERMISSION_DENIED = 8;
RunAlphaJobTerminalConditionReasonEnumCONTAINER_IMAGE_UNAUTHORIZED = 9;
RunAlphaJobTerminalConditionReasonEnumCONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 10;
RunAlphaJobTerminalConditionReasonEnumENCRYPTION_KEY_PERMISSION_DENIED = 11;
RunAlphaJobTerminalConditionReasonEnumENCRYPTION_KEY_CHECK_FAILED = 12;
RunAlphaJobTerminalConditionReasonEnumSECRETS_ACCESS_CHECK_FAILED = 13;
RunAlphaJobTerminalConditionReasonEnumWAITING_FOR_OPERATION = 14;
RunAlphaJobTerminalConditionReasonEnumIMMEDIATE_RETRY = 15;
RunAlphaJobTerminalConditionReasonEnumPOSTPONED_RETRY = 16;
RunAlphaJobTerminalConditionReasonEnumCONTAINER_MISSING = 6;
RunAlphaJobTerminalConditionReasonEnumCONTAINER_PERMISSION_DENIED = 7;
RunAlphaJobTerminalConditionReasonEnumCONTAINER_IMAGE_UNAUTHORIZED = 8;
RunAlphaJobTerminalConditionReasonEnumCONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9;
RunAlphaJobTerminalConditionReasonEnumENCRYPTION_KEY_PERMISSION_DENIED = 10;
RunAlphaJobTerminalConditionReasonEnumENCRYPTION_KEY_CHECK_FAILED = 11;
RunAlphaJobTerminalConditionReasonEnumSECRETS_ACCESS_CHECK_FAILED = 12;
RunAlphaJobTerminalConditionReasonEnumWAITING_FOR_OPERATION = 13;
RunAlphaJobTerminalConditionReasonEnumIMMEDIATE_RETRY = 14;
RunAlphaJobTerminalConditionReasonEnumPOSTPONED_RETRY = 15;
}

enum RunAlphaJobTerminalConditionInternalReasonEnum {
Expand Down Expand Up @@ -151,43 +150,19 @@ enum RunAlphaJobConditionsReasonEnum {
RunAlphaJobConditionsReasonEnumNO_VALUE_DO_NOT_USE = 0;
RunAlphaJobConditionsReasonEnumCOMMON_REASON_UNDEFINED = 1;
RunAlphaJobConditionsReasonEnumUNKNOWN = 2;
RunAlphaJobConditionsReasonEnumROUTE_MISSING = 3;
RunAlphaJobConditionsReasonEnumREVISION_FAILED = 4;
RunAlphaJobConditionsReasonEnumPROGRESS_DEADLINE_EXCEEDED = 5;
RunAlphaJobConditionsReasonEnumBUILD_STEP_FAILED = 6;
RunAlphaJobConditionsReasonEnumCONTAINER_MISSING = 7;
RunAlphaJobConditionsReasonEnumCONTAINER_PERMISSION_DENIED = 8;
RunAlphaJobConditionsReasonEnumCONTAINER_IMAGE_UNAUTHORIZED = 9;
RunAlphaJobConditionsReasonEnumCONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 10;
RunAlphaJobConditionsReasonEnumENCRYPTION_KEY_PERMISSION_DENIED = 11;
RunAlphaJobConditionsReasonEnumENCRYPTION_KEY_CHECK_FAILED = 12;
RunAlphaJobConditionsReasonEnumSECRETS_ACCESS_CHECK_FAILED = 13;
RunAlphaJobConditionsReasonEnumWAITING_FOR_OPERATION = 14;
RunAlphaJobConditionsReasonEnumIMMEDIATE_RETRY = 15;
RunAlphaJobConditionsReasonEnumPOSTPONED_RETRY = 16;
}

enum RunAlphaJobConditionsInternalReasonEnum {
RunAlphaJobConditionsInternalReasonEnumNO_VALUE_DO_NOT_USE = 0;
RunAlphaJobConditionsInternalReasonEnumINTERNAL_REASON_UNDEFINED = 1;
RunAlphaJobConditionsInternalReasonEnumCONFLICTING_REVISION_NAME = 2;
RunAlphaJobConditionsInternalReasonEnumREVISION_MISSING = 3;
RunAlphaJobConditionsInternalReasonEnumCONFIGURATION_MISSING = 4;
RunAlphaJobConditionsInternalReasonEnumASSIGNING_TRAFFIC = 5;
RunAlphaJobConditionsInternalReasonEnumUPDATING_INGRESS_TRAFFIC_ALLOWED = 6;
RunAlphaJobConditionsInternalReasonEnumREVISION_ORG_POLICY_VIOLATION = 7;
RunAlphaJobConditionsInternalReasonEnumENABLING_GCFV2_URI_SUPPORT = 8;
}

enum RunAlphaJobConditionsDomainMappingReasonEnum {
RunAlphaJobConditionsDomainMappingReasonEnumNO_VALUE_DO_NOT_USE = 0;
RunAlphaJobConditionsDomainMappingReasonEnumDOMAIN_MAPPING_REASON_UNDEFINED = 1;
RunAlphaJobConditionsDomainMappingReasonEnumROUTE_NOT_READY = 2;
RunAlphaJobConditionsDomainMappingReasonEnumPERMISSION_DENIED = 3;
RunAlphaJobConditionsDomainMappingReasonEnumCERTIFICATE_ALREADY_EXISTS = 4;
RunAlphaJobConditionsDomainMappingReasonEnumMAPPING_ALREADY_EXISTS = 5;
RunAlphaJobConditionsDomainMappingReasonEnumCERTIFICATE_PENDING = 6;
RunAlphaJobConditionsDomainMappingReasonEnumCERTIFICATE_FAILED = 7;
RunAlphaJobConditionsReasonEnumREVISION_FAILED = 3;
RunAlphaJobConditionsReasonEnumPROGRESS_DEADLINE_EXCEEDED = 4;
RunAlphaJobConditionsReasonEnumBUILD_STEP_FAILED = 5;
RunAlphaJobConditionsReasonEnumCONTAINER_MISSING = 6;
RunAlphaJobConditionsReasonEnumCONTAINER_PERMISSION_DENIED = 7;
RunAlphaJobConditionsReasonEnumCONTAINER_IMAGE_UNAUTHORIZED = 8;
RunAlphaJobConditionsReasonEnumCONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9;
RunAlphaJobConditionsReasonEnumENCRYPTION_KEY_PERMISSION_DENIED = 10;
RunAlphaJobConditionsReasonEnumENCRYPTION_KEY_CHECK_FAILED = 11;
RunAlphaJobConditionsReasonEnumSECRETS_ACCESS_CHECK_FAILED = 12;
RunAlphaJobConditionsReasonEnumWAITING_FOR_OPERATION = 13;
RunAlphaJobConditionsReasonEnumIMMEDIATE_RETRY = 14;
RunAlphaJobConditionsReasonEnumPOSTPONED_RETRY = 15;
}

enum RunAlphaJobConditionsRevisionReasonEnum {
Expand Down Expand Up @@ -237,10 +212,9 @@ message RunAlphaJob {
RunAlphaJobLatestSucceededExecution latest_succeeded_execution = 21;
RunAlphaJobLatestCreatedExecution latest_created_execution = 22;
bool reconciling = 23;
repeated RunAlphaJobContainerStatuses container_statuses = 24;
string etag = 25;
string project = 26;
string location = 27;
string etag = 24;
string project = 25;
string location = 26;
}

message RunAlphaJobBinaryAuthorization {
Expand Down Expand Up @@ -355,10 +329,8 @@ message RunAlphaJobConditions {
string last_transition_time = 4;
RunAlphaJobConditionsSeverityEnum severity = 5;
RunAlphaJobConditionsReasonEnum reason = 6;
RunAlphaJobConditionsInternalReasonEnum internal_reason = 7;
RunAlphaJobConditionsDomainMappingReasonEnum domain_mapping_reason = 8;
RunAlphaJobConditionsRevisionReasonEnum revision_reason = 9;
RunAlphaJobConditionsExecutionReasonEnum execution_reason = 10;
RunAlphaJobConditionsRevisionReasonEnum revision_reason = 7;
RunAlphaJobConditionsExecutionReasonEnum execution_reason = 8;
}

message RunAlphaJobLatestSucceededExecution {
Expand All @@ -371,11 +343,6 @@ message RunAlphaJobLatestCreatedExecution {
string create_time = 2;
}

message RunAlphaJobContainerStatuses {
string name = 1;
string image_digest = 2;
}

message ApplyRunAlphaJobRequest {
RunAlphaJob resource = 1;
repeated LifecycleDirective lifecycle_directives = 2;
Expand Down
100 changes: 0 additions & 100 deletions python/services/run/alpha/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def __init__(
latest_succeeded_execution: dict = None,
latest_created_execution: dict = None,
reconciling: bool = None,
container_statuses: list = None,
etag: str = None,
project: str = None,
location: str = None,
Expand Down Expand Up @@ -133,9 +132,6 @@ def apply(self):
response.latest_created_execution
)
self.reconciling = Primitive.from_proto(response.reconciling)
self.container_statuses = JobContainerStatusesArray.from_proto(
response.container_statuses
)
self.etag = Primitive.from_proto(response.etag)
self.project = Primitive.from_proto(response.project)
self.location = Primitive.from_proto(response.location)
Expand Down Expand Up @@ -1125,8 +1121,6 @@ def __init__(
last_transition_time: str = None,
severity: str = None,
reason: str = None,
internal_reason: str = None,
domain_mapping_reason: str = None,
revision_reason: str = None,
execution_reason: str = None,
):
Expand All @@ -1136,8 +1130,6 @@ def __init__(
self.last_transition_time = last_transition_time
self.severity = severity
self.reason = reason
self.internal_reason = internal_reason
self.domain_mapping_reason = domain_mapping_reason
self.revision_reason = revision_reason
self.execution_reason = execution_reason

Expand All @@ -1159,16 +1151,6 @@ def to_proto(self, resource):
res.severity = JobConditionsSeverityEnum.to_proto(resource.severity)
if JobConditionsReasonEnum.to_proto(resource.reason):
res.reason = JobConditionsReasonEnum.to_proto(resource.reason)
if JobConditionsInternalReasonEnum.to_proto(resource.internal_reason):
res.internal_reason = JobConditionsInternalReasonEnum.to_proto(
resource.internal_reason
)
if JobConditionsDomainMappingReasonEnum.to_proto(
resource.domain_mapping_reason
):
res.domain_mapping_reason = JobConditionsDomainMappingReasonEnum.to_proto(
resource.domain_mapping_reason
)
if JobConditionsRevisionReasonEnum.to_proto(resource.revision_reason):
res.revision_reason = JobConditionsRevisionReasonEnum.to_proto(
resource.revision_reason
Expand All @@ -1191,12 +1173,6 @@ def from_proto(self, resource):
last_transition_time=Primitive.from_proto(resource.last_transition_time),
severity=JobConditionsSeverityEnum.from_proto(resource.severity),
reason=JobConditionsReasonEnum.from_proto(resource.reason),
internal_reason=JobConditionsInternalReasonEnum.from_proto(
resource.internal_reason
),
domain_mapping_reason=JobConditionsDomainMappingReasonEnum.from_proto(
resource.domain_mapping_reason
),
revision_reason=JobConditionsRevisionReasonEnum.from_proto(
resource.revision_reason
),
Expand Down Expand Up @@ -1298,46 +1274,6 @@ def from_proto(self, resources):
return [JobLatestCreatedExecution.from_proto(i) for i in resources]


class JobContainerStatuses(object):
def __init__(self, name: str = None, image_digest: str = None):
self.name = name
self.image_digest = image_digest

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

res = job_pb2.RunAlphaJobContainerStatuses()
if Primitive.to_proto(resource.name):
res.name = Primitive.to_proto(resource.name)
if Primitive.to_proto(resource.image_digest):
res.image_digest = Primitive.to_proto(resource.image_digest)
return res

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

return JobContainerStatuses(
name=Primitive.from_proto(resource.name),
image_digest=Primitive.from_proto(resource.image_digest),
)


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

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


class JobLaunchStageEnum(object):
@classmethod
def to_proto(self, resource):
Expand Down Expand Up @@ -1572,42 +1508,6 @@ def from_proto(self, resource):
]


class JobConditionsInternalReasonEnum(object):
@classmethod
def to_proto(self, resource):
if not resource:
return resource
return job_pb2.RunAlphaJobConditionsInternalReasonEnum.Value(
"RunAlphaJobConditionsInternalReasonEnum%s" % resource
)

@classmethod
def from_proto(self, resource):
if not resource:
return resource
return job_pb2.RunAlphaJobConditionsInternalReasonEnum.Name(resource)[
len("RunAlphaJobConditionsInternalReasonEnum") :
]


class JobConditionsDomainMappingReasonEnum(object):
@classmethod
def to_proto(self, resource):
if not resource:
return resource
return job_pb2.RunAlphaJobConditionsDomainMappingReasonEnum.Value(
"RunAlphaJobConditionsDomainMappingReasonEnum%s" % resource
)

@classmethod
def from_proto(self, resource):
if not resource:
return resource
return job_pb2.RunAlphaJobConditionsDomainMappingReasonEnum.Name(resource)[
len("RunAlphaJobConditionsDomainMappingReasonEnum") :
]


class JobConditionsRevisionReasonEnum(object):
@classmethod
def to_proto(self, resource):
Expand Down
Loading

0 comments on commit 46d3dfd

Please sign in to comment.