-
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
commands/operator-sdk: rename to cmd/operator-sdk and reorganize #1185
commands/operator-sdk: rename to cmd/operator-sdk and reorganize #1185
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.
LGTM, just one question about one of the lower packages.
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 apart from the one suggestion
This feels wrong to me. I don't think that anyone expects the cmd/ package to be importable, and no other CLI/Library does this that I can tell. I don't think this will break anything, but it just seems unnecessary and will confuse folks who come to contribute IMO. |
@shawn-hurley the Go project layout convention states:
I agree with that statement, especially that last sentence. To better align with this, I'll move |
…r-sdk/cmd to align with go project layout standards
… to internal/commands/operator-sdk/cmd/generate and make unexport functions
I just don't see why many packages don't need to do this and we decided we do. https://github.com/kubernetes-sigs/kubebuilder https://github.com/kubernetes/kubernetes https://github.com/kubernetes-incubator/service-catalog and I am sure we can find more. We should look like the rest of the ecosystem. |
@shawn-hurley Maybe we don't need to do this, but it seems like a harmless change that has the added benefit of explicitly removing packages from our public API that we don't intend for others to use. I think by leaving things as they are, we are making the statement that they're importable (humans may or may not know our intentions, but tools like There are lots of imports of In any case, I'm okay closing this PR if the consensus is that we're okay leaving the existing layout in place. |
We technically only have 1 command/executable(pkg with main identifier) that's Ideally we should rename And since those helper pkgs are meant to only be used by So I'm okay with relaxing the requirement of having Although I'd want to find out if the convention in the kube ecosystem is just an oversight or if those identifiers are meant to be for public use. |
My two cents: I agree about following the guidlines here, it seems to be well accepted in the community. It does also mention the use of
Also the discussion on this issue is interesting, I think Jaana (rakyll) made a good point and I feel like it's how majority of users see/use packages as well (regardless where the package might live):
To sum up, if we are already making changes to the API and making things private/internal towards the
and any internal components we can move to:
|
Ok I've updated the PR to account for the recent comments. The I moved the
|
Looks good! 🎉
Yes I would extract them to a shared internal lib, think |
…o internal package
@AlexNPavel @lilic @shawn-hurley @hasbro17 PTAL I extracted the generator helpers into As a result, I had to refactor the way that the header file flag was handled in the OpenAPI generator. Now that the generator is in a separate package from its callers, it didn't make sense for the caller and callee to share a global variable for the header file. Instead, I made an options struct that includes the header file and updated the |
This build error is unrelated to these changes. Seems like an upstream breaking change, since my |
Here's the error messages: https://travis-ci.org/operator-framework/operator-sdk/jobs/511514286#L910-L913 I'm fairly sure it's related to the changes we made to support all the client auth plugins. I'll take a look at what's going on. |
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
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 after rebase.
Description of the change:
commands/operator-sdk/cmd
tocmd/operator-sdk/
commands/operator-sdk/cmd/<subcommand>
tocommands/operator-sdk/<subcommand>
Motivation for the change:
Necessary for 1.0.0 release and closes #1184