var configMapLong … var configMapExample … type ConfigMapOptions … // NewConfigMapOptions creates a new *ConfigMapOptions with default value func NewConfigMapOptions(ioStreams genericiooptions.IOStreams) *ConfigMapOptions { … } // NewCmdCreateConfigMap creates the `create configmap` Cobra command func NewCmdCreateConfigMap(f cmdutil.Factory, ioStreams genericiooptions.IOStreams) *cobra.Command { … } // Complete loads data from the command line environment func (o *ConfigMapOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error { … } // Validate checks if ConfigMapOptions has sufficient value to run func (o *ConfigMapOptions) Validate() error { … } // Run calls createConfigMap and filled in value for configMap object func (o *ConfigMapOptions) Run() error { … } // createConfigMap fills in key value pair from the information given in // ConfigMapOptions into *corev1.ConfigMap func (o *ConfigMapOptions) createConfigMap() (*corev1.ConfigMap, error) { … } // handleConfigMapFromLiteralSources adds the specified literal source // information into the provided configMap. func handleConfigMapFromLiteralSources(configMap *corev1.ConfigMap, literalSources []string) error { … } // handleConfigMapFromFileSources adds the specified file source information // into the provided configMap func handleConfigMapFromFileSources(configMap *corev1.ConfigMap, fileSources []string) error { … } // handleConfigMapFromEnvFileSources adds the specified env file source information // into the provided configMap func handleConfigMapFromEnvFileSources(configMap *corev1.ConfigMap, envFileSources []string) error { … } // addKeyFromFileToConfigMap adds a key with the given name to a ConfigMap, populating // the value with the content of the given file path, or returns an error. func addKeyFromFileToConfigMap(configMap *corev1.ConfigMap, keyName, filePath string) error { … } // addKeyFromLiteralToConfigMap adds the given key and data to the given config map, // returning an error if the key is not valid or if the key already exists. func addKeyFromLiteralToConfigMap(configMap *corev1.ConfigMap, keyName, data string) error { … } // validateNewConfigMap checks whether the keyname is valid // Note, the rules for ConfigMap keys are the exact same as the ones for SecretKeys. func validateNewConfigMap(configMap *corev1.ConfigMap, keyName string) error { … }