Proposal: Replace the current Makefile with a dedicated CLI tool #541
Labels
Container
Issues or pull requests relevant for Team 2: Container Infra and Tooling
enhancement
New feature or request
housekeeping
Internal housekeeping
longterm
Issues or pull requests that relevent for longterm support
question
Further information is requested
Description
I propose to replace the Makefile currently used for managing the k8s-cluster-api-provider setup for a dedicated CLI tool to increase maintainability and extensibility. While the Makefile does work for the current use-case, i think that it isn't the intended use of Make and also complicates further extension. Two apparent examples would be the implementation of conditional logic being a mix of what (limited) support exists in Make paired with "shell magic", as well as how files and text is processed currently. Keeping the already visible occurrences in mind, both of these examples would, in my opinion, greatly profit from using a proper programming language.
Pros vs Cons
Pros
Cons
Possible implementation
I already thought about how this could look like, but any feedback on this is highly requested.
As a choice of language i would select Python in combination with the Click package to create a robust foundation for the CLI tool. This is because Python is widely known, easy to maintain and provides support for (nearly) everything currently used in the Makefile. The first step would be to mirror the current Makefile to make it as backwards compatible as possible.
Reason for this proposal
I was already questioning the usage of Make for this use-case for a while but the idea to create this proposal manifested while working on #158 . The gist of this issue is too autodetect the availability zone if not explicitly provided. While this looks like a relatively simple task, implementing it in the Makefile in a clean way ended up being quite complicated. Starting from aquiring and storing the AZ info from Openstack, my current approach ended up in querying the API multiple times for the same information due to limitations with how to store and process the given data. Given the knowledge that this is possible with the current Makefile, every possible implementation i tried or thought of felt "hacked together" rather than a robust solution.
Footnotes
Usage of a logging lib vs "echo" or "$(info *)" with arbitrary messages ↩
Make only supports premature exits through errors (i.e.
$(shell exit 1)
) ↩The text was updated successfully, but these errors were encountered: