Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
0c44be83
Commit
0c44be83
authored
May 29, 2015
by
Jeff Lowdermilk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop supporting the minion alias for nodes in kubectl
parent
a026ca40
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
14 deletions
+19
-14
kubectl_get.md
docs/kubectl_get.md
+2
-2
kubectl-get.1
docs/man/man1/kubectl-get.1
+1
-1
test-cmd.sh
hack/test-cmd.sh
+7
-8
get.go
pkg/kubectl/cmd/get.go
+1
-1
kubectl.go
pkg/kubectl/kubectl.go
+8
-2
No files found.
docs/kubectl_get.md
View file @
0c44be83
...
@@ -9,7 +9,7 @@ Display one or many resources.
...
@@ -9,7 +9,7 @@ Display one or many resources.
Possible resources include pods (po), replication controllers (rc), services
Possible resources include pods (po), replication controllers (rc), services
(svc), nodes, events (ev), component statuses (cs), limit ranges (limits),
(svc), nodes, events (ev), component statuses (cs), limit ranges (limits),
minions (mi
), persistent volumes (pv), persistent volume claims (pvc)
nodes (no
), persistent volumes (pv), persistent volume claims (pvc)
or resource quotas (quota).
or resource quotas (quota).
By specifying the output as 'template' and providing a Go template as the value
By specifying the output as 'template' and providing a Go template as the value
...
@@ -87,6 +87,6 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
...
@@ -87,6 +87,6 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
### SEE ALSO
### SEE ALSO
*
[
kubectl
](
kubectl.md
)
- kubectl controls the Kubernetes cluster manager
*
[
kubectl
](
kubectl.md
)
- kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-05-2
8 22:43:52.329286408
+0000 UTC
###### Auto generated by spf13/cobra at 2015-05-2
9 22:39:51.164275749
+0000 UTC
[

]()
[

]()
docs/man/man1/kubectl-get.1
View file @
0c44be83
...
@@ -18,7 +18,7 @@ Display one or many resources.
...
@@ -18,7 +18,7 @@ Display one or many resources.
.PP
.PP
Possible resources include pods (po), replication controllers (rc), services
Possible resources include pods (po), replication controllers (rc), services
(svc), nodes, events (ev), component statuses (cs), limit ranges (limits),
(svc), nodes, events (ev), component statuses (cs), limit ranges (limits),
minions (mi
), persistent volumes (pv), persistent volume claims (pvc)
nodes (no
), persistent volumes (pv), persistent volume claims (pvc)
or resource quotas (quota).
or resource quotas (quota).
.PP
.PP
...
...
hack/test-cmd.sh
View file @
0c44be83
...
@@ -124,14 +124,14 @@ for version in "${kube_api_versions[@]}"; do
...
@@ -124,14 +124,14 @@ for version in "${kube_api_versions[@]}"; do
-s
"http://127.0.0.1:
${
API_PORT
}
"
-s
"http://127.0.0.1:
${
API_PORT
}
"
--match-server-version
--match-server-version
)
)
[
"
$(
kubectl get
minion
s
-t
'{{ .apiVersion }}'
"
${
kube_flags
[@]
}
"
)
"
==
"v1beta3"
]
[
"
$(
kubectl get
node
s
-t
'{{ .apiVersion }}'
"
${
kube_flags
[@]
}
"
)
"
==
"v1beta3"
]
else
else
kube_flags
=(
kube_flags
=(
-s
"http://127.0.0.1:
${
API_PORT
}
"
-s
"http://127.0.0.1:
${
API_PORT
}
"
--match-server-version
--match-server-version
--api-version
=
"
${
version
}
"
--api-version
=
"
${
version
}
"
)
)
[
"
$(
kubectl get
minion
s
-t
'{{ .apiVersion }}'
"
${
kube_flags
[@]
}
"
)
"
==
"
${
version
}
"
]
[
"
$(
kubectl get
node
s
-t
'{{ .apiVersion }}'
"
${
kube_flags
[@]
}
"
)
"
==
"
${
version
}
"
]
fi
fi
id_field
=
".metadata.name"
id_field
=
".metadata.name"
labels_field
=
".metadata.labels"
labels_field
=
".metadata.labels"
...
@@ -630,18 +630,17 @@ __EOF__
...
@@ -630,18 +630,17 @@ __EOF__
###########
###########
#
Minion
s #
#
Node
s #
###########
###########
if
[[
"
${
version
}
"
=
"v1beta1"
]]
||
[[
"
${
version
}
"
=
"v1beta2"
]]
;
then
if
[[
"
${
version
}
"
=
"v1beta1"
]]
||
[[
"
${
version
}
"
=
"v1beta2"
]]
;
then
kube::log::status
"Testing kubectl(
${
version
}
:
minion
s)"
kube::log::status
"Testing kubectl(
${
version
}
:
node
s)"
kube::test::get_object_assert
minion
s
"{{range.items}}{{
$id_field
}}:{{end}}"
'127.0.0.1:'
kube::test::get_object_assert
node
s
"{{range.items}}{{
$id_field
}}:{{end}}"
'127.0.0.1:'
# TODO: I should be a MinionList instead of List
kube::test::get_object_assert nodes
'{{.kind}}'
'List'
kube::test::get_object_assert minions
'{{.kind}}'
'List'
kube::test::describe_object_assert
minion
s
"127.0.0.1"
"Name:"
"Conditions:"
"Addresses:"
"Capacity:"
"Pods:"
kube::test::describe_object_assert
node
s
"127.0.0.1"
"Name:"
"Conditions:"
"Addresses:"
"Capacity:"
"Pods:"
fi
fi
...
...
pkg/kubectl/cmd/get.go
View file @
0c44be83
...
@@ -33,7 +33,7 @@ const (
...
@@ -33,7 +33,7 @@ const (
Possible resources include pods (po), replication controllers (rc), services
Possible resources include pods (po), replication controllers (rc), services
(svc), nodes, events (ev), component statuses (cs), limit ranges (limits),
(svc), nodes, events (ev), component statuses (cs), limit ranges (limits),
minions (mi
), persistent volumes (pv), persistent volume claims (pvc)
nodes (no
), persistent volumes (pv), persistent volume claims (pvc)
or resource quotas (quota).
or resource quotas (quota).
By specifying the output as 'template' and providing a Go template as the value
By specifying the output as 'template' and providing a Go template as the value
...
...
pkg/kubectl/kubectl.go
View file @
0c44be83
...
@@ -18,6 +18,7 @@ limitations under the License.
...
@@ -18,6 +18,7 @@ limitations under the License.
package
kubectl
package
kubectl
import
(
import
(
"fmt"
"strings"
"strings"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
...
@@ -88,7 +89,12 @@ type ShortcutExpander struct {
...
@@ -88,7 +89,12 @@ type ShortcutExpander struct {
// mapper.
// mapper.
func
(
e
ShortcutExpander
)
VersionAndKindForResource
(
resource
string
)
(
defaultVersion
,
kind
string
,
err
error
)
{
func
(
e
ShortcutExpander
)
VersionAndKindForResource
(
resource
string
)
(
defaultVersion
,
kind
string
,
err
error
)
{
resource
=
expandResourceShortcut
(
resource
)
resource
=
expandResourceShortcut
(
resource
)
return
e
.
RESTMapper
.
VersionAndKindForResource
(
resource
)
defaultVersion
,
kind
,
err
=
e
.
RESTMapper
.
VersionAndKindForResource
(
resource
)
// TODO: remove this once v1beta1 and v1beta2 are deprecated
if
err
==
nil
&&
kind
==
"Minion"
{
err
=
fmt
.
Errorf
(
"Alias minion(s) is deprecated. Use node(s) instead"
)
}
return
defaultVersion
,
kind
,
err
}
}
// expandResourceShortcut will return the expanded version of resource
// expandResourceShortcut will return the expanded version of resource
...
@@ -100,7 +106,7 @@ func expandResourceShortcut(resource string) string {
...
@@ -100,7 +106,7 @@ func expandResourceShortcut(resource string) string {
"cs"
:
"componentstatuses"
,
"cs"
:
"componentstatuses"
,
"ev"
:
"events"
,
"ev"
:
"events"
,
"limits"
:
"limitRanges"
,
"limits"
:
"limitRanges"
,
"
mi"
:
"minion
s"
,
"
no"
:
"node
s"
,
"po"
:
"pods"
,
"po"
:
"pods"
,
"pv"
:
"persistentVolumes"
,
"pv"
:
"persistentVolumes"
,
"pvc"
:
"persistentVolumeClaims"
,
"pvc"
:
"persistentVolumeClaims"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment