@@ -56,6 +56,40 @@ type ServerGroupSpec struct {
5656 ServiceAccountName * string `json:"serviceAccountName,omitempty"`
5757 // NodeSelector speficies a set of selectors for nodes
5858 NodeSelector map [string ]string `json:"nodeSelector,omitempty"`
59+ // Probes specifies additional behaviour for probes
60+ Probes * ServerGroupProbesSpec `json:"probes,omitempty"`
61+ }
62+
63+ // ServerGroupProbesSpec contains specification for probes for pods of the server group
64+ type ServerGroupProbesSpec struct {
65+ // LivenessProbeDisabled if true livenessProbes are disabled
66+ LivenessProbeDisabled * bool `json:"livenessProbeDisabled,omitempty"`
67+ // LivenessProbeDisabled if specified the given probes is used as liveness probe
68+ //LivenessProbeOverride *v1.Probe `json:"LivenessProbeOverride,omitempty"`
69+ // LivenessProbeDisabled if true readinessProbes are disabled
70+ ReadinessProbeDisabled * bool `json:"ReadinessProbeDisabled,omitempty"`
71+ // ReadinessProbeOverride if specified the given probes is used as readiness probe
72+ //ReadinessProbeOverride *v1.Probe `json:"ReadinessProbeOverride,omitempty"`
73+ }
74+
75+ // // HasLivenessProbeOverride returns true if a livenessprobe override is set
76+ // func (s ServerGroupProbesSpec) HasLivenessProbeOverride() bool {
77+ // return s.LivenessProbeOverride != nil
78+ // }
79+
80+ // // HasReadinessProbeOverride returns true if a readinessprobe override is set
81+ // func (s ServerGroupProbesSpec) HasReadinessProbeOverride() bool {
82+ // return s.ReadinessProbeOverride != nil
83+ // }
84+
85+ // IsLivenessProbeDisabled returns true if liveness probes are disabled
86+ func (s ServerGroupProbesSpec ) IsLivenessProbeDisabled () bool {
87+ return util .BoolOrDefault (s .LivenessProbeDisabled )
88+ }
89+
90+ // IsReadinessProbeDisabled returns true if readiness probes are disabled
91+ func (s ServerGroupProbesSpec ) IsReadinessProbeDisabled () bool {
92+ return util .BoolOrDefault (s .ReadinessProbeDisabled )
5993}
6094
6195// GetCount returns the value of count.
@@ -98,6 +132,19 @@ func (s ServerGroupSpec) GetServiceAccountName() string {
98132 return util .StringOrDefault (s .ServiceAccountName )
99133}
100134
135+ // HasProbesSpec returns true if Probes is non nil
136+ func (s ServerGroupSpec ) HasProbesSpec () bool {
137+ return s .Probes != nil
138+ }
139+
140+ // GetProbesSpec returns the Probes spec or the nil value if not set
141+ func (s ServerGroupSpec ) GetProbesSpec () ServerGroupProbesSpec {
142+ if s .HasProbesSpec () {
143+ return * s .Probes
144+ }
145+ return ServerGroupProbesSpec {}
146+ }
147+
101148// Validate the given group spec
102149func (s ServerGroupSpec ) Validate (group ServerGroup , used bool , mode DeploymentMode , env Environment ) error {
103150 if used {
0 commit comments