Skip to content

Rethink the output of ACK's code generator #1299

@jaypipes

Description

@jaypipes

The ack-generate tool currently consumes the API model definitions from aws-sdk-go for a particular AWS service and outputs generated code for:

  • ACK-specific CRDs (i.e. CRDs in the services.k8s.aws APIGroup
  • ACK controller implementation (i.e. cmd/main.go, all pkg/resource/* packages, Helm charts, static config files, etc)
  • Crossplane CRDs and Crossplane's ManagedResource (XRD) interface implementations for different resources in a service.

While this has served us well over the last couple years, it has become apparent that a more useful system would be to focus on outputting Go packages for the various resource managers (as we do now) but make them able to be easily imported outside of ACK controllers. In other words, solidify the public interface for resource managers and allow systems like Crossplane or Terraform to simply import the relevant Go packages for the various services and their resource managers.

Some subtasks I think are worth doing for this effort:

  • Move the public resource manager types/interfaces into the github.com/aws-controllers-k8s/pkg repository
  • Add interface methods to the ResourceManagerFactory or ResourceDescriptor that would allow us to expose various expected API behaviours (such as update code path patterns or readonly/immutable fields) to consumers
  • Decouple the resource manager interfaces from the ACK runtime implementation. This will be necessary for other consumers like Crossplane who do not use the ACK runtime

Metadata

Metadata

Assignees

Labels

area/code-generationIssues or PRs as related to controllers or docs code generationarea/crossplaneIssues or PRs related to crossplanekind/enhancementCategorizes issue or PR as related to existing feature enhancements.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions