Skip to content

Generate resource/sdk setters for custom/injected fields #2010

Open
@a-hilaly

Description

@a-hilaly

The ACK code-generator currently has the capability to generate resource output setters - which essentially translate API responses into CRD spec/status fields. And vice-versa CRD spec/status into API requests.

However, the code generator is only targeting fields that are "naturally" inferred from the operations input/output shapes.. and it is currently unable to generate the same code for custom fields that are injected into the CRD spec/status. Ideally, we need to implement this feature to reduce the amount of custom hooks in ReadOne/Create/Update sdk paths.

Note that we can have two different fields (one naturally inferred and one custom field) that needs to be set from the same API response. Typically, one of them is in the status and the other is in the spec. Only the spec fields should be used to set the API request.

Code hints:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/code-generationIssues or PRs as related to controllers or docs code generationkind/featureCategorizes issue or PR as related to a new feature.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions