diff --git a/configuration/configuration_test.go b/configuration/configuration_test.go index 5d74d24a..c709c582 100644 --- a/configuration/configuration_test.go +++ b/configuration/configuration_test.go @@ -210,6 +210,8 @@ global set-var proc.threshold int(200),sub(proc.prio) set-var-fmt proc.bootid "%pid|%t" set-var-fmt proc.current_state "primary" + server-state-base /path + server-state-file serverstatefile presetenv first order setenv third sister resetenv first second diff --git a/configuration/global_test.go b/configuration/global_test.go index 499137ba..05b38807 100644 --- a/configuration/global_test.go +++ b/configuration/global_test.go @@ -171,6 +171,12 @@ func TestGetGlobal(t *testing.T) { if global.SpreadChecks != 10 { t.Errorf("SpreadChecks is %v, expected 10", global.SpreadChecks) } + if global.ServerStateBase != "/path" { + t.Errorf("ServerStateBase is %v, expected /path", global.ServerStateBase) + } + if global.ServerStateFile != "serverstatefile" { + t.Errorf("ServerStateFile is %v, expected serverstatefile", global.ServerStateFile) + } if global.WurflOptions.DataFile != "path" { t.Errorf("WurflDataFile is %v, expected path", global.WurflOptions.DataFile) } diff --git a/models/global.go b/models/global.go index 848c1172..f24f87dd 100644 --- a/models/global.go +++ b/models/global.go @@ -174,11 +174,6 @@ type Global struct { // limited quic LimitedQuic bool `json:"limited_quic,omitempty"` - // load server state from file - // Enum: [global local none] - // +kubebuilder:validation:Enum=global;local;none; - LoadServerStateFromFile string `json:"load_server_state_from_file,omitempty"` - // localpeer // Pattern: ^[^\s]+$ // +kubebuilder:validation:Pattern=`^[^\s]+$` @@ -496,10 +491,6 @@ func (m *Global) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateLoadServerStateFromFile(formats); err != nil { - res = append(res, err) - } - if err := m.validateLocalpeer(formats); err != nil { res = append(res, err) } @@ -1068,51 +1059,6 @@ func (m *Global) validateHttpclientSslVerify(formats strfmt.Registry) error { return nil } -var globalTypeLoadServerStateFromFilePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["global","local","none"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - globalTypeLoadServerStateFromFilePropEnum = append(globalTypeLoadServerStateFromFilePropEnum, v) - } -} - -const ( - - // GlobalLoadServerStateFromFileGlobal captures enum value "global" - GlobalLoadServerStateFromFileGlobal string = "global" - - // GlobalLoadServerStateFromFileLocal captures enum value "local" - GlobalLoadServerStateFromFileLocal string = "local" - - // GlobalLoadServerStateFromFileNone captures enum value "none" - GlobalLoadServerStateFromFileNone string = "none" -) - -// prop value enum -func (m *Global) validateLoadServerStateFromFileEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, globalTypeLoadServerStateFromFilePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Global) validateLoadServerStateFromFile(formats strfmt.Registry) error { - if swag.IsZero(m.LoadServerStateFromFile) { // not required - return nil - } - - // value enum - if err := m.validateLoadServerStateFromFileEnum("load_server_state_from_file", "body", m.LoadServerStateFromFile); err != nil { - return err - } - - return nil -} - func (m *Global) validateLocalpeer(formats strfmt.Registry) error { if swag.IsZero(m.Localpeer) { // not required return nil diff --git a/models/global_compare.go b/models/global_compare.go index fe390b0e..d556cc3e 100644 --- a/models/global_compare.go +++ b/models/global_compare.go @@ -305,10 +305,6 @@ func (s Global) Equal(t Global, opts ...Options) bool { return false } - if s.LoadServerStateFromFile != t.LoadServerStateFromFile { - return false - } - if s.Localpeer != t.Localpeer { return false } @@ -1014,10 +1010,6 @@ func (s Global) Diff(t Global, opts ...Options) map[string][]interface{} { diff["LimitedQuic"] = []interface{}{s.LimitedQuic, t.LimitedQuic} } - if s.LoadServerStateFromFile != t.LoadServerStateFromFile { - diff["LoadServerStateFromFile"] = []interface{}{s.LoadServerStateFromFile, t.LoadServerStateFromFile} - } - if s.Localpeer != t.Localpeer { diff["Localpeer"] = []interface{}{s.Localpeer, t.Localpeer} } diff --git a/models/global_compare_test.go b/models/global_compare_test.go index ed425465..57c3690f 100644 --- a/models/global_compare_test.go +++ b/models/global_compare_test.go @@ -269,7 +269,7 @@ func TestGlobalDiffFalse(t *testing.T) { for _, sample := range samples { result := sample.a.Diff(sample.b) - if len(result) != 113 { + if len(result) != 112 { json := jsoniter.ConfigCompatibleWithStandardLibrary a, err := json.Marshal(&sample.a) if err != nil { @@ -279,7 +279,7 @@ func TestGlobalDiffFalse(t *testing.T) { if err != nil { t.Errorf(err.Error()) } - t.Errorf("Expected Global to be different in 113 cases, but it is not (%d) %s %s", len(result), a, b) + t.Errorf("Expected Global to be different in 112 cases, but it is not (%d) %s %s", len(result), a, b) } } } diff --git a/specification/build/haproxy_spec.yaml b/specification/build/haproxy_spec.yaml index 65023208..ff731d73 100644 --- a/specification/build/haproxy_spec.yaml +++ b/specification/build/haproxy_spec.yaml @@ -1212,12 +1212,6 @@ definitions: type: string limited_quic: type: boolean - load_server_state_from_file: - enum: - - global - - local - - none - type: string localpeer: pattern: ^[^\s]+$ type: string diff --git a/specification/models/configuration/global.yaml b/specification/models/configuration/global.yaml index a953fd84..3dcdc816 100644 --- a/specification/models/configuration/global.yaml +++ b/specification/models/configuration/global.yaml @@ -837,9 +837,6 @@ global: unsetenv: type: string x-display-name: Removes environment variables specified in arguments - load_server_state_from_file: - type: string - enum: [global, local, none] default_path: type: object required: