Skip to content

fix: copy Umask function and remove private package k8s.io/kubernetes/pkg/kubectl/util #2199

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

Conversation

weixiao-huang
Copy link

Description of the change:

Motivation for the change:

"k8s.io/kubernetes/pkg/kubectl/util" has been imported from pkg/ansible/proxy/kubectl.go. However, due to https://github.com/kubernetes/kubernetes/blob/v1.15.4/pkg/kubectl/util/BUILD, this go_library has been declared as a private package only visible inner kubernetes. So if we use bazel in operator-sdk by ourself, this will lead to an error

in go_library rule @com_github_operator_framework_operator_sdk//pkg/ansible/proxy:go_default_library: target '@io_k8s_kubernetes//pkg/kubectl/util:go_default_library' is not visible from target '@com_github_operator_framework_operator_sdk//pkg/ansible/proxy:go_default_library'. Check the visibility declaration of the former target if you think the dependency is legitimate

So we should copy this simple function into out kubectl.go file to avoid this private import

@openshift-ci-robot
Copy link

Hi @weixiao-huang. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 15, 2019
@estroz
Copy link
Member

estroz commented Nov 15, 2019

@weixiao-huang this package restriction is only relevant when using bazel, which the SDK currently does not. If we ever decide to use bazel, we will update our imports to reflect that, copying code if we must. Until then we will import rather than copy code when it makes sense to do so.

@estroz estroz closed this Nov 15, 2019
@joelanford
Copy link
Member

@weixiao-huang As part of the effort to reduce and eventually remove our dependence on k/k, we will be changing this to use k8s.io/kubectl/pkg/util.Umask when we switch to kubernetes 1.16 libraries. See #2145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants