-
Notifications
You must be signed in to change notification settings - Fork 104
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
Operator Skeleton Generator #1206
Conversation
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.
Let's add the test at least for the non-interactive one and then I think it's good to go
As of how far we want to move this feature I am fine with this scaffolding some general structure of the operator, with folders and everything, I am not sure I would go as far as defining tasks from CLI. Since we're dealing with yaml and not ruby, I think people are able to write yaml even without interactive prompts
pkg/kudoctl/cmd/package_new.go
Outdated
|
||
// run returns the errors associated with cmd env | ||
func (pkg *packageNewCmd) run() error { | ||
folderDefault := "operator" |
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.
why not default to something like operator-$operatorName
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.
this is consistent with 80%+ of our repo...
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.
LGTM minus few minor nits
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
4eea516
to
d2f136a
Compare
resolved all pr feedback... thanks alenkacz ! |
Provides the ability to generate a new operator with: `kudo package new foo` Also provides a way to generate a new operator interactively with `kudo package new -i foo Signed-off-by: Ken Sipe <kensipe@gmail.com> Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
What this PR does / why we need it:
Creates the start of an operator via walking thru validated prompts. Expectations are:
operator.yaml
file in the current directory (which assumes that you are in an operator folder.Answering the prompts will result in:
NOT included:
there will be a separate generator for them
Added to flags
--interactive
and--overwrite
. The default now goes with defaults and creates the operator.-i
goes into interactive mode where questions are asked to fill in the detail.-w
allows for an overwrite of an existing operator. Initially I didn't like the-w
because I wanted to potentially have an interactivepackage update
vspackage new
which is suppose to be new. BUT... I can see the case that someone created with defaults and wants to do it "interactive"Fixes #1085