func validateComponents(cs Components) error {
	for _, c := range cs {
		if err := c.Validate(); err != nil {
			return err
		}
	}
	return nil
}
validateComponents validates the individual components as well as duplicate names in the total collection
package landscaper
import (
	"fmt"
	"reflect"
	"gopkg.in/validator.v2"
)
type Component struct {
	Name          string         `json:"name" validate:"nonzero,max=51"`
	Namespace     string         `json:"namespace"`
	Release       *Release       `json:"release" validate:"nonzero"`
	Configuration Configuration  `json:"configuration"`
	Environments  Configurations `json:"environments"`
	SecretsRaw    interface{}    `json:"secrets"`
	SecretNames   SecretNames    `json:"-"`
	SecretValues  SecretValues   `json:"-"`
}
type Components map[string]*Component
func NewComponent(name string, namespace string, release *Release, cfg Configuration, envs Configurations, secretNames SecretNames) *Component {
	cmp := &Component{
		Name:          name,
		Release:       release,
		Configuration: cfg,
		Environments:  envs,
		SecretNames:   secretNames,
		SecretValues:  SecretValues{},
		Namespace:     namespace,
	}
	if cmp.Configuration == nil {
		cmp.Configuration = Configuration{}
	}
	if cmp.Environments == nil {
		cmp.Environments = Configurations{}
	}
	if cmp.SecretNames == nil {
		cmp.SecretNames = SecretNames{}
	}
	m := &Metadata{}
	if cmp.Configuration.HasMetadata() {
		m, _ = cmp.Configuration.GetMetadata()
	}
	m.ReleaseVersion = cmp.Release.Version
	cmp.Configuration.SetMetadata(m)
	return cmp
}
func (c *Component) Validate() error {
	return validator.Validate(c)
}
func (c *Component) Equals(other *Component) bool {
	otherCopy := new(Component)
	*otherCopy = *other
	otherCopy.SecretNames = c.SecretNames
	return reflect.DeepEqual(c, otherCopy)
}