1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.run.v2; 18 19import "google/protobuf/timestamp.proto"; 20 21option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; 22option java_multiple_files = true; 23option java_outer_classname = "ConditionProto"; 24option java_package = "com.google.cloud.run.v2"; 25 26// Defines a status condition for a resource. 27message Condition { 28 // Represents the possible Condition states. 29 enum State { 30 // The default value. This value is used if the state is omitted. 31 STATE_UNSPECIFIED = 0; 32 33 // Transient state: Reconciliation has not started yet. 34 CONDITION_PENDING = 1; 35 36 // Transient state: reconciliation is still in progress. 37 CONDITION_RECONCILING = 2; 38 39 // Terminal state: Reconciliation did not succeed. 40 CONDITION_FAILED = 3; 41 42 // Terminal state: Reconciliation completed successfully. 43 CONDITION_SUCCEEDED = 4; 44 } 45 46 // Represents the severity of the condition failures. 47 enum Severity { 48 // Unspecified severity 49 SEVERITY_UNSPECIFIED = 0; 50 51 // Error severity. 52 ERROR = 1; 53 54 // Warning severity. 55 WARNING = 2; 56 57 // Info severity. 58 INFO = 3; 59 } 60 61 // Reasons common to all types of conditions. 62 enum CommonReason { 63 // Default value. 64 COMMON_REASON_UNDEFINED = 0; 65 66 // Reason unknown. Further details will be in message. 67 UNKNOWN = 1; 68 69 // Revision creation process failed. 70 REVISION_FAILED = 3; 71 72 // Timed out waiting for completion. 73 PROGRESS_DEADLINE_EXCEEDED = 4; 74 75 // The container image path is incorrect. 76 CONTAINER_MISSING = 6; 77 78 // Insufficient permissions on the container image. 79 CONTAINER_PERMISSION_DENIED = 7; 80 81 // Container image is not authorized by policy. 82 CONTAINER_IMAGE_UNAUTHORIZED = 8; 83 84 // Container image policy authorization check failed. 85 CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; 86 87 // Insufficient permissions on encryption key. 88 ENCRYPTION_KEY_PERMISSION_DENIED = 10; 89 90 // Permission check on encryption key failed. 91 ENCRYPTION_KEY_CHECK_FAILED = 11; 92 93 // At least one Access check on secrets failed. 94 SECRETS_ACCESS_CHECK_FAILED = 12; 95 96 // Waiting for operation to complete. 97 WAITING_FOR_OPERATION = 13; 98 99 // System will retry immediately. 100 IMMEDIATE_RETRY = 14; 101 102 // System will retry later; current attempt failed. 103 POSTPONED_RETRY = 15; 104 105 // An internal error occurred. Further information may be in the message. 106 INTERNAL = 16; 107 } 108 109 // Reasons specific to Revision resource. 110 enum RevisionReason { 111 // Default value. 112 REVISION_REASON_UNDEFINED = 0; 113 114 // Revision in Pending state. 115 PENDING = 1; 116 117 // Revision is in Reserve state. 118 RESERVE = 2; 119 120 // Revision is Retired. 121 RETIRED = 3; 122 123 // Revision is being retired. 124 RETIRING = 4; 125 126 // Revision is being recreated. 127 RECREATING = 5; 128 129 // There was a health check error. 130 HEALTH_CHECK_CONTAINER_ERROR = 6; 131 132 // Health check failed due to user error from customized path of the 133 // container. System will retry. 134 CUSTOMIZED_PATH_RESPONSE_PENDING = 7; 135 136 // A revision with min_instance_count > 0 was created and is reserved, but 137 // it was not configured to serve traffic, so it's not live. This can also 138 // happen momentarily during traffic migration. 139 MIN_INSTANCES_NOT_PROVISIONED = 8; 140 141 // The maximum allowed number of active revisions has been reached. 142 ACTIVE_REVISION_LIMIT_REACHED = 9; 143 144 // There was no deployment defined. 145 // This value is no longer used, but Services created in older versions of 146 // the API might contain this value. 147 NO_DEPLOYMENT = 10; 148 149 // A revision's container has no port specified since the revision is of a 150 // manually scaled service with 0 instance count 151 HEALTH_CHECK_SKIPPED = 11; 152 153 // A revision with min_instance_count > 0 was created and is waiting for 154 // enough instances to begin a traffic migration. 155 MIN_INSTANCES_WARMING = 12; 156 } 157 158 // Reasons specific to Execution resource. 159 enum ExecutionReason { 160 // Default value. 161 EXECUTION_REASON_UNDEFINED = 0; 162 163 // Internal system error getting execution status. System will retry. 164 JOB_STATUS_SERVICE_POLLING_ERROR = 1; 165 166 // A task reached its retry limit and the last attempt failed due to the 167 // user container exiting with a non-zero exit code. 168 NON_ZERO_EXIT_CODE = 2; 169 170 // The execution was cancelled by users. 171 CANCELLED = 3; 172 173 // The execution is in the process of being cancelled. 174 CANCELLING = 4; 175 176 // The execution was deleted. 177 DELETED = 5; 178 } 179 180 // type is used to communicate the status of the reconciliation process. 181 // See also: 182 // https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting 183 // Types common to all resources include: 184 // * "Ready": True when the Resource is ready. 185 string type = 1; 186 187 // State of the condition. 188 State state = 2; 189 190 // Human readable message indicating details about the current status. 191 string message = 3; 192 193 // Last time the condition transitioned from one status to another. 194 google.protobuf.Timestamp last_transition_time = 4; 195 196 // How to interpret failures of this condition, one of Error, Warning, Info 197 Severity severity = 5; 198 199 // The reason for this condition. Depending on the condition type, 200 // it will populate one of these fields. 201 // Successful conditions cannot have a reason. 202 oneof reasons { 203 // A common (service-level) reason for this condition. 204 CommonReason reason = 6; 205 206 // A reason for the revision condition. 207 RevisionReason revision_reason = 9; 208 209 // A reason for the execution condition. 210 ExecutionReason execution_reason = 11; 211 } 212} 213