Unverified Commit 25abe5a8 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Change the default runtime mode to orchestrator (#2847)

This PR changes the default runtime mode to orchestrator for generated
clients and the AWS SDK.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent f3106684
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -84,8 +84,8 @@ jobs:
        test:
        - action: check-aws-sdk-adhoc-tests
          runner: ubuntu-latest
        # TODO(enableNewSmithyRuntimeCleanup): Remove `check-aws-sdk-orchestrator-impl` when cleaning up middleware
        - action: check-aws-sdk-orchestrator-impl
        # TODO(enableNewSmithyRuntimeCleanup): Remove `check-aws-sdk-middleware-impl` when cleaning up middleware
        - action: check-aws-sdk-middleware-impl
          runner: smithy_ubuntu-latest_8-core
        - action: check-client-codegen-integration-tests
          runner: smithy_ubuntu-latest_8-core
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ tokio = { version = "1.13.1", features = ["sync"] }
tracing = { version = "0.1" }

# implementation detail of IMDS credentials provider
fastrand = "1"
fastrand = "2.0.0"

bytes = "1.1.0"
http = "0.2.4"
+6 −3
Original line number Diff line number Diff line
@@ -7,10 +7,13 @@

use aws_smithy_client::erase::DynConnector;

// unused when all crate features are disabled
/// Unwrap an [`Option<DynConnector>`](aws_smithy_client::erase::DynConnector), and panic with a helpful error message if it's `None`
pub(crate) fn expect_connector(connector: Option<DynConnector>) -> DynConnector {
    connector.expect("No HTTP connector was available. Enable the `rustls` crate feature or set a connector to fix this.")
pub(crate) fn expect_connector(for_what: &str, connector: Option<DynConnector>) -> DynConnector {
    if let Some(conn) = connector {
        conn
    } else {
        panic!("{for_what} require(s) a HTTP connector, but none was available. Enable the `rustls` crate feature or set a connector to fix this.")
    }
}

#[cfg(feature = "client-hyper")]
+4 −1
Original line number Diff line number Diff line
@@ -100,7 +100,10 @@ impl Builder {
                .read_timeout(DEFAULT_READ_TIMEOUT)
                .build()
        });
        let connector = expect_connector(provider_config.connector(&connector_settings));
        let connector = expect_connector(
            "The HTTP credentials provider",
            provider_config.connector(&connector_settings),
        );
        let mut client_builder = aws_smithy_client::Client::builder()
            .connector(connector)
            .middleware(Identity::new());
+4 −1
Original line number Diff line number Diff line
@@ -430,7 +430,10 @@ impl Builder {
            .read_timeout(self.read_timeout.unwrap_or(DEFAULT_READ_TIMEOUT))
            .build();
        let connector_settings = ConnectorSettings::from_timeout_config(&timeout_config);
        let connector = expect_connector(config.connector(&connector_settings));
        let connector = expect_connector(
            "The IMDS credentials provider",
            config.connector(&connector_settings),
        );
        let endpoint_source = self
            .endpoint
            .unwrap_or_else(|| EndpointSource::Env(config.clone()));
Loading