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
b930d58f
Commit
b930d58f
authored
Apr 29, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24994 from pmorie/kubectl-configmap
Automatic merge from submit-queue Fix `kubectl create configmap` help Resurrection of #23290 cc @bgrant0607 @janetkuo @ncdc
parents
ee2a0694
8858d200
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
kubectl-create-configmap.1
docs/man/man1/kubectl-create-configmap.1
+3
-3
kubectl_create_configmap.md
docs/user-guide/kubectl/kubectl_create_configmap.md
+5
-5
create_configmap.go
pkg/kubectl/cmd/create_configmap.go
+5
-5
No files found.
docs/man/man1/kubectl-create-configmap.1
View file @
b930d58f
...
@@ -193,13 +193,13 @@ symlinks, devices, pipes, etc).
...
@@ -193,13 +193,13 @@ symlinks, devices, pipes, etc).
.nf
.nf
# Create a new configmap named my\-config with keys for each file in folder bar
# Create a new configmap named my\-config with keys for each file in folder bar
kubectl create configmap
generic
my\-config \-\-from\-file=path/to/bar
kubectl create configmap my\-config \-\-from\-file=path/to/bar
# Create a new configmap named my\-config with specified keys instead of names on disk
# Create a new configmap named my\-config with specified keys instead of names on disk
kubectl create configmap
generic my\-config \-\-from\-file=ssh\-privatekey=\~/.ssh/id\_rsa \-\-from\-file=ssh\-publickey=\~/.ssh/id\_rsa.pub
kubectl create configmap
my\-config \-\-from\-file=key1=/path/to/bar/file1.txt \-\-from\-file=key2=/path/to/bar/file2.txt
# Create a new configMap named my\-config with key1=config1 and key2=config2
# Create a new configMap named my\-config with key1=config1 and key2=config2
kubectl create configmap
generic
my\-config \-\-from\-literal=key1=config1 \-\-from\-literal=key2=config2
kubectl create configmap my\-config \-\-from\-literal=key1=config1 \-\-from\-literal=key2=config2
.fi
.fi
.RE
.RE
...
...
docs/user-guide/kubectl/kubectl_create_configmap.md
View file @
b930d58f
...
@@ -52,20 +52,20 @@ symlinks, devices, pipes, etc).
...
@@ -52,20 +52,20 @@ symlinks, devices, pipes, etc).
```
```
kubectl create configmap NAME [--
type=string] [--
from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]
kubectl create configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]
```
```
### Examples
### Examples
```
```
# Create a new configmap named my-config with keys for each file in folder bar
# Create a new configmap named my-config with keys for each file in folder bar
kubectl create configmap
generic
my-config --from-file=path/to/bar
kubectl create configmap my-config --from-file=path/to/bar
# Create a new configmap named my-config with specified keys instead of names on disk
# Create a new configmap named my-config with specified keys instead of names on disk
kubectl create configmap
generic my-config --from-file=ssh-privatekey=~/.ssh/id_rsa --from-file=ssh-publickey=~/.ssh/id_rsa.pub
kubectl create configmap
my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt
# Create a new configMap named my-config with key1=config1 and key2=config2
# Create a new configMap named my-config with key1=config1 and key2=config2
kubectl create configmap
generic
my-config --from-literal=key1=config1 --from-literal=key2=config2
kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2
```
```
### Options
### Options
...
@@ -119,7 +119,7 @@ kubectl create configmap NAME [--type=string] [--from-file=[key=]source] [--from
...
@@ -119,7 +119,7 @@ kubectl create configmap NAME [--type=string] [--from-file=[key=]source] [--from
*
[
kubectl create
](
kubectl_create.md
)
- Create a resource by filename or stdin
*
[
kubectl create
](
kubectl_create.md
)
- Create a resource by filename or stdin
###### Auto generated by spf13/cobra on
5
-Apr-2016
###### Auto generated by spf13/cobra on
29
-Apr-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[

]()
[

]()
...
...
pkg/kubectl/cmd/create_configmap.go
View file @
b930d58f
...
@@ -40,19 +40,19 @@ symlinks, devices, pipes, etc).
...
@@ -40,19 +40,19 @@ symlinks, devices, pipes, etc).
`
`
configMapExample
=
` # Create a new configmap named my-config with keys for each file in folder bar
configMapExample
=
` # Create a new configmap named my-config with keys for each file in folder bar
kubectl create configmap
generic
my-config --from-file=path/to/bar
kubectl create configmap my-config --from-file=path/to/bar
# Create a new configmap named my-config with specified keys instead of names on disk
# Create a new configmap named my-config with specified keys instead of names on disk
kubectl create configmap
generic my-config --from-file=ssh-privatekey=~/.ssh/id_rsa --from-file=ssh-publickey=~/.ssh/id_rsa.pub
kubectl create configmap
my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt
# Create a new configMap named my-config with key1=config1 and key2=config2
# Create a new configMap named my-config with key1=config1 and key2=config2
kubectl create configmap
generic
my-config --from-literal=key1=config1 --from-literal=key2=config2`
kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2`
)
)
// ConfigMap is a command to ease creating ConfigMaps.
// ConfigMap is a command to ease creating ConfigMaps.
func
NewCmdCreateConfigMap
(
f
*
cmdutil
.
Factory
,
cmdOut
io
.
Writer
)
*
cobra
.
Command
{
func
NewCmdCreateConfigMap
(
f
*
cmdutil
.
Factory
,
cmdOut
io
.
Writer
)
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"configmap NAME [--
type=string] [--
from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]"
,
Use
:
"configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]"
,
Short
:
"Create a configMap from a local file, directory or literal value."
,
Short
:
"Create a configMap from a local file, directory or literal value."
,
Long
:
configMapLong
,
Long
:
configMapLong
,
Example
:
configMapExample
,
Example
:
configMapExample
,
...
@@ -70,7 +70,7 @@ func NewCmdCreateConfigMap(f *cmdutil.Factory, cmdOut io.Writer) *cobra.Command
...
@@ -70,7 +70,7 @@ func NewCmdCreateConfigMap(f *cmdutil.Factory, cmdOut io.Writer) *cobra.Command
return
cmd
return
cmd
}
}
// CreateConfigMap is the implementation of the create configmap
generic
command.
// CreateConfigMap is the implementation of the create configmap command.
func
CreateConfigMap
(
f
*
cmdutil
.
Factory
,
cmdOut
io
.
Writer
,
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
func
CreateConfigMap
(
f
*
cmdutil
.
Factory
,
cmdOut
io
.
Writer
,
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
name
,
err
:=
NameFromCommandArgs
(
cmd
,
args
)
name
,
err
:=
NameFromCommandArgs
(
cmd
,
args
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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