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

Moves kubectl get subcommand to staging #84540

Merged
merged 3 commits into from Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/visible_to/BUILD
Expand Up @@ -240,7 +240,6 @@ package_group(
"//pkg/kubectl/cmd/auth",
"//pkg/kubectl/cmd/convert",
"//pkg/kubectl/cmd/cp",
"//pkg/kubectl/cmd/get",
"//pkg/kubectl/explain",
"//staging/src/k8s.io/kubectl/pkg/cmd",
"//staging/src/k8s.io/kubectl/pkg/cmd/annotate",
Expand All @@ -255,6 +254,7 @@ package_group(
"//staging/src/k8s.io/kubectl/pkg/cmd/edit",
"//staging/src/k8s.io/kubectl/pkg/cmd/exec",
"//staging/src/k8s.io/kubectl/pkg/cmd/expose",
"//staging/src/k8s.io/kubectl/pkg/cmd/get",
"//staging/src/k8s.io/kubectl/pkg/cmd/label",
"//staging/src/k8s.io/kubectl/pkg/cmd/logs",
"//staging/src/k8s.io/kubectl/pkg/cmd/patch",
Expand Down
3 changes: 0 additions & 3 deletions go.mod
Expand Up @@ -78,7 +78,6 @@ require (
github.com/json-iterator/go v1.1.7
github.com/karrick/godirwalk v1.7.5 // indirect
github.com/libopenstorage/openstorage v1.0.0
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
github.com/lithammer/dedent v1.1.0
github.com/lpabon/godbc v0.1.1 // indirect
github.com/magiconair/properties v1.8.1 // indirect
Expand Down Expand Up @@ -123,7 +122,6 @@ require (
github.com/vishvananda/netlink v0.0.0-20171020171820-b2de5d10e38e
github.com/vishvananda/netns v0.0.0-20171111001504-be1fbeda1936 // indirect
github.com/vmware/govmomi v0.20.1
github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 // indirect
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
golang.org/x/lint v0.0.0-20190409202823-959b441ac422
Expand Down Expand Up @@ -170,7 +168,6 @@ require (
k8s.io/utils v0.0.0-20191010214722-8d271d903fe4
sigs.k8s.io/kustomize v2.0.3+incompatible
sigs.k8s.io/yaml v1.1.0
vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc
)

replace (
Expand Down
2 changes: 1 addition & 1 deletion hack/.golint_failures
Expand Up @@ -107,7 +107,6 @@ pkg/features
pkg/kubeapiserver
pkg/kubeapiserver/options
pkg/kubectl/cmd/convert
pkg/kubectl/cmd/get
pkg/kubelet/apis/config
pkg/kubelet/apis/config/v1beta1
pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1
Expand Down Expand Up @@ -500,6 +499,7 @@ staging/src/k8s.io/kubectl/pkg/cmd/drain
staging/src/k8s.io/kubectl/pkg/cmd/exec
staging/src/k8s.io/kubectl/pkg/cmd/explain
staging/src/k8s.io/kubectl/pkg/cmd/expose
staging/src/k8s.io/kubectl/pkg/cmd/get
staging/src/k8s.io/kubectl/pkg/cmd/label
staging/src/k8s.io/kubectl/pkg/cmd/logs
staging/src/k8s.io/kubectl/pkg/cmd/patch
Expand Down
2 changes: 1 addition & 1 deletion hack/.staticcheck_failures
Expand Up @@ -19,7 +19,6 @@ pkg/controller/statefulset
pkg/credentialprovider
pkg/credentialprovider/aws
pkg/kubeapiserver/admission
pkg/kubectl/cmd/get
pkg/kubelet/apis/podresources
pkg/kubelet/cm/devicemanager
pkg/kubelet/pluginmanager/operationexecutor
Expand Down Expand Up @@ -176,6 +175,7 @@ vendor/k8s.io/kubectl/pkg/cmd/certificates
vendor/k8s.io/kubectl/pkg/cmd/config
vendor/k8s.io/kubectl/pkg/cmd/edit
vendor/k8s.io/kubectl/pkg/cmd/exec
vendor/k8s.io/kubectl/pkg/cmd/get
vendor/k8s.io/kubectl/pkg/cmd/proxy
vendor/k8s.io/kubectl/pkg/cmd/rollingupdate
vendor/k8s.io/kubectl/pkg/cmd/scale
Expand Down
3 changes: 1 addition & 2 deletions pkg/kubectl/cmd/BUILD
Expand Up @@ -12,7 +12,6 @@ go_library(
"//pkg/kubectl/cmd/auth:go_default_library",
"//pkg/kubectl/cmd/convert:go_default_library",
"//pkg/kubectl/cmd/cp:go_default_library",
"//pkg/kubectl/cmd/get:go_default_library",
"//staging/src/k8s.io/cli-runtime/pkg/genericclioptions:go_default_library",
"//staging/src/k8s.io/client-go/tools/clientcmd:go_default_library",
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
Expand All @@ -35,6 +34,7 @@ go_library(
"//staging/src/k8s.io/kubectl/pkg/cmd/exec:go_default_library",
"//staging/src/k8s.io/kubectl/pkg/cmd/explain:go_default_library",
"//staging/src/k8s.io/kubectl/pkg/cmd/expose:go_default_library",
"//staging/src/k8s.io/kubectl/pkg/cmd/get:go_default_library",
"//staging/src/k8s.io/kubectl/pkg/cmd/kustomize:go_default_library",
"//staging/src/k8s.io/kubectl/pkg/cmd/label:go_default_library",
"//staging/src/k8s.io/kubectl/pkg/cmd/logs:go_default_library",
Expand Down Expand Up @@ -86,7 +86,6 @@ filegroup(
"//pkg/kubectl/cmd/auth:all-srcs",
"//pkg/kubectl/cmd/convert:all-srcs",
"//pkg/kubectl/cmd/cp:all-srcs",
"//pkg/kubectl/cmd/get:all-srcs",
"//pkg/kubectl/cmd/plugin/testdata:all-srcs",
],
tags = ["automanaged"],
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubectl/cmd/cmd.go
Expand Up @@ -49,6 +49,7 @@ import (
cmdexec "k8s.io/kubectl/pkg/cmd/exec"
"k8s.io/kubectl/pkg/cmd/explain"
"k8s.io/kubectl/pkg/cmd/expose"
"k8s.io/kubectl/pkg/cmd/get"
"k8s.io/kubectl/pkg/cmd/label"
"k8s.io/kubectl/pkg/cmd/logs"
"k8s.io/kubectl/pkg/cmd/options"
Expand All @@ -72,7 +73,6 @@ import (
"k8s.io/kubernetes/pkg/kubectl/cmd/auth"
"k8s.io/kubernetes/pkg/kubectl/cmd/convert"
"k8s.io/kubernetes/pkg/kubectl/cmd/cp"
"k8s.io/kubernetes/pkg/kubectl/cmd/get"

"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/kubectl/pkg/cmd/kustomize"
Expand Down
2 changes: 2 additions & 0 deletions staging/src/k8s.io/kubectl/go.mod
Expand Up @@ -32,6 +32,7 @@ require (
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.3
github.com/stretchr/testify v1.3.0
github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 // indirect
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456
gopkg.in/yaml.v2 v2.2.4
gotest.tools v2.2.0+incompatible // indirect
Expand All @@ -46,6 +47,7 @@ require (
k8s.io/utils v0.0.0-20191010214722-8d271d903fe4
sigs.k8s.io/kustomize v2.0.3+incompatible
sigs.k8s.io/yaml v1.1.0
vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc
)

replace (
Expand Down
4 changes: 4 additions & 0 deletions staging/src/k8s.io/kubectl/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions staging/src/k8s.io/kubectl/pkg/cmd/BUILD
Expand Up @@ -45,6 +45,7 @@ filegroup(
"//staging/src/k8s.io/kubectl/pkg/cmd/exec:all-srcs",
"//staging/src/k8s.io/kubectl/pkg/cmd/explain:all-srcs",
"//staging/src/k8s.io/kubectl/pkg/cmd/expose:all-srcs",
"//staging/src/k8s.io/kubectl/pkg/cmd/get:all-srcs",
"//staging/src/k8s.io/kubectl/pkg/cmd/help:all-srcs",
"//staging/src/k8s.io/kubectl/pkg/cmd/kustomize:all-srcs",
"//staging/src/k8s.io/kubectl/pkg/cmd/label:all-srcs",
Expand Down
Expand Up @@ -26,7 +26,8 @@ go_library(
"sorter.go",
"table_printer.go",
],
importpath = "k8s.io/kubernetes/pkg/kubectl/cmd/get",
importmap = "k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/get",
importpath = "k8s.io/kubectl/pkg/cmd/get",
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/core/v1:go_default_library",
Expand Down Expand Up @@ -72,11 +73,7 @@ go_test(
"humanreadable_flags_test.go",
"sorter_test.go",
],
data = [
"//api/openapi-spec",
"//test/e2e/testing-manifests:all-srcs",
"//test/fixtures",
],
data = ["//staging/src/k8s.io/kubectl/test/data"],
Copy link
Member

@liggitt liggitt Oct 30, 2019

Choose a reason for hiding this comment

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

preexisting, but I'm slightly surprised this wasn't under testdata. Any reason not to rename the folder in a follow-up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. I'll change it in the next PR. This was my fault in a previous PR.

embed = [":go_default_library"],
deps = [
"//staging/src/k8s.io/api/apps/v1:go_default_library",
Expand Down
Expand Up @@ -1079,7 +1079,7 @@ func TestGetObjectsIdentifiedByFile(t *testing.T) {
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
cmd := NewCmdGet("kubectl", tf, streams)
cmd.SetOutput(buf)
cmd.Flags().Set("filename", "../../../../test/e2e/testing-manifests/statefulset/cassandra/controller.yaml")
cmd.Flags().Set("filename", "../../../test/data/controller.yaml")
cmd.Run(cmd, []string{})

expected := `NAME AGE
Expand All @@ -1105,7 +1105,7 @@ func TestGetTableObjectsIdentifiedByFile(t *testing.T) {
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
cmd := NewCmdGet("kubectl", tf, streams)
cmd.SetOutput(buf)
cmd.Flags().Set("filename", "../../../../test/e2e/testing-manifests/statefulset/cassandra/controller.yaml")
cmd.Flags().Set("filename", "../../../test/data/controller.yaml")
cmd.Run(cmd, []string{})

expected := `NAME READY STATUS RESTARTS AGE
Expand Down Expand Up @@ -2495,7 +2495,7 @@ func TestWatchResourceIdentifiedByFile(t *testing.T) {
cmd.SetOutput(buf)

cmd.Flags().Set("watch", "true")
cmd.Flags().Set("filename", "../../../../test/e2e/testing-manifests/statefulset/cassandra/controller.yaml")
cmd.Flags().Set("filename", "../../../test/data/controller.yaml")
cmd.Run(cmd, []string{})

expected := `NAME AGE
Expand Down
1 change: 1 addition & 0 deletions vendor/modules.txt
Expand Up @@ -1777,6 +1777,7 @@ k8s.io/kubectl/pkg/cmd/edit
k8s.io/kubectl/pkg/cmd/exec
k8s.io/kubectl/pkg/cmd/explain
k8s.io/kubectl/pkg/cmd/expose
k8s.io/kubectl/pkg/cmd/get
k8s.io/kubectl/pkg/cmd/kustomize
k8s.io/kubectl/pkg/cmd/label
k8s.io/kubectl/pkg/cmd/logs
Expand Down