func (b *Builder) WithNodeSelector(nodeselectors map[string]string) *Builder {
	if len(nodeselectors) == 0 {
		b.errs = append(
			b.errs,
			errors.New(
				"failed to build podtemplatespec object: missing nodeselectors",
			),
		)
		return b
	}
	if b.podtemplatespec.Object.Spec.NodeSelector == nil {
		return b.WithNodeSelectorNew(nodeselectors)
	}
	for key, value := range nodeselectors {
		b.podtemplatespec.Object.Spec.NodeSelector[key] = value
	}
	return b
}
WithNodeSelector merges the nodeselectors if present
with the provided arguments
package podtemplatespec
import (
	"github.com/openebs/dynamic-nfs-provisioner/pkg/kubernetes/api/core/v1/container"
	"github.com/openebs/dynamic-nfs-provisioner/pkg/kubernetes/api/core/v1/volume"
	errors "github.com/pkg/errors"
	corev1 "k8s.io/api/core/v1"
)
type PodTemplateSpec struct {
	Object *corev1.PodTemplateSpec
}
type Builder struct {
	podtemplatespec *PodTemplateSpec
	errs            []error
}
func NewBuilder() *Builder {
	return &Builder{
		podtemplatespec: &PodTemplateSpec{
			Object: &corev1.PodTemplateSpec{},
		},
	}
}
func (b *Builder) WithName(name string) *Builder {
	if len(name) == 0 {
		b.errs = append(
			b.errs,
			errors.New("failed to build podtemplatespec object: missing name"),
		)
		return b
	}
	b.podtemplatespec.Object.Name = name
	return b
}
func (b *Builder) WithNamespace(namespace string) *Builder {
	if len(namespace) == 0 {
		b.errs = append(
			b.errs,
			errors.New(
				"failed to build podtemplatespec object: missing namespace",
			),
		)
		return b
	}
	b.podtemplatespec.Object.Namespace = namespace
	return b
}
func (b *Builder) WithAnnotations(annotations map[string]string) *Builder {
	if len(annotations) == 0 {
		b.errs = append(
			b.errs,
			errors.New("failed to build deployment object: missing annotations"),
		)
		return b
	}
	if b.podtemplatespec.Object.Annotations == nil {
		return b.WithAnnotationsNew(annotations)
	}
	for key, value := range annotations {
		b.podtemplatespec.Object.Annotations[key] = value
	}
	return b
}
func (b *Builder) WithAnnotationsNew(annotations map[string]string) *Builder {
	if len(annotations) == 0 {
		b.errs = append(
			b.errs,
			errors.New(
				"failed to build podtemplatespec object: missing annotations",
			),
		)
		return b
	}
	newannotations := map[string]string{}
	for key, value := range annotations {
		newannotations[key] = value
	}
	b.podtemplatespec.Object.Annotations = newannotations
	return b
}
func (b *Builder) WithLabels(labels map[string]string) *Builder {
	if len(labels) == 0 {
		b.errs = append(
			b.errs,
			errors.New(
				"failed to build podtemplatespec object: missing labels",
			),
		)
		return b
	}
	if b.podtemplatespec.Object.Labels == nil {
		return b.WithLabelsNew(labels)
	}
	for key, value := range labels {
		b.podtemplatespec.Object.Labels[key] = value
	}
	return b
}
func (b *Builder) WithLabelsNew(labels map[string]string) *Builder {
	if len(labels) == 0 {
		b.errs = append(
			b.errs,
			errors.New(
				"failed to build podtemplatespec object: missing labels",
			),
		)
		return b
	}
	newlbls := map[string]string{}
	for key, value := range labels {
		newlbls[key] = value
	}
	b.podtemplatespec.Object.Labels = newlbls
	return b
}
func (b *Builder) WithSecurityContext(
	podSecurityContext *corev1.PodSecurityContext) *Builder {
	if podSecurityContext == nil {
		return b
	}
	b.podtemplatespec.Object.Spec.SecurityContext = podSecurityContext
	return b
}