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
a0e06c74
Commit
a0e06c74
authored
Oct 17, 2017
by
yuexiao-wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Kubectl]Fix example and annotation in convert
Signed-off-by:
yuexiao-wang
<
wang.yuexiao@zte.com.cn
>
parent
d7e56d53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
convert.go
pkg/kubectl/cmd/convert.go
+4
-4
No files found.
pkg/kubectl/cmd/convert.go
View file @
a0e06c74
...
...
@@ -51,7 +51,7 @@ var (
kubectl convert -f pod.yaml
# Convert the live state of the resource specified by 'pod.yaml' to the latest version
# and print to stdout in
json
format.
# and print to stdout in
JSON
format.
kubectl convert -f pod.yaml --local -o json
# Convert all files under current directory to latest version and create them all.
...
...
@@ -203,7 +203,7 @@ func (o *ConvertOptions) RunConvert() error {
return
o
.
printer
.
PrintObj
(
objects
,
o
.
out
)
}
//
O
bjectListToVersionedObject receives a list of api objects and a group version
//
o
bjectListToVersionedObject receives a list of api objects and a group version
// and squashes the list's items into a single versioned runtime.Object.
func
objectListToVersionedObject
(
objects
[]
runtime
.
Object
,
version
schema
.
GroupVersion
)
(
runtime
.
Object
,
error
)
{
objectList
:=
&
api
.
List
{
Items
:
objects
}
...
...
@@ -214,7 +214,7 @@ func objectListToVersionedObject(objects []runtime.Object, version schema.GroupV
return
converted
,
nil
}
//
A
sVersionedObject converts a list of infos into a single object - either a List containing
//
a
sVersionedObject converts a list of infos into a single object - either a List containing
// the objects as children, or if only a single Object is present, as that object. The provided
// version will be preferred as the conversion target, but the Object's mapping version will be
// used if that version is not present.
...
...
@@ -247,7 +247,7 @@ func asVersionedObject(infos []*resource.Info, forceList bool, version schema.Gr
return
object
,
nil
}
//
A
sVersionedObjects converts a list of infos into versioned objects. The provided
//
a
sVersionedObjects converts a list of infos into versioned objects. The provided
// version will be preferred as the conversion target, but the Object's mapping version will be
// used if that version is not present.
func
asVersionedObjects
(
infos
[]
*
resource
.
Info
,
version
schema
.
GroupVersion
,
encoder
runtime
.
Encoder
)
([]
runtime
.
Object
,
error
)
{
...
...
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