@@ -43,15 +43,16 @@ type (
4343 // It is disabled when it is empty.
4444 Review * Review `json:"review,omitempty" yaml:"review"`
4545
46- FreezeWindows []FreezeWindow `json:"freeze_windows" yaml:"freeze_windows"`
46+ // FrozenWindows is the list of windows to freeze deployments.
47+ FrozenWindows []FrozenWindow `json:"frozen_windows" yaml:"frozen_windows"`
4748 }
4849
4950 Review struct {
5051 Enabled bool `json:"enabled" yaml:"enabled"`
5152 Reviewers []string `json:"reviewers" yaml:"reviewers"`
5253 }
5354
54- FreezeWindow struct {
55+ FrozenWindow struct {
5556 Start string `json:"start" yaml:"start"`
5657 Duration string `json:"duration" yaml:"duration"`
5758 Location string `json:"location" yaml:"location"`
@@ -184,16 +185,16 @@ func (e *Env) HasReview() bool {
184185// IsFreezed verifies whether the current time is in a freeze window.
185186// It returns an error when parsing an expression is failed.
186187func (e * Env ) IsFreezed (t time.Time ) (bool , error ) {
187- if len (e .FreezeWindows ) == 0 {
188+ if len (e .FrozenWindows ) == 0 {
188189 return false , nil
189190 }
190191
191- for _ , w := range e .FreezeWindows {
192+ for _ , w := range e .FrozenWindows {
192193 s , err := cronexpr .ParseInLocation (strings .TrimSpace (w .Start ), w .Location )
193194 if err != nil {
194195 return false , eutil .NewErrorWithMessage (
195196 eutil .ErrorCodeConfigInvalid ,
196- fmt .Sprintf ("The crontab expression of the freeze window is invalid." ),
197+ fmt .Sprint ("The crontab expression of the freeze window is invalid." ),
197198 err ,
198199 )
199200 }
@@ -202,7 +203,7 @@ func (e *Env) IsFreezed(t time.Time) (bool, error) {
202203 if err != nil {
203204 return false , eutil .NewErrorWithMessage (
204205 eutil .ErrorCodeConfigInvalid ,
205- fmt .Sprintf ("The duration of the freeze window is invalid." ),
206+ fmt .Sprint ("The duration of the freeze window is invalid." ),
206207 err ,
207208 )
208209 }
0 commit comments