@@ -7,17 +7,17 @@ import (
77// HttpState HTTP backend configuration.
88type HttpState struct {
99 Address string `mapstructure:"address"`
10- UpdateMethod string `mapstructure:"update_method" default:"POST" `
10+ UpdateMethod string `mapstructure:"update_method"`
1111 LockAddress string `mapstructure:"lock_address"`
12- LockMethod string `mapstructure:"lock_method" default:"LOCK" `
12+ LockMethod string `mapstructure:"lock_method"`
1313 UnlockAddress string `mapstructure:"unlock_address"`
14- UnlockMethod string `mapstructure:"unlock_method" default:"UNLOCK" `
14+ UnlockMethod string `mapstructure:"unlock_method"`
1515 Username string `mapstructure:"username"`
1616 Password string `mapstructure:"password"`
1717 SkipCertVerification bool `mapstructure:"skip_cert_verification" default:"false"`
18- RetryMax int `mapstructure:"retry_max" default:"2" `
19- RetryWaitMin int `mapstructure:"retry_wait_min" default:"1" `
20- RetryWaitMax int `mapstructure:"retry_wait_max" default:"30" `
18+ RetryMax int `mapstructure:"retry_max"`
19+ RetryWaitMin int `mapstructure:"retry_wait_min"`
20+ RetryWaitMax int `mapstructure:"retry_wait_max"`
2121 ClientCertificatePEM string `mapstructure:"client_certificate_pem"`
2222 ClientPrivateKeyPEM string `mapstructure:"client_private_key_pem"`
2323 ClientCACertificatePEM string `mapstructure:"client_ca_certificate_pem"`
@@ -110,22 +110,8 @@ func (hr *HttpRenderer) RemoteState() (string, error) {
110110
111111 config = {
112112 address = "{{ .State.Address }}"
113+ {{- if .State.UpdateMethod }}
113114 update_method = "{{ .State.UpdateMethod }}"
114- {{- if .State.Username }}
115- username = "{{ .State.Username }}"
116- {{- end }}
117- {{- if .State.Password }}
118- password = "{{ .State.Password }}"
119- {{- end }}
120- skip_cert_verification = {{ .State.SkipCertVerification }}
121- {{- if gt .State.RetryMax 0 }}
122- retry_max = {{ .State.RetryMax }}
123- {{- end }}
124- {{- if gt .State.RetryWaitMin 0 }}
125- retry_wait_min = {{ .State.RetryWaitMin }}
126- {{- end }}
127- {{- if gt .State.RetryWaitMax 0 }}
128- retry_wait_max = {{ .State.RetryWaitMax }}
129115 {{- end }}
130116 }
131117 }
0 commit comments