Skip to content
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

Merged

Conversation

estroz
Copy link
Member

@estroz estroz commented Jul 24, 2020

Description of the change:

  • cmd/operator-sdk: remove legacy CLI from public exposure entirely
  • internal: clean up utils

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:

@estroz estroz force-pushed the chore/cleanup-legacy-code branch 2 times, most recently from 2045255 to 2bba2bc Compare July 24, 2020 23:20
Copy link
Member

@joelanford joelanford left a 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

cmd/operator-sdk/main.go Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2020
@estroz estroz changed the title cmd/operator-sdk: remove legacy CLI, clean up utils [WIP] cmd/operator-sdk: remove legacy CLI, clean up utils Jul 24, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 24, 2020
@estroz
Copy link
Member Author

estroz commented Jul 24, 2020

Blocked by #3531

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 25, 2020
)

func main() {
// Use the new KB CLI when running inside a Kubebuilder project with an existing PROJECT file.
Copy link
Contributor

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


Copy link
Member Author

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.

Copy link
Contributor

@camilamacedo86 camilamacedo86 Jul 25, 2020

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.

@estroz estroz force-pushed the chore/cleanup-legacy-code branch from 2bba2bc to d1ed6a9 Compare July 25, 2020 18:13
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@openshift-ci-robot openshift-ci-robot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 25, 2020
@estroz estroz changed the title [WIP] cmd/operator-sdk: remove legacy CLI, clean up utils cmd/operator-sdk: remove legacy CLI, clean up utils Jul 25, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 25, 2020
@estroz estroz force-pushed the chore/cleanup-legacy-code branch from d1ed6a9 to dddfab0 Compare July 25, 2020 18:15
@estroz
Copy link
Member Author

estroz commented Jul 25, 2020

This seems to be blocked by #3433, which updates ansible-molecule tests.

Edit: it no longer is, since legacy build code has been left alone in this PR.

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a 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.

@estroz estroz force-pushed the chore/cleanup-legacy-code branch from 6a500b3 to 36f2d1f Compare July 27, 2020 05:55
@estroz
Copy link
Member Author

estroz commented Jul 27, 2020

@joelanford @camilamacedo86 removed some more legacy code but mostly kept build alone until #3433 is done, which can be removed in a follow-up.

@estroz estroz changed the title cmd/operator-sdk: remove legacy CLI, clean up utils cmd/operator-sdk,internal: remove legacy CLI, clean up utils Jul 27, 2020
return wd
}
// Default config file path.
const configFile = "PROJECT"
Copy link
Contributor

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() {
Copy link
Contributor

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() {
Copy link
Contributor

@camilamacedo86 camilamacedo86 Jul 27, 2020

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.

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a 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:

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 👍

@joelanford joelanford merged commit 62a8f29 into operator-framework:master Jul 27, 2020
camilamacedo86 added a commit that referenced this pull request Jul 30, 2020
@estroz estroz deleted the chore/cleanup-legacy-code branch August 5, 2020 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants