-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨Add templating interface to clusterctl #3115
✨Add templating interface to clusterctl #3115
Conversation
/assign |
c65b79c
to
6b5e144
Compare
@fabriziopandini would you have time to review? |
/hold Holding to review/merge after we cut alpha.0 next week |
a93ff23
to
450e9e3
Compare
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems pretty good, just some small comments
cmd/clusterctl/client/yamlprocessor/template_processor_simple.go
Outdated
Show resolved
Hide resolved
cmd/clusterctl/client/yamlprocessor/template_processor_simple_test.go
Outdated
Show resolved
Hide resolved
/test pull-cluster-api-e2e |
@vincepri Can we remove the hold on this PR now that alpha is cut? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm +1 to squash commits, remove the hold and take the latest steps to get this merged.
I have added a few comments, mostly nits.
cmd/clusterctl/client/yamlprocessor/template_processor_simple.go
Outdated
Show resolved
Hide resolved
cmd/clusterctl/client/yamlprocessor/template_processor_simple.go
Outdated
Show resolved
Hide resolved
cmd/clusterctl/client/yamlprocessor/template_processor_simple_test.go
Outdated
Show resolved
Hide resolved
I have some time today to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good to me, this looks close to being shipped.
/milestone v0.3.7 |
@fabriziopandini @vincepri I've addressed all of the comments. Thanks for the great feedback!
This one changes the function prototype of the UPDATE: Since I squashed the commits you can reference the file |
/hold cancel |
455c4be
to
4db9565
Compare
The clusterctl.GetClusterTemplateOptions now includes a YamlProcessor option to specify a YamlProcessor to use. By default it uses the SimpleProcessor. Other notes: - Consolidate all the arguments into a single TemplateClientInput struct - Use SimpleProcessor as default template processor - Use SimpleProcessor for components provider - Adds '$' to SimpleProcessor's variable regex because there was a test case that defined that behavior - Add TemplateInput struct to reduce the number of args - Removes explicit sort.Strings Since the sets.String.List returns a sorted list - Consolidates all the arguments for NewCompoonents into ComponentsInput
4db9565
to
e87da61
Compare
@wfernandes outstanding job! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving these here for documentation:
sigs.k8s.io/cluster-api/cmd/clusterctl/client
Incompatible changes:
- ClusterClientFactory: changed from func(Kubeconfig) (sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster.Client, error) to func(ClusterClientFactoryInput) (sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster.Client, error)
- RepositoryClientFactory: changed from func(sigs.k8s.io/cluster-api/cmd/clusterctl/client/config.Provider) (sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository.Client, error) to func(RepositoryClientFactoryInput) (sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository.Client, error)
sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository
Incompatible changes:
- NewComponents: changed from func(sigs.k8s.io/cluster-api/cmd/clusterctl/client/config.Provider, sigs.k8s.io/cluster-api/cmd/clusterctl/client/config.Client, []byte, ComponentsOptions) (*components, error) to func(ComponentsInput) (*components, error)
The PR looks good to go to me, leaving final approval to @ncdc
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ncdc The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-cluster-api-test |
We need to wait for #3253 to merge before tests here can pass |
/retest |
@wfernandes: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What this PR does / why we need it:
YamlProcessor
) to allow for future extensible templating processors.clusterctl
commands or usage.SimpleProcessor
which is also the default if no yaml processor are defined.YAMLProcessor
as part of theclusterctl.GetClusterTemplateOptions
, that is, the yaml processor is exposed via the clusterctl client library forclusterctl.GetClusterTemplate(opts)
.Note
I'm happy to break this PR into smaller PRs. As of now, I kinda broke into separate commits.
Release Notes:
TODO
/area clusterctl