-
Notifications
You must be signed in to change notification settings - Fork 272
Description
Describe the bug
When trying to create a Directory Bucket using the CRD, we're getting MalformedXML error.
When trying to adopt an existing Directory Bucket, "adopted resource not found"
Initially working on 1.0.32, after upgrading to 1.1.1 the issue persists.
Steps to reproduce
Creating new Directory Bucket
- Create a new
Bucketresource YAML file:
# my-test-directory-bucket.yaml
apiVersion: s3.services.k8s.aws/v1alpha1
kind: Bucket
metadata:
name: my-test-directory-bucket
spec:
name: my-test-directory-bucket--euw1-az3--x-s3
createBucketConfiguration:
locationConstraint: eu-west-1- Apply and check Status
kubectl apply -f my-test-directory-bucket.yaml
kubectl describe bucket/my-test-directory-bucketAfter checking the status -
# Received Status is:
status:
ackResourceMetadata:
ownerAccountID: "**************"
region: eu-west-1
conditions:
- message: 'api error MalformedXML: The XML you provided was not well-formed or
did not validate against our published schema'
status: "True"
type: ACK.Terminal
- lastTransitionTime: "2025-10-19T14:45:23Z"
message: Resource not synced
reason: resource is in terminal condition
status: "False"
type: ACK.ResourceSyncedAdopting an existing Directory Bucket
Also unable to adopt an existing Directory Bucket, the following is the yaml configuration of adopted bucket:
apiVersion: s3.services.k8s.aws/v1alpha1
kind: Bucket
metadata:
name: test-directory-buckets--euw1-az3--x-s3
annotations:
services.k8s.aws/region: eu-west-1
services.k8s.aws/adoption-policy: "adopt"
services.k8s.aws/adoption-fields: |
{"name": "test-directory-buckets--euw1-az3--x-s3"}When applying this resource as a regular general-purpose bucket (regular name like my-bucket) the operation succeeds. When trying to adopt a Directory Bucket, s3-controller error logs:
{
"level": "error",
"ts": "2025-10-20T09:37:39.241Z",
"msg": "Reconciler error",
"controller": "bucket",
"controllerGroup": "s3.services.k8s.aws",
"controllerKind": "Bucket",
"Bucket":
{
"name": "test-directory-buckets--euw1-az3--x-s3",
"namespace": "my-team",
},
"namespace": "my-team",
"name": "test-directory-buckets--euw1-az3--x-s3",
"reconcileID": "xxxxxxxxxxxxxxx",
"error": "adopted resource not found",
"stacktrace": "sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:347\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:294\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:255",
}I am fairly certain that when s3-controller attempts to adopt this resource it preforms ListBuckets on the AWS account, which is not supported for Directory Buckets.
Expected outcome
Bucket of type DirectoryBucket (S3 Express) is created and synchronized.
Environment
- Kubernetes version -- 1.28.14
- Using EKS (yes/no), if so version? -- no
- AWS service targeted (S3, RDS, etc.) -- S3 (controller version 1.1.1 / 1.0.32)