Skip to content

[code-generator] Allow making late initialization optional for some fields #2113

@cPu1

Description

@cPu1

Is your feature request related to a problem?
When importing a certificate into ACM, the DescribeCertificate API does not return values for DomainValidationOptions and SubjectAlternativeNames if SANs are not set in the certificate. This causes the controller to keep retrying DescribeCertificate for setting fields that will never be returned from the API, thereby failing the late initialization process.

Describe the solution you'd like
An optional field in late_initialize that marks late initialization as optional for that field, along with a timeout field that specifies the maximum duration to keep retrying the late initialization process, as in

resources:
  Certificate:
    fields:
      KeyAlgorithm:
        late_initialize:
          optional: true
          timeout: 2m

Additionally, a maxRetries field can also be considered to limit the number of attempts of the late initialization process.

Describe alternatives you've considered
A late_initialize_post_read_one hook can be used to work around this, but it's unwieldy to write such code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-kindIndicates a PR lacks a `kind/foo` label and requires one.service/acmIndicates issues or PRs that are related to acm-controller.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions