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

document thoughts on code generation #15

Merged
merged 1 commit into from
Jan 14, 2020

Conversation

jaypipes
Copy link
Collaborator

@jaypipes jaypipes commented Dec 31, 2019

Adds a document discussing options for code generation and a diagram
with how a multi-phase hybrid custom+controller-runtime generator might
work.

Issue #4

Copy link
Contributor

@mhausenblas mhausenblas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super happy about this, concise and great coverage at the same time. I've done a first pass, some minor things, a little consistency, and a bit of clarification for follow-up. I think we're in a good shape for a PoC based on these design considerations.

* a hybrid custom code generator + sigs.kubernetes.io/controller-tools (CR)

The original AWS Service Operator used a [custom-built generator][1] that
processed [YAML files][2] describing the AWS service and used [templates][3] to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/YAML files/YAML manifests

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

The original AWS Service Operator used a [custom-built generator][1] that
processed [YAML files][2] describing the AWS service and used [templates][3] to
[generate CRDs][4], the [controller code][5] itself and the [Go types][6] that
mirror the CRDs. It's worth noting that the CRDs *and* the controller code that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/mirror the CRDs/represent the CRDs in memory

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

docs/code-generation.md Show resolved Hide resolved
plan. Instead, ASO is a controller that facilitates creation and management of
various AWS service objects using Kubernetes CRD instances.

kubebuilder is the the recommended upstream tool for generating CRDs and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mickey Blue Eyes disapproves :)

s/kubebuilder is the the/kubebuilder is the

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

various AWS service objects using Kubernetes CRD instances.

kubebuilder is the the recommended upstream tool for generating CRDs and
controller stub code. It is a Golang binary that creates the scaffolding for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: While Golang is not incorrect, I'd prefer the simpler, short, and in our context unambiguous Go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done :)

docs/code-generation.md Show resolved Hide resolved

[9]: https://github.com/kubernetes-sigs/controller-tools/blob/a5fa7b956b85a6e792bc7086fedf7107d62452b1/cmd/controller-gen/main.go

We also want to generate some Golang code that "installs" a new reconciling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should separate the build and operate (install/upgrade/ALM) concerns.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Adds a document discussing options for code generation and a diagram
with how a multi-phase hybrid custom+controller-runtime generator might
work.

Issue #4
@mhausenblas mhausenblas merged commit 04c7b7d into aws-controllers-k8s:master Jan 14, 2020
@mhausenblas mhausenblas mentioned this pull request Jan 23, 2020
Closed
@negz negz mentioned this pull request Feb 28, 2020
@jaypipes jaypipes deleted the code-generation branch August 6, 2020 13:30
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

Successfully merging this pull request may close these issues.

None yet

2 participants