func (z *ZookeeperCluster) SetTriggerRollingRestart(val bool) {
	z.Spec.TriggerRollingRestart = val
}
set the value of triggerRollingRestart function
package v1beta1
import (
	"fmt"
	"strings"
	v1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/api/resource"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
	DefaultZkContainerRepository = "pravega/zookeeper"
	DefaultZkContainerVersion = "0.2.13"
	DefaultZkContainerPolicy = "Always"
	DefaultTerminationGracePeriod = 30
	DefaultZookeeperCacheVolumeSize = "20Gi"
	DefaultReadinessProbeInitialDelaySeconds = 10
	DefaultReadinessProbePeriodSeconds = 10
	DefaultReadinessProbeFailureThreshold = 3
	DefaultReadinessProbeSuccessThreshold = 1
	DefaultReadinessProbeTimeoutSeconds = 10
	DefaultLivenessProbeInitialDelaySeconds = 10
	DefaultLivenessProbePeriodSeconds = 10
	DefaultLivenessProbeFailureThreshold = 3
	DefaultLivenessProbeTimeoutSeconds = 10
)
type ZookeeperClusterSpec struct {
	Image ContainerImage `json:"image,omitempty"`
	Labels map[string]string `json:"labels,omitempty"`
	Replicas int32 `json:"replicas,omitempty"`
	Ports []v1.ContainerPort `json:"ports,omitempty"`
	Pod PodPolicy `json:"pod,omitempty"`
	AdminServerService AdminServerServicePolicy `json:"adminServerService,omitempty"`
	ClientService ClientServicePolicy `json:"clientService,omitempty"`
	TriggerRollingRestart bool `json:"triggerRollingRestart,omitempty"`
	HeadlessService HeadlessServicePolicy `json:"headlessService,omitempty"`
	StorageType string `json:"storageType,omitempty"`
	Persistence *Persistence `json:"persistence,omitempty"`
	Ephemeral *Ephemeral `json:"ephemeral,omitempty"`
	Conf ZookeeperConfig `json:"config,omitempty"`
	DomainName string `json:"domainName,omitempty"`
	KubernetesClusterDomain string `json:"kubernetesClusterDomain,omitempty"`
	Containers []v1.Container `json:"containers,omitempty"`
	InitContainers []v1.Container `json:"initContainers,omitempty"`
	Volumes []v1.Volume `json:"volumes,omitempty"`
	VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
	Probes *Probes `json:"probes,omitempty"`
}
type Probes struct {
	ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
	LivenessProbe *Probe `json:"livenessProbe,omitempty"`
}
func (s *ZookeeperClusterSpec) withDefaults(z *ZookeeperCluster) (changed bool) {
	changed = s.Image.withDefaults()
	if s.Conf.withDefaults() {
		changed = true
	}
	if s.Replicas == 0 {
		s.Replicas = 3
		changed = true
	}
	if s.Probes == nil {
		changed = true
		s.Probes = &Probes{}
	}
	if s.Probes.withDefaults() {
		changed = true
	}
	if s.Ports == nil {
		s.Ports = []v1.ContainerPort{
			{
				Name:          "client",
				ContainerPort: 2181,
			},
			{
				Name:          "quorum",
				ContainerPort: 2888,
			},
			{
				Name:          "leader-election",
				ContainerPort: 3888,
			},
			{
				Name:          "metrics",
				ContainerPort: 7000,
			},
			{
				Name:          "admin-server",
				ContainerPort: 8080,
			},
		}
		changed = true
	} else {
		var (
			foundClient, foundQuorum, foundLeader, foundMetrics, foundAdmin bool
		)
		for i := 0; i < len(s.Ports); i++ {
			if s.Ports[i].Name == "client" {
				foundClient = true
			} else if s.Ports[i].Name == "quorum" {
				foundQuorum = true
			} else if s.Ports[i].Name == "leader-election" {
				foundLeader = true
			} else if s.Ports[i].Name == "metrics" {
				foundMetrics = true
			} else if s.Ports[i].Name == "admin-server" {
				foundAdmin = true
			}
		}
		if !foundClient {
			ports := v1.ContainerPort{Name: "client", ContainerPort: 2181}
			s.Ports = append(s.Ports, ports)
			changed = true
		}
		if !foundQuorum {
			ports := v1.ContainerPort{Name: "quorum", ContainerPort: 2888}
			s.Ports = append(s.Ports, ports)
			changed = true
		}
		if !foundLeader {
			ports := v1.ContainerPort{Name: "leader-election", ContainerPort: 3888}
			s.Ports = append(s.Ports, ports)
			changed = true
		}
		if !foundMetrics {
			ports := v1.ContainerPort{Name: "metrics", ContainerPort: 7000}
			s.Ports = append(s.Ports, ports)
			changed = true
		}
		if !foundAdmin {
			ports := v1.ContainerPort{Name: "admin-server", ContainerPort: 8080}
			s.Ports = append(s.Ports, ports)
			changed = true
		}
	}
	if z.Spec.Labels == nil {
		z.Spec.Labels = map[string]string{}
		changed = true
	}
	if _, ok := z.Spec.Labels["app"]; !ok {
		z.Spec.Labels["app"] = z.GetName()
		changed = true
	}
	if _, ok := z.Spec.Labels["release"]; !ok {
		z.Spec.Labels["release"] = z.GetName()
		changed = true
	}
	if s.Pod.withDefaults(z) {
		changed = true
	}
	if strings.EqualFold(s.StorageType, "ephemeral") {
		if s.Ephemeral == nil {
			s.Ephemeral = &Ephemeral{}
			s.Ephemeral.EmptyDirVolumeSource = v1.EmptyDirVolumeSource{}
			changed = true
		}
	} else {
		if s.Persistence == nil {
			s.StorageType = "persistence"
			s.Persistence = &Persistence{}
			changed = true
		}
		if s.Persistence.withDefaults() {
			s.StorageType = "persistence"
			changed = true
		}
	}
	return changed
}
type Probe struct {
	InitialDelaySeconds int32 `json:"initialDelaySeconds"`
	PeriodSeconds int32 `json:"periodSeconds"`
	FailureThreshold int32 `json:"failureThreshold"`
	SuccessThreshold int32 `json:"successThreshold"`
	TimeoutSeconds int32 `json:"timeoutSeconds"`
}
type ZookeeperCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec   ZookeeperClusterSpec   `json:"spec,omitempty"`
	Status ZookeeperClusterStatus `json:"status,omitempty"`
}
func (z *ZookeeperCluster) WithDefaults() bool {
	return z.Spec.withDefaults(z)
}
func (z *ZookeeperCluster) ConfigMapName() string {
	return fmt.Sprintf("%s-configmap", z.GetName())
}
func (z *ZookeeperCluster) GetKubernetesClusterDomain() string {
	if z.Spec.KubernetesClusterDomain == "" {
		return "cluster.local"
	}
	return z.Spec.KubernetesClusterDomain
}
func (z *ZookeeperCluster) ZookeeperPorts() Ports {
	ports := Ports{}
	for _, p := range z.Spec.Ports {
		if p.Name == "client" {
			ports.Client = p.ContainerPort
		} else if p.Name == "quorum" {
			ports.Quorum = p.ContainerPort
		} else if p.Name == "leader-election" {
			ports.Leader = p.ContainerPort
		} else if p.Name == "metrics" {
			ports.Metrics = p.ContainerPort
		} else if p.Name == "admin-server" {
			ports.AdminServer = p.ContainerPort
		}
	}
	return ports
}
func (z *ZookeeperCluster) GetClientServiceName() string {
	return fmt.Sprintf("%s-client", z.GetName())
}
func (z *ZookeeperCluster) GetAdminServerServiceName() string {
	return fmt.Sprintf("%s-admin-server", z.GetName())
}
func (z *ZookeeperCluster) GetTriggerRollingRestart() bool {
	return z.Spec.TriggerRollingRestart
}