Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
twuebi committed Nov 20, 2024
1 parent 6aaab84 commit ee8d763
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kube-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- run: helm repo add lakekeeper https://lakekeeper.github.io/lakekeeper-charts/
name: Add lakekeeper helm repo
- name: Install lakekeeper
run: helm install -f tests/kube-auth/values.yaml my-lakekeeper lakekeeper/lakekeeper --version 0.1.5 --wait --timeout 300
run: helm install -f tests/kube-auth/values.yaml my-lakekeeper lakekeeper/lakekeeper --version 0.1.5 --wait --timeout 300s
- name: Apply auth role
run: kubectl apply -f tests/kube-auth/auth_role.yaml
- name: Run tests
Expand Down
9 changes: 8 additions & 1 deletion crates/iceberg-catalog/src/service/storage/s3.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![allow(clippy::module_name_repetitions)]

use crate::{WarehouseIdent, CONFIG};
use std::cell::OnceCell;

use crate::api::{iceberg::v1::DataAccess, CatalogConfig};
use crate::service::storage::error::{
Expand All @@ -18,6 +19,12 @@ use veil::Redact;

use super::StorageType;

static S3_CLIENT: OnceCell<reqwest::Client> = OnceCell::new();

Check failure on line 22 in crates/iceberg-catalog/src/service/storage/s3.rs

View workflow job for this annotation

GitHub Actions / check-management-openapi

`std::cell::OnceCell<reqwest::Client>` cannot be shared between threads safely

Check failure on line 22 in crates/iceberg-catalog/src/service/storage/s3.rs

View workflow job for this annotation

GitHub Actions / clippy

`std::cell::OnceCell<reqwest::Client>` cannot be shared between threads safely

fn get_client() -> reqwest::Client {
S3_CLIENT.get_or_init(|| reqwest::Client::new()).clone()
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, utoipa::ToSchema)]
#[serde(rename_all = "kebab-case")]
pub struct S3Profile {
Expand Down Expand Up @@ -97,7 +104,7 @@ impl S3Profile {
&self,
credential: Option<&aws_credential_types::Credentials>,
) -> Result<iceberg::io::FileIO, FileIoError> {
let mut builder = iceberg::io::FileIOBuilder::new("s3");
let mut builder = iceberg::io::FileIOBuilder::new("s3").with_client(get_client());

builder = builder.with_prop(iceberg::io::S3_REGION, self.region.clone());

Expand Down

0 comments on commit ee8d763

Please sign in to comment.