-
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
cmd/operator-sdk,internal: remove legacy CLI, clean up utils #3533
cmd/operator-sdk,internal: remove legacy CLI, clean up utils #3533
Conversation
2045255
to
2bba2bc
Compare
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.
One question.
Otherwise
/lgtm
Blocked by #3531 |
) | ||
|
||
func main() { | ||
// Use the new KB CLI when running inside a Kubebuilder project with an existing PROJECT file. |
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 we not still showing a msg:
if is not show the info that is required to migrate the project when has not the Project file. See: https://github.com/operator-framework/operator-sdk/pull/3539/files#diff-fc95fb53b164f1e3dc64775883195e7bR28-R35
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 don't think so. SDK v1.0 has no knowledge of the legacy CLI/project layout.
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.
It has its pros and cons, I agree. But for alpha at least I think that is valid for we do not see many new issues raised asking about the same issue.
2bba2bc
to
d1ed6a9
Compare
New changes are detected. LGTM label has been removed. |
d1ed6a9
to
dddfab0
Compare
Edit: it no longer is, since legacy |
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 do not think that we should remove the legacy and perform cleanups and changes as refractories in the same pr. IMO these changes should be splitted in order to allow we have visibility and revert something if required.
25d2ed0
to
6a500b3
Compare
internal: clean up utils
6a500b3
to
36f2d1f
Compare
@joelanford @camilamacedo86 removed some more legacy code but mostly kept |
return wd | ||
} | ||
// Default config file path. | ||
const configFile = "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.
Should be on top with the other costs.
|
||
if kbutil.HasProjectFile() { | ||
if projutil.HasProjectFile() { |
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.
It should be removed. All projects for 1.0.0 should have HasProjectFile
The code inside of this checks is related to legacy layout.
@@ -65,7 +60,7 @@ For example: | |||
"Tool to build OCI images. One of: [docker, podman, buildah]") | |||
|
|||
// todo: remove when the legacy layout is no longer supported | |||
if !kbutil.HasProjectFile() { | |||
if !projutil.HasProjectFile() { |
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.
It should be removed. All projects for 1.0.0 should have HasProjectFile
The code inside of this checks is related to legacy layout. See the too comment.
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.
.
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.
Just a few nits:
- The build cmd still with legacy code that would be removed. See: https://github.com/operator-framework/operator-sdk/pull/3539/files#diff-438229e0c2da4b6bcda6233cd9534fe3 (note that build
-go-build-args
is valid just for the legacy layout and we can remove all code under //todo: remove when the legacy is no longer supported) - It is missing the fragment. E.g https://github.com/operator-framework/operator-sdk/pull/3539/files#diff-a3e7a438729f639cfbe0eb4f82c97edbR1
So, /lgtm. However, we can do it in a follow up as well.
PS.: I see more things that can get removed as well but we can do that in a follow-up. Great work btw 👍
Description of the change:
Motivation for the change: a lot of utils are left over from other cleanup efforts, and we don't need any legacy CLI code exposed publicly.
Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments
(seechangelog/fragments/00-template.yaml
)website/content/en/docs