-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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-migrate: migrate an existing SDK project to a kubebuilder-style one #2851
Conversation
74d9dc6
to
8f573b0
Compare
}, | ||
} | ||
|
||
cmd.Flags().StringVar(&c.ptype, "type", "", |
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 think the tool would just make sense for GO operators, so would be required to have a type here?
"directory of project to migrate") | ||
cmd.Flags().StringVar(&c.toDir, "to-dir", "", | ||
"directory to place migrated project") | ||
|
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.
WDYT about source and tagert instead of from-dir
to "to-dir"
?
if len(pathSplit) < 2 || filePath == "go.mod" || filePath == "go.sum" { | ||
return filePath | ||
} | ||
|
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.
dir := pathSplit[0] |
} | ||
|
||
switch { | ||
case pathSplit[0] == "deploy": |
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.
case pathSplit[0] == "deploy": | |
case dir == "deploy": |
|
||
func main() { | ||
if err := rootCmd().Execute(); err != nil { | ||
os.Exit(1) |
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.
should not log the error?
8f573b0
to
7581fa2
Compare
7581fa2
to
c5d6cff
Compare
c5d6cff
to
0e64051
Compare
@@ -0,0 +1,131 @@ | |||
// Copyright 2020 The Operator-SDK Authors |
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.
WDYT about it be an incubete/tools
module whcih will allow users to get it such as go get github.com/operator-framework/operator-sdk/incubete/tools/migration
. Then, we also can publish it without support and getting started to give an opportunity to receive an incubating project for the https://github.com/operator-framework/community/pull/22/files which would allow us to move forward with #3787. We might be able to have as well go get github.com/operator-framework/operator-sdk/incubete/plugins
.
Description of the change:
operator-migrate
migrates an operator-sdk-style project to a kubebuilder-style project.Motivation for the change: eases the migration process to a kubebuilder-style project:
This will run
operator-sdk init
thenoperator-sdk create api
for each API type found indeploy/crds
.TODO's: