test/plugin/constants.rb in fluent-plugin-google-cloud-0.6.8 vs test/plugin/constants.rb in fluent-plugin-google-cloud-0.6.9.pre.1

- old
+ new

@@ -95,11 +95,11 @@ # Dataflow specific labels. DATAFLOW_REGION = 'us-central1' DATAFLOW_JOB_NAME = 'job_name_1' DATAFLOW_JOB_ID = 'job_id_1' DATAFLOW_STEP_ID = 'step_1' - DATAFLOW_TAG = 'dataflow.googleapis.com/worker' + DATAFLOW_TAG = 'dataflow-worker' # Dataproc specific labels. DATAPROC_CLUSTER_NAME = 'test-cluster' DATAPROC_CLUSTER_UUID = '00000000-0000-0000-0000-000000000000' DATAPROC_REGION = 'unittest' @@ -138,10 +138,14 @@ DETECT_JSON_CONFIG = %( detect_json true ) + PARTIAL_SUCCESS_CONFIG = %( + partial_success true + ) + # rubocop:disable Metrics/LineLength PRIVATE_KEY_CONFIG = %( auth_method private_key private_key_email 271661262351-ft99kc9kjro9rrihq3k2n3s2inbplu0q@developer.gserviceaccount.com private_key_path test/plugin/data/c31e573fd7f62ed495c9ca3821a5a85cb036dee1-privatekey.p12 @@ -531,17 +535,10 @@ 'id' => 'op_id', 'producer' => 'my/app', 'last' => true } - LOG_ENTRY_SUBFIELDS_PARAMS = { - # payload key, destination key, payload value - DEFAULT_HTTP_REQUEST_KEY => ['httpRequest', HTTP_REQUEST_MESSAGE], - DEFAULT_SOURCE_LOCATION_KEY => ['sourceLocation', SOURCE_LOCATION_MESSAGE], - DEFAULT_OPERATION_KEY => ['operation', OPERATION_MESSAGE] - } - CUSTOM_LABELS_MESSAGE = { 'customKey' => 'value' } CONFLICTING_LABEL_KEY = "#{COMPUTE_CONSTANTS[:service]}/resource_name" @@ -603,6 +600,45 @@ 'pod_id' => CONTAINER_POD_ID, 'zone' => ZONE } }.to_json } + + PARTIAL_SUCCESS_RESPONSE_BODY = { + 'error' => { + 'code' => 403, + 'message' => 'User not authorized.', + 'status' => 'PERMISSION_DENIED', + 'details' => [ + { + '@type' => 'type.googleapis.com/google.logging.v2.WriteLogEntriesPa' \ + 'rtialErrors', + 'logEntryErrors' => { + '0' => { + 'code' => 7, + 'message' => 'User not authorized.' + }, + '1' => { + 'code' => 3, + 'message' => 'Log name contains illegal character :' + }, + '2' => { + 'code' => 3, + 'message' => 'Log name contains illegal character :' + } + } + }, + { + '@type' => 'type.googleapis.com/google.rpc.DebugInfo', + 'detail' => '[ORIGINAL ERROR] generic::permission_denied: User not ' \ + 'authorized. [google.rpc.error_details_ext] { message: \"User not' \ + ' authorized.\" details { type_url: \"type.googleapis.com/google.' \ + 'logging.v2.WriteLogEntriesPartialErrors\" value: \"\\n\\034\\010' \ + '\\000\\022\\030\\010\\007\\022\\024User not authorized.\\n-\\010' \ + '\\001\\022)\\010\\003\\022%Log name contains illegal character :' \ + '\\n-\\010\\002\\022)\\010\\003\\022%Log name contains illegal ch' \ + 'aracter :\" } }' + } + ] + } + }.to_json end