Fix error handling for kubectl create configmap

This patch changes to return when `createConfigMap()` returns error.
This commit is contained in:
Kenjiro Nakayama 2021-05-07 18:03:03 +09:00
parent c08526c7f7
commit 6caf4d66bd

View File

@ -215,7 +215,7 @@ func (o *ConfigMapOptions) Validate() error {
func (o *ConfigMapOptions) Run() error {
configMap, err := o.createConfigMap()
if err != nil {
return nil
return err
}
if err := util.CreateOrUpdateAnnotation(o.CreateAnnotation, configMap, scheme.DefaultJSONEncoder()); err != nil {
return err