Skip to content

Commit 603f1e3

Browse files
phyberLucioFranco
authored andcommitted
chore(operations): Update Rusoto to 0.38.0 (#1112)
* Update to Rusoto 0.38.0 Signed-off-by: David O'Rourke <[email protected]> * sinks/aws_s3: Fix remaining error types Signed-off-by: David O'Rourke <[email protected]> * .gitignore: Remove vim related files Signed-off-by: David O'Rourke <[email protected]>
1 parent f9a6776 commit 603f1e3

File tree

8 files changed

+80
-77
lines changed

8 files changed

+80
-77
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ miniodat
88
.idea/
99
checkpoints/*
1010
*.iml
11-
*.tmp
11+
*.tmp

Cargo.lock

Lines changed: 27 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ tracing-tower = { git = "https://github.com/tokio-rs/tracing" }
6262
hotmic = "0.8"
6363

6464
# Aws
65-
rusoto_core = "0.37.0"
66-
rusoto_s3 = "0.37.0"
67-
rusoto_logs = "0.37.0"
68-
rusoto_cloudwatch = "0.37.0"
69-
rusoto_kinesis = "0.37.0"
70-
rusoto_credential = "0.16.0"
65+
rusoto_core = "0.38.0"
66+
rusoto_s3 = "0.38.0"
67+
rusoto_logs = "0.38.0"
68+
rusoto_cloudwatch = "0.38.0"
69+
rusoto_kinesis = "0.38.0"
70+
rusoto_credential = "0.17.0"
7171

7272
# Tower
7373
tower = "0.1.1"

src/sinks/aws_cloudwatch_logs/mod.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use bytes::Bytes;
1515
use futures::{future, stream::iter_ok, sync::oneshot, Async, Future, Poll, Sink};
1616
use rusoto_core::{
1717
request::{BufferedHttpResponse, HttpClient},
18-
Region,
18+
Region, RusotoError,
1919
};
2020
use rusoto_credential::DefaultCredentialsProvider;
2121
use rusoto_logs::{
@@ -119,10 +119,10 @@ pub struct RequestConfig {
119119

120120
#[derive(Debug)]
121121
pub enum CloudwatchError {
122-
Put(PutLogEventsError),
123-
Describe(DescribeLogStreamsError),
124-
CreateStream(CreateLogStreamError),
125-
CreateGroup(CreateLogGroupError),
122+
Put(RusotoError<PutLogEventsError>),
123+
Describe(RusotoError<DescribeLogStreamsError>),
124+
CreateStream(RusotoError<CreateLogStreamError>),
125+
CreateGroup(RusotoError<CreateLogGroupError>),
126126
NoStreamsFound,
127127
ServiceDropped,
128128
MakeService,
@@ -398,7 +398,7 @@ fn partition(
398398
enum HealthcheckError {
399399
#[snafu(display("DescribeLogStreams failed: {}", source))]
400400
DescribeLogStreamsFailed {
401-
source: rusoto_logs::DescribeLogGroupsError,
401+
source: RusotoError<rusoto_logs::DescribeLogGroupsError>,
402402
},
403403
#[snafu(display("No log group found"))]
404404
NoLogGroup,
@@ -476,17 +476,17 @@ impl RetryLogic for CloudwatchRetryLogic {
476476
fn is_retriable_error(&self, error: &Self::Error) -> bool {
477477
match error {
478478
CloudwatchError::Put(err) => match err {
479-
PutLogEventsError::ServiceUnavailable(error) => {
479+
RusotoError::Service(PutLogEventsError::ServiceUnavailable(error)) => {
480480
error!(message = "put logs service unavailable.", %error);
481481
true
482482
}
483483

484-
PutLogEventsError::HttpDispatch(error) => {
484+
RusotoError::HttpDispatch(error) => {
485485
error!(message = "put logs http dispatch.", %error);
486486
true
487487
}
488488

489-
PutLogEventsError::Unknown(res)
489+
RusotoError::Unknown(res)
490490
if res.status.is_server_error()
491491
|| res.status == http::StatusCode::TOO_MANY_REQUESTS =>
492492
{
@@ -502,12 +502,12 @@ impl RetryLogic for CloudwatchRetryLogic {
502502
},
503503

504504
CloudwatchError::Describe(err) => match err {
505-
DescribeLogStreamsError::ServiceUnavailable(error) => {
505+
RusotoError::Service(DescribeLogStreamsError::ServiceUnavailable(error)) => {
506506
error!(message = "describe streams service unavailable.", %error);
507507
true
508508
}
509509

510-
DescribeLogStreamsError::Unknown(res)
510+
RusotoError::Unknown(res)
511511
if res.status.is_server_error()
512512
|| res.status == http::StatusCode::TOO_MANY_REQUESTS =>
513513
{
@@ -519,7 +519,7 @@ impl RetryLogic for CloudwatchRetryLogic {
519519
true
520520
}
521521

522-
DescribeLogStreamsError::HttpDispatch(error) => {
522+
RusotoError::HttpDispatch(error) => {
523523
error!(message = "describe streams http dispatch.", %error);
524524
true
525525
}
@@ -528,12 +528,12 @@ impl RetryLogic for CloudwatchRetryLogic {
528528
},
529529

530530
CloudwatchError::CreateStream(err) => match err {
531-
CreateLogStreamError::ServiceUnavailable(error) => {
531+
RusotoError::Service(CreateLogStreamError::ServiceUnavailable(error)) => {
532532
error!(message = "create stream service unavailable.", %error);
533533
true
534534
}
535535

536-
CreateLogStreamError::Unknown(res)
536+
RusotoError::Unknown(res)
537537
if res.status.is_server_error()
538538
|| res.status == http::StatusCode::TOO_MANY_REQUESTS =>
539539
{
@@ -545,7 +545,7 @@ impl RetryLogic for CloudwatchRetryLogic {
545545
true
546546
}
547547

548-
CreateLogStreamError::HttpDispatch(error) => {
548+
RusotoError::HttpDispatch(error) => {
549549
error!(message = "create stream http dispatch.", %error);
550550
true
551551
}
@@ -579,14 +579,14 @@ impl fmt::Display for CloudwatchError {
579579

580580
impl std::error::Error for CloudwatchError {}
581581

582-
impl From<PutLogEventsError> for CloudwatchError {
583-
fn from(e: PutLogEventsError) -> Self {
582+
impl From<RusotoError<PutLogEventsError>> for CloudwatchError {
583+
fn from(e: RusotoError<PutLogEventsError>) -> Self {
584584
CloudwatchError::Put(e)
585585
}
586586
}
587587

588-
impl From<DescribeLogStreamsError> for CloudwatchError {
589-
fn from(e: DescribeLogStreamsError) -> Self {
588+
impl From<RusotoError<DescribeLogStreamsError>> for CloudwatchError {
589+
fn from(e: RusotoError<DescribeLogStreamsError>) -> Self {
590590
CloudwatchError::Describe(e)
591591
}
592592
}

src/sinks/aws_cloudwatch_logs/request.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::CloudwatchError;
22
use futures::{sync::oneshot, try_ready, Async, Future, Poll};
3-
use rusoto_core::RusotoFuture;
3+
use rusoto_core::{RusotoError, RusotoFuture};
44
use rusoto_logs::{
55
CloudWatchLogs, CloudWatchLogsClient, CreateLogGroupError, CreateLogGroupRequest,
66
CreateLogStreamError, CreateLogStreamRequest, DescribeLogStreamsError,
@@ -78,7 +78,10 @@ impl Future for CloudwatchFuture {
7878
Ok(Async::Ready(res)) => res,
7979
Ok(Async::NotReady) => return Ok(Async::NotReady),
8080
Err(e) => {
81-
if let DescribeLogStreamsError::ResourceNotFound(_) = e {
81+
if let RusotoError::Service(
82+
DescribeLogStreamsError::ResourceNotFound(_),
83+
) = e
84+
{
8285
if self.create_missing_group {
8386
info!("log group provided does not exist; creating a new one.");
8487

src/sinks/aws_cloudwatch_metrics.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use futures::{Future, Poll};
1313
use rusoto_cloudwatch::{
1414
CloudWatch, CloudWatchClient, Dimension, MetricDatum, PutMetricDataError, PutMetricDataInput,
1515
};
16-
use rusoto_core::{Region, RusotoFuture};
16+
use rusoto_core::{Region, RusotoError, RusotoFuture};
1717
use serde::{Deserialize, Serialize};
1818
use std::collections::HashMap;
1919
use std::{convert::TryInto, time::Duration};
@@ -194,7 +194,7 @@ impl CloudWatchMetricsSvc {
194194

195195
impl Service<Vec<Metric>> for CloudWatchMetricsSvc {
196196
type Response = ();
197-
type Error = PutMetricDataError;
197+
type Error = RusotoError<PutMetricDataError>;
198198
type Future = RusotoFuture<(), PutMetricDataError>;
199199

200200
fn poll_ready(&mut self) -> Poll<(), Self::Error> {
@@ -217,14 +217,14 @@ impl Service<Vec<Metric>> for CloudWatchMetricsSvc {
217217
struct CloudWatchMetricsRetryLogic;
218218

219219
impl RetryLogic for CloudWatchMetricsRetryLogic {
220-
type Error = PutMetricDataError;
220+
type Error = RusotoError<PutMetricDataError>;
221221
type Response = ();
222222

223223
fn is_retriable_error(&self, error: &Self::Error) -> bool {
224224
match error {
225-
PutMetricDataError::HttpDispatch(_) => true,
226-
PutMetricDataError::InternalServiceFault(_) => true,
227-
PutMetricDataError::Unknown(res)
225+
RusotoError::HttpDispatch(_) => true,
226+
RusotoError::Service(PutMetricDataError::InternalServiceFault(_)) => true,
227+
RusotoError::Unknown(res)
228228
if res.status.is_server_error()
229229
|| res.status == http::StatusCode::TOO_MANY_REQUESTS =>
230230
{

src/sinks/aws_kinesis_streams.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::{
1010
};
1111
use futures::{stream::iter_ok, Future, Poll, Sink};
1212
use rand::random;
13-
use rusoto_core::RusotoFuture;
13+
use rusoto_core::{RusotoError, RusotoFuture};
1414
use rusoto_kinesis::{
1515
Kinesis, KinesisClient, ListStreamsInput, PutRecordsError, PutRecordsInput, PutRecordsOutput,
1616
PutRecordsRequestEntry,
@@ -115,7 +115,7 @@ impl KinesisService {
115115

116116
impl Service<Vec<PutRecordsRequestEntry>> for KinesisService {
117117
type Response = PutRecordsOutput;
118-
type Error = PutRecordsError;
118+
type Error = RusotoError<PutRecordsError>;
119119
type Future = Instrumented<RusotoFuture<PutRecordsOutput, PutRecordsError>>;
120120

121121
fn poll_ready(&mut self) -> Poll<(), Self::Error> {
@@ -151,14 +151,14 @@ impl fmt::Debug for KinesisService {
151151
struct KinesisRetryLogic;
152152

153153
impl RetryLogic for KinesisRetryLogic {
154-
type Error = PutRecordsError;
154+
type Error = RusotoError<PutRecordsError>;
155155
type Response = PutRecordsOutput;
156156

157157
fn is_retriable_error(&self, error: &Self::Error) -> bool {
158158
match error {
159-
PutRecordsError::HttpDispatch(_) => true,
160-
PutRecordsError::ProvisionedThroughputExceeded(_) => true,
161-
PutRecordsError::Unknown(res) if res.status.is_server_error() => true,
159+
RusotoError::HttpDispatch(_) => true,
160+
RusotoError::Service(PutRecordsError::ProvisionedThroughputExceeded(_)) => true,
161+
RusotoError::Unknown(res) if res.status.is_server_error() => true,
162162
_ => false,
163163
}
164164
}
@@ -168,7 +168,7 @@ impl RetryLogic for KinesisRetryLogic {
168168
enum HealthcheckError {
169169
#[snafu(display("ListStreams failed: {}", source))]
170170
ListStreamsFailed {
171-
source: rusoto_kinesis::ListStreamsError,
171+
source: RusotoError<rusoto_kinesis::ListStreamsError>,
172172
},
173173
#[snafu(display("Stream names do not match, got {}, expected {}", name, stream_name))]
174174
StreamNamesMismatch { name: String, stream_name: String },

0 commit comments

Comments
 (0)