Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object-storage.aws.enabled: true configuration results in a malformed additional bean #517

Open
j1m-renwick opened this issue Aug 21, 2024 · 0 comments

Comments

@j1m-renwick
Copy link

Expected Behavior

The config documentation configuration here specifies micronaut.object-storage.aws.enabled as a boolean flag, and it defaults to true. So setting this as true in the YAML, such as:

 micronaut:
    object-storage:
      aws:
        default:
          bucket: "a.bucket.location"
        enabled: true

Should be the same as omitting it, such as:

 micronaut:
    object-storage:
      aws:
        default:
          bucket: "a.bucket.location"

Actual Behaviour

Setting the value as true in the YAML results in two AwsS3Operations beans being in scope for creation - one named "default", and one malformed one named "enabled" that has invalid configuration associated with it.

Steps To Reproduce

  1. set YAML config to include:
 micronaut:
    object-storage:
      aws:
        default:
          bucket: "a.bucket.location"
        enabled: true
  1. Copying the existing AwsS3Operations bean class, and mark it with @context for eager initialisation at startup, i.e.
@Context
@EachBean(AwsS3Configuration.class)
@Requires(condition = ToggeableCondition.class)
@Requires(beans = AwsS3Configuration.class)
@Replaces(AwsS3Operations.class)
public class AwsS3OperationsNew implements ObjectStorageOperations<
    PutObjectRequest.Builder, PutObjectResponse, DeleteObjectResponse> {

    ...rest of class here...
  1. Set a breakpoint in the constructor of the new class, and start the application. The constructor will be called twice, with one invocation including a malformed configuration bean argument named "enabled"

Environment Information

No response

Example Application

No response

Version

4.3.1

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

No branches or pull requests

1 participant