Skip to content

Conversation

@Itai-Melamed
Copy link

@Itai-Melamed Itai-Melamed commented Oct 23, 2025

Issue #2658

Description of changes:
Implemented support for DirectoryBuckets Creation by removing ignore of DirectoryBucket Fields.

  • CreateBucketConfiguration.Bucket
  • CreateBucketConfiguration.Location

Overrided some of the operations that don't support directory buckets with the equivalent S3 Express operations.
(in - pkg/resource/bucket/hook.go)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from jlbutler and rushmash91 October 23, 2025 09:59
@ack-prow
Copy link

ack-prow bot commented Oct 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Itai-Melamed
Once this PR has been reviewed and has the lgtm label, please assign michaelhtm for approval by writing /assign @michaelhtm in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 23, 2025
@ack-prow
Copy link

ack-prow bot commented Oct 23, 2025

Hi @Itai-Melamed. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Itai-Melamed Itai-Melamed reopened this Oct 23, 2025
@knottnt
Copy link
Contributor

knottnt commented Oct 23, 2025

/ok-to-test

@ack-prow ack-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 23, 2025
@knottnt
Copy link
Contributor

knottnt commented Oct 23, 2025

/test s3-kind-e2e

@ack-prow
Copy link

ack-prow bot commented Oct 23, 2025

@Itai-Melamed: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
s3-verify-attribution 41b0082 link false /test s3-verify-attribution
s3-kind-e2e 41b0082 link true /test s3-kind-e2e

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Contributor

@knottnt knottnt left a comment

Choose a reason for hiding this comment

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

@Itai-Melamed Thanks for the contribution!

Left a few comments. In addition to this we'll also need to add some e2e tests to validate that we can create, update, and delete a directory bucket similar to the other test found in the test/e2e directory.

build_date: "2025-10-23T09:42:09Z"
build_hash: eaabefb6bd7b2be8a1baf4478f22b3310e6921c8
go_version: go1.25.3
version: v0.52.0-6-geaabefb-dirty
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you need to modify the ackgenerate tool to make these changes? If not could you rebuild the controller with an unmodified version.

// isDirectoryBucketName checks if a bucket name follows the directory bucket naming pattern.
// Directory buckets must end with "--x-s3" suffix and follow the format:
// bucket-base-name--zone-id--x-s3
func isDirectoryBucketName(bucketName string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

The logic looks good, but could you add some unit tests for this function.

ctx context.Context,
r *resource,
) error {
// Check if this is a directory bucket to skip unsupported operations
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want to silently ignore values in the spec field. If a user provides an invalid combination of values in their spec we want them to get feedback that the controller isn't able apply the desired state. Often this just involves calling the API and surfacing the returned validation error.

- CreateBucketInput.CreateBucketConfiguration.Bucket
- LoggingEnabled.TargetObjectKeyFormat
operations:
ListDirectoryBuckets:
Copy link
Contributor

Choose a reason for hiding this comment

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

With customFindBucket being used is this still needed?

) error {
rlog := ackrtlog.FromContext(ctx)

s3controlClient := s3control.NewFromConfig(rm.clientcfg)
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need to make some changes to the underlying runtime to make sure this is assuming the correct IAM role when using CARM or future IAMSelector functionality.

) error {
rlog := ackrtlog.FromContext(ctx)

s3controlClient := s3control.NewFromConfig(rm.clientcfg)
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't normally work with multiple sdk clients within an individual ACK controller. Looking at how we setup the client config in our core runtime this should have the correct role credentials, but we'll want to do some extra testing to verify that this works as expected when using CARM or non-default regions.

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

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants