Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions bottlecap/src/bin/bottlecap/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#![deny(missing_copy_implementations)]
#![deny(missing_debug_implementations)]

use bottlecap::tags::lambda::tags::EXTENSION_VERSION;
Comment thread
alexgallotta marked this conversation as resolved.
Outdated
use bottlecap::{
base_url,
config::{self, get_aws_partition_by_region, AwsConfig, Config},
Expand Down Expand Up @@ -101,7 +102,7 @@ enum NextEventResponse {
},
}

async fn next_event(client: &reqwest::Client, ext_id: &str) -> Result<NextEventResponse> {
async fn next_event(client: &Client, ext_id: &str) -> Result<NextEventResponse> {
let base_url = base_url(EXTENSION_ROUTE)
.map_err(|e| Error::new(std::io::ErrorKind::InvalidData, e.to_string()))?;
let url = format!("{base_url}/event/next");
Expand Down Expand Up @@ -136,7 +137,7 @@ async fn next_event(client: &reqwest::Client, ext_id: &str) -> Result<NextEventR
})
}

async fn register(client: &reqwest::Client) -> Result<RegisterResponse> {
async fn register(client: &Client) -> Result<RegisterResponse> {
let mut map = HashMap::new();
let base_url = base_url(EXTENSION_ROUTE)
.map_err(|e| Error::new(std::io::ErrorKind::InvalidData, e.to_string()))?;
Expand Down Expand Up @@ -185,7 +186,9 @@ async fn main() -> Result<()> {
let (mut aws_config, config) = load_configs();

enable_logging_subsystem(&config);
let client = reqwest::Client::builder().no_proxy().build().map_err(|e| {
let version_without_next = EXTENSION_VERSION.split('-').next().unwrap_or("NA");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why without next?

Copy link
Copy Markdown
Contributor Author

@alexgallotta alexgallotta Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was because the print was done before the fallback code.
It might still be clearer to avoid adding the -next suffix since it's not how we present the versions, but I don't really have a strong opinion on that, happy to change if you think it's more clean

debug!("Starting Datadog Extension {version_without_next}");
let client = Client::builder().no_proxy().build().map_err(|e| {
Error::new(
std::io::ErrorKind::InvalidData,
format!("Failed to create client: {e:?}"),
Expand Down
1 change: 0 additions & 1 deletion scripts/build_binary_and_layer_dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function docker_build_zip {
arch=$1
suffix=$2

DOCKER_BUILDKIT=1
Comment thread
alexgallotta marked this conversation as resolved.
docker buildx build --platform linux/${arch} \
-t datadog/build-lambda-extension-${arch}:$VERSION \
-f ./scripts/$BUILD_FILE \
Expand Down