-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Deprecate v1 projects #1137
Deprecate v1 projects #1137
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,11 @@ import ( | |
|
||
"sigs.k8s.io/kubebuilder/cmd/version" | ||
"sigs.k8s.io/kubebuilder/pkg/scaffold" | ||
"sigs.k8s.io/kubebuilder/pkg/scaffold/project" | ||
) | ||
|
||
const ( | ||
NoticeColor = "\033[1;36m%s\033[0m" | ||
) | ||
|
||
// module and goMod arg just enough of the output of `go mod edit -json` for our purposes | ||
|
@@ -112,7 +117,9 @@ func main() { | |
) | ||
|
||
foundProject, version := getProjectVersion() | ||
if foundProject && version == "1" { | ||
if foundProject && version == project.Version1 { | ||
This comment was marked as resolved.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you suggest to do this change from another PR (#1143) into this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @Adirio, Because this PR is doing/replacing So, as part of its review, I am suggesting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that @camilamacedo86 suggested naming is more suitable. But I also agree that we can lay it on #1143, as the narrow scope of my change was only to replace the string If you still think we should introduce this change here, let me know. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hypnoglow The change she is suggesting is not just a more suitable name, it has to do with the package with the same alias ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not a big deal so I am OK with. |
||
printV1DeprecationWarning() | ||
|
||
rootCmd.AddCommand( | ||
newAlphaCommand(), | ||
newVendorUpdateCmd(), | ||
|
@@ -188,3 +195,7 @@ func getProjectVersion() (bool, string) { | |
} | ||
return true, projectInfo.Version | ||
} | ||
|
||
func printV1DeprecationWarning() { | ||
fmt.Printf(NoticeColor, "[Deprecation Notice] The v1 projects are deprecated and will not be supported beyond Feb 1, 2020.\nSee how to upgrade your project to v2: https://book.kubebuilder.io/migration/guide.html\n") | ||
} |
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.
Cobra command library does provide mechanism to mark commands as deprecated but I think the implemented approach will work better for our case.