Skip to content

Commit

Permalink
fix: ELB.BackendHttpKeepAliveの省略対応 (#188)
Browse files Browse the repository at this point in the history
BackendHttpKeepAliveはsafe or aggressiveの2値のみで空にすることはないためomitemptyを付与して対応
  • Loading branch information
yamamoto-febc authored Mar 28, 2023
1 parent 0b1e5c4 commit 8916655
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
24 changes: 12 additions & 12 deletions naked/proxylb.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ type ProxyLBSettings struct {

// ProxyLBSetting エンハンスドロードバランサ設定
type ProxyLBSetting struct {
HealthCheck ProxyLBHealthCheck `yaml:"health_check"` // ヘルスチェック
SorryServer ProxyLBSorryServer `yaml:"sorry_server"` // ソーリーサーバー
BindPorts []*ProxyLBBindPorts `yaml:"bind_ports"` // プロキシ方式(プロトコル&ポート)
Servers []ProxyLBServer `yaml:"servers"` // サーバー
Rules []ProxyLBRule `yaml:"rules"` // 振り分けルール
LetsEncrypt *ProxyLBACMESetting `json:",omitempty" yaml:"lets_encrypt,omitempty" structs:",omitempty"` // Let's encryptでの証明書取得設定
StickySession ProxyLBStickySession `yaml:"sticky_session"` // StickySession
Timeout ProxyLBTimeout `json:",omitempty" yaml:"timeout,omitempty" structs:",omitempty"` // タイムアウト
Gzip ProxyLBGzip `yaml:"gzip"` // Gzip
BackendHttpKeepAlive ProxyLBBackendHTTPKeepAlive `yaml:"backend_http_keey_alive"` // 実サーバとのHTTP持続接続
ProxyProtocol ProxyLBProxyProtocol `yaml:"proxy_protocol"`
Syslog ProxyLBSyslog `yaml:"syslog"`
HealthCheck ProxyLBHealthCheck `yaml:"health_check"` // ヘルスチェック
SorryServer ProxyLBSorryServer `yaml:"sorry_server"` // ソーリーサーバー
BindPorts []*ProxyLBBindPorts `yaml:"bind_ports"` // プロキシ方式(プロトコル&ポート)
Servers []ProxyLBServer `yaml:"servers"` // サーバー
Rules []ProxyLBRule `yaml:"rules"` // 振り分けルール
LetsEncrypt *ProxyLBACMESetting `json:",omitempty" yaml:"lets_encrypt,omitempty" structs:",omitempty"` // Let's encryptでの証明書取得設定
StickySession ProxyLBStickySession `yaml:"sticky_session"` // StickySession
Timeout ProxyLBTimeout `json:",omitempty" yaml:"timeout,omitempty" structs:",omitempty"` // タイムアウト
Gzip ProxyLBGzip `yaml:"gzip"` // Gzip
BackendHttpKeepAlive *ProxyLBBackendHTTPKeepAlive `json:",omitempty" yaml:",backend_http_keey_alive,omitempty" structs:",omitempty"` // 実サーバとのHTTP持続接続
ProxyProtocol ProxyLBProxyProtocol `yaml:"proxy_protocol"`
Syslog ProxyLBSyslog `yaml:"syslog"`
}

// MarshalJSON nullの場合に空配列を出力するための実装
Expand Down
3 changes: 0 additions & 3 deletions test/proxylb_op_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,6 @@ func initProxyLBVariables() {
Gzip: &iaas.ProxyLBGzip{
Enabled: false,
},
BackendHttpKeepAlive: &iaas.ProxyLBBackendHttpKeepAlive{
Mode: types.ProxyLBBackendHttpKeepAlive.Safe,
},
ProxyProtocol: &iaas.ProxyLBProxyProtocol{
Enabled: false,
},
Expand Down

0 comments on commit 8916655

Please sign in to comment.