func (mc *ModuleConfig) LoadFromValues(values Values) (*ModuleConfig, error) {
	if moduleValuesData, hasModuleData := values[mc.ModuleConfigKey]; hasModuleData {
		switch v := moduleValuesData.(type) {
		case map[string]interface{}, []interface{}:
			data := map[string]interface{}{mc.ModuleConfigKey: v}
			values, err := NewValues(data)
			if err != nil {
				return nil, err
			}
			mc.Values = values
		default:
			return nil, fmt.Errorf("load '%s' values: module config should be array or map. Got: %s", mc.ModuleName, spew.Sdump(moduleValuesData))
		}
	}
	if moduleEnabled, hasModuleEnabled := values[mc.ModuleEnabledKey]; hasModuleEnabled {
		switch v := moduleEnabled.(type) {
		case bool:
			mc.WithEnabled(v)
		default:
			return nil, fmt.Errorf("load '%s' enable config: enabled value should be bool. Got: %#v", mc.ModuleName, moduleEnabled)
		}
	}
	return mc, nil
}
LoadFromValues loads module config from a map.

Values for module in `values` map are addressed by a key.
This key should be produced with ModuleNameToValuesKey.
package utils
import (
	"fmt"
	"strings"
	"github.com/davecgh/go-spew/spew"
	"sigs.k8s.io/yaml"
	utils_checksum "github.com/flant/shell-operator/pkg/utils/checksum"
)
var ModuleEnabled = true
var ModuleDisabled = false
type ModuleConfig struct {
	ModuleName       string
	IsEnabled        *bool
	Values           Values
	IsUpdated        bool
	ModuleConfigKey  string
	ModuleEnabledKey string
	RawConfig        []string
}
func (mc ModuleConfig) String() string {
	return fmt.Sprintf("Module(Name=%s IsEnabled=%v IsUpdated=%v Values:\n%s)", mc.ModuleName, mc.IsEnabled, mc.IsUpdated, mc.Values.DebugString())
}
func (mc *ModuleConfig) GetEnabled() string {
	switch {
	case mc.IsEnabled == nil:
		return "n/d"
	case *mc.IsEnabled:
		return "true"
	default:
		return "false"
	}
}
func NewModuleConfig(moduleName string) *ModuleConfig {
	return &ModuleConfig{
		ModuleName:       moduleName,
		IsEnabled:        nil,
		Values:           make(Values),
		ModuleConfigKey:  ModuleNameToValuesKey(moduleName),
		ModuleEnabledKey: ModuleNameToValuesKey(moduleName) + "Enabled",
		RawConfig:        make([]string, 0),
	}
}
func (mc *ModuleConfig) WithEnabled(v bool) *ModuleConfig {
	if v {
		mc.IsEnabled = &ModuleEnabled
	} else {
		mc.IsEnabled = &ModuleDisabled
	}
	return mc
}
func (mc *ModuleConfig) WithUpdated(v bool) *ModuleConfig {
	mc.IsUpdated = v
	return mc
}
func (mc *ModuleConfig) WithValues(values Values) *ModuleConfig {
	mc.Values = values
	return mc
}