func (b *Builder) AddRootCertPem(rootCert string) *Builder {
	if rootCert == "" {
		b.errors = append(b.errors, errors.New("unable to add empty root certificate key"))
		return b
	}
	b.caSecretOptions.secretDetails["root-cert.pem"] = []byte(rootCert)
	return b
}
AddRootCertPem adds RootCertPem Key in Secret's Data map.
package k8s
import (
	"context"
	"encoding/base64"
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/kubernetes"
	"github.com/tetratelabs/getmesh/internal/cacerts/providers/models"
	"github.com/tetratelabs/getmesh/internal/util"
	"github.com/tetratelabs/getmesh/internal/util/logger"
)
const IstioSecretName = "cacerts"
type IstioSecretDetails struct {
	secretDetails map[string][]byte
}
type Builder struct {
	caSecretOptions *IstioSecretDetails
	errors          []error
}
func NewBuilder() *Builder {
	return &Builder{
		caSecretOptions: &IstioSecretDetails{
			secretDetails: make(map[string][]byte),
		},
	}
}
func (b *Builder) Build() (*IstioSecretDetails, error) {
	if len(b.errors) != 0 {
		return nil, util.HandleMultipleErrors(b.errors)
	}
	return b.buildIstioSecretDetails(), nil
}
func (b *Builder) buildIstioSecretDetails() *IstioSecretDetails {
	return &IstioSecretDetails{
		secretDetails: b.caSecretOptions.secretDetails,
	}
}
func (b *Builder) AddCACert(caCert string) *Builder {
	if caCert == "" {
		b.errors = append(b.errors, errors.New("unable to add empty certificateauthority certificate key"))
		return b
	}
	b.caSecretOptions.secretDetails["ca-cert.pem"] = []byte(caCert)
	return b
}