Bug 1319665

Summary: [infrastructure_public_143]'oc create configmap' help info need update
Product: OpenShift Container Platform Reporter: DeShuai Ma <dma>
Component: NodeAssignee: Paul Morie <pmorie>
Status: CLOSED CURRENTRELEASE QA Contact: Xiaoli Tian <xtian>
Severity: low Docs Contact:
Priority: medium    
Version: 3.2.0CC: aos-bugs, gblomqui, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-03 15:19:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description DeShuai Ma 2016-03-21 10:00:44 UTC
Steps to Reproduce:
1.[root@openshift-116 dma]# oc create configmap --help
Create a configmap based on a file, directory, or specified literal value.

A single configmap may package one or more key/value pairs.

When creating a configmap based on a file, the key will default to the basename of the file, and the value will
default to the file content.  If the basename is an invalid key, you may specify an alternate key.

When creating a configmap based on a directory, each file whose basename is a valid key in the directory will be
packaged into the configmap.  Any directory entries except regular files are ignored (e.g. subdirectories,
symlinks, devices, pipes, etc).

Usage:
  oc create configmap NAME [--type=string] [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run] [options]

Examples:
  # Create a new configmap named my-config with keys for each file in folder bar
  oc create configmap generic my-config --from-file=path/to/bar
  
  # Create a new configmap named my-config with specified keys instead of names on disk
  oc create configmap generic my-config --from-file=ssh-privatekey=~/.ssh/id_rsa --from-file=ssh-publickey=~/.ssh/id_rsa.pub
  
  # Create a new configMap named my-config with key1=config1 and key2=config2
  oc create configmap generic my-config --from-literal=key1=config1 --from-literal=key2=config2

Options:
      --dry-run=false: If true, only print the object that would be sent, without sending it.
      --from-file=[]: Key files can be specified using their file path, in which case a default name will be given to them, or optionally with a name and file path, in which case the given name will be used.  Specifying a directory will iterate each named file in the directory that is a valid configmap key.
      --from-literal=[]: Specify a key and literal value to insert in configmap (i.e. mykey=somevalue)
      --generator='configmap/v1': The name of the API generator to use.
      --no-headers=false: When using the default output, don't print headers.
  -o, --output='': Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/release-1.2/docs/user-guide/jsonpath.md].
      --output-version='': Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
      --save-config=false: If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future.
      --schema-cache-dir='~/.kube/schema': If non-empty, load/store cached API schemas in this directory, default is '$HOME/.kube/schema'
  -a, --show-all=true: When printing, show all resources (false means hide terminated pods.)
      --show-labels=false: When printing, show all labels as the last column (default hide labels column)
      --sort-by='': If non-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
  -t, --template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
      --validate=false: If true, use a schema to validate the input before sending it

Use "oc options" for a list of global command-line options (applies to all commands).

Actual results:


Expected results:


Additional info:
[root@openshift-116 dma]# cat redis-config
maxmemory 2mb
maxmemory-policy allkeys-lru

[root@openshift-116 dma]# oc create configmap generic example-redis-config --from-file=redis-config -n dma
configmap "generic" created
[root@openshift-116 dma]# oc get configmap -n dma
NAME      DATA      AGE
generic   1         8s

Comment 1 Andy Goldstein 2016-03-21 18:41:17 UTC
Upstream PR: https://github.com/kubernetes/kubernetes/pull/23290

Comment 2 Andy Goldstein 2016-05-18 16:54:32 UTC
Paul, can you link in the replacement PR(s) and put this on qa assuming it went into 3.2?

Comment 3 Andy Goldstein 2016-06-22 10:52:27 UTC
https://github.com/kubernetes/kubernetes/pull/24994 merged upstream and it's in origin now, but it's not in ose yet.

Comment 5 Greg Blomquist 2019-07-03 15:19:42 UTC
Closing based on comment #3 and no activity in 4 years