Skip to content

fix(s3): remove dynamic force-path-style addressing (#1648)#2193

Open
Anshgrover23 wants to merge 6 commits intoconda:mainfrom
Anshgrover23:fix/1648-remove-dynamic-s3-path-style
Open

fix(s3): remove dynamic force-path-style addressing (#1648)#2193
Anshgrover23 wants to merge 6 commits intoconda:mainfrom
Anshgrover23:fix/1648-remove-dynamic-s3-path-style

Conversation

@Anshgrover23
Copy link
Contributor

@Anshgrover23 Anshgrover23 commented Mar 8, 2026

Description

Removes dynamic force-path-style addressing and adds explicit S3 configuration via rattler_config.

Changes:

  • rattler_networking: Remove endpoint-based path-style inference. For custom S3 backends, use rattler_config [s3-options.bucket] with force-path-style, endpoint-url, and region.
  • rattler-bin create: Add --config to load rattler_config and pass S3 options to the S3 middleware.
  • rattler-index s3: When --config is used, apply force_path_style from rattler_config to credentials.
  • MinIO e2e: Create a rattler.toml with S3 options and use --config for both rattler-index and rattler create.

Fixes #1648

How Has This Been Tested?

  • pixi run cargo nextest run -p rattler_networking --features s3 s3_middleware (unit tests)
  • pixi run e2e-s3-minio (MinIO e2e)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes

@Anshgrover23
Copy link
Contributor Author

@baszalmstra Could I get a review on this one whenever you get a chance? Thanks.

@Anshgrover23 Anshgrover23 force-pushed the fix/1648-remove-dynamic-s3-path-style branch from adbbab9 to 78d0d9d Compare March 9, 2026 17:00
# Create rattler config with S3 options for MinIO (path-style addressing)
let config_content = $"[s3-options.($bucket_name)]
endpoint-url = \"http://localhost:9000\"
force-path-style = true
Copy link
Member

Choose a reason for hiding this comment

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

while we're at it, i think we should rename this to addressing-style: path | virtual-host. we should print a warning when force-path-style is still used

Comment on lines -61 to -63
--region "us-east-1"
--endpoint-url "http://localhost:9000"
--addressing-style path
Copy link
Member

Choose a reason for hiding this comment

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

is changing this necessary? CLI args should already result in S3CredentialsOpts being set, no?

Comment on lines 120 to 122
AWS_ACCESS_KEY_ID: $root_user
AWS_SECRET_ACCESS_KEY: $root_password
AWS_REGION: "us-east-1"
Copy link
Member

Choose a reason for hiding this comment

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

we should be using the S3_ variants (that are not loaded through aws-sdk: https://github.com/pavelzw/rattler/blob/a8364172f90f752eed7e49f3be73c28878240631/crates/rattler_s3/src/clap.rs#L52

passing them as CLI flags is also fine

Comment on lines +181 to +187
if let Some(s3_config) = s3_config {
credentials.addressing_style = if s3_config.force_path_style {
rattler_s3::clap::S3AddressingStyleOpts::Path
} else {
rattler_s3::clap::S3AddressingStyleOpts::VirtualHost
};
}
Copy link
Member

Choose a reason for hiding this comment

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

we should be using credentials.addressing_style.or(...).

this also means that https://github.com/pavelzw/rattler/blob/a8364172f90f752eed7e49f3be73c28878240631/crates/rattler_s3/src/clap.rs#L61 should be a Option<S3AddressingStyleOpts>.

@baszalmstra was there a reason why you made this not an Option back then?
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

s3: get rid of dynamic force-path-style addressing

2 participants