func (c OvpnTrafficConfig) DefaultedNameservers() []string {
	if c.Nameservers == nil || len(c.Nameservers) == 0 {
		return []string{"8.8.4.4", "8.8.8.8"}
	}
	result := []string{}
	for _, ip := range c.Nameservers {
		result = append(result, string(ip))
	}
	return result
}
DefaultedNameservers returns the provided nameservers or standard Google nameservers otherwise.
package v1alpha1
import (
	"fmt"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func (s OvpnServer) ObjectRefSharedSecrets() metav1.ObjectMeta {
	ref := metav1.ObjectMeta{
		Name:      s.Spec.Secrets.SharedSecretName,
		Namespace: s.Namespace,
	}
	if ref.Name == "" {
		ref.Name = fmt.Sprintf("%s-shared-secret", s.Name)
	}
	return ref
}
func (s *OvpnServer) ObjectRefCrlSecret() metav1.ObjectMeta {
	ref := metav1.ObjectMeta{
		Name:      s.Spec.Secrets.CrlName,
		Namespace: s.Namespace,
	}
	if ref.Name == "" {
		ref.Name = fmt.Sprintf("%s-crl", s.Name)
	}
	return ref
}
func (s *OvpnServer) ObjectRefServerCertificateSecret() metav1.ObjectMeta {
	ref := metav1.ObjectMeta{
		Name:      s.Spec.Secrets.ServerCertificateName,
		Namespace: s.Namespace,
	}
	if ref.Name == "" {
		ref.Name = fmt.Sprintf("%s-server-certificate", s.Name)
	}
	return ref
}
func (s *OvpnServer) ObjectRefOvpnConfigMap() metav1.ObjectMeta {
	ref := metav1.ObjectMeta{
		Name:      s.Spec.Deployment.OvpnConfigMapName,
		Namespace: s.Namespace,
	}
	if ref.Name == "" {
		ref.Name = fmt.Sprintf("%s-config", s.Name)
	}
	return ref
}
func (s *OvpnServer) ObjectRefEntrypointConfigMap() metav1.ObjectMeta {
	ref := metav1.ObjectMeta{
		Name:      s.Spec.Deployment.EntrypointConfigMapName,
		Namespace: s.Namespace,
	}
	if ref.Name == "" {
		ref.Name = fmt.Sprintf("%s-entrypoint", s.Name)
	}
	return ref
}
func (s *OvpnServer) ObjectRefDeployment() metav1.ObjectMeta {
	ref := metav1.ObjectMeta{
		Name:      s.Spec.Deployment.Name,
		Namespace: s.Namespace,
	}
	if ref.Name == "" {
		ref.Name = s.Name
	}
	return ref
}
func (s *OvpnServer) ObjectRefService() metav1.ObjectMeta {
	ref := metav1.ObjectMeta{
		Name:      s.Spec.Service.Name,
		Namespace: s.Namespace,
	}
	if ref.Name == "" {
		ref.Name = s.Name
	}
	return ref
}
func (a OvpnServerAddress) DefaultedProtocol() corev1.Protocol {
	if a.Protocol == "" {
		return corev1.ProtocolUDP
	}
	return a.Protocol
}