func (c newConfigMap) Create() error {
	if err := checkExistence(c); err != nil {
		log.Println("Creating", c.Key())
		c.ConfigMap, err = c.Client.Create(c.ConfigMap)
		return err
	}
	return nil
}
Create looks for DaemonSet in k8s and creates it if not present
package resources
import (
	"log"
	"github.com/Mirantis/k8s-AppController/pkg/client"
	"github.com/Mirantis/k8s-AppController/pkg/interfaces"
	"github.com/Mirantis/k8s-AppController/pkg/report"
	corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
	"k8s.io/client-go/pkg/api/v1"
)
var configMapParamFields = []string{
	"Data.Keys",
}
type newConfigMap struct {
	Base
	ConfigMap *v1.ConfigMap
	Client    corev1.ConfigMapInterface
}
type existingConfigMap struct {
	Base
	Name   string
	Client corev1.ConfigMapInterface
}
type configMapTemplateFactory struct{}
func (configMapTemplateFactory) ShortName(definition client.ResourceDefinition) string {
	if definition.ConfigMap == nil {
		return ""
	}
	return definition.ConfigMap.Name
}
func (configMapTemplateFactory) Kind() string {
	return "configmap"
}
func (configMapTemplateFactory) New(def client.ResourceDefinition, c client.Interface, gc interfaces.GraphContext) interfaces.Resource {
	cm := parametrizeResource(def.ConfigMap, gc, configMapParamFields).(*v1.ConfigMap)
	return report.SimpleReporter{BaseResource: newConfigMap{Base: Base{def.Meta}, ConfigMap: cm, Client: c.ConfigMaps()}}
}
func (configMapTemplateFactory) NewExisting(name string, ci client.Interface, gc interfaces.GraphContext) interfaces.Resource {
	return report.SimpleReporter{BaseResource: existingConfigMap{Name: name, Client: ci.ConfigMaps()}}
}
func configMapKey(name string) string {
	return "configmap/" + name
}
func (c newConfigMap) Key() string {
	return configMapKey(c.ConfigMap.Name)
}
func configMapStatus(c corev1.ConfigMapInterface, name string) (interfaces.ResourceStatus, error) {
	_, err := c.Get(name)
	if err != nil {
		return interfaces.ResourceError, err
	}
	return interfaces.ResourceReady, nil
}
func (c newConfigMap) Status(meta map[string]string) (interfaces.ResourceStatus, error) {
	return configMapStatus(c.Client, c.ConfigMap.Name)
}