MM-14560 Changed local image proxy to be off by default (#10444)

Этот коммит содержится в:
Harrison Healey
2019-03-13 15:57:18 -04:00
коммит произвёл GitHub
родитель dc94e660d1
Коммит 3bbec7e954
3 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@@ -415,7 +415,7 @@
"PluginStates": {} "PluginStates": {}
}, },
"ImageProxySettings": { "ImageProxySettings": {
"Enable": true, "Enable": false,
"ImageProxyType": "local", "ImageProxyType": "local",
"RemoteImageProxyURL": "", "RemoteImageProxyURL": "",
"RemoteImageProxyOptions": "" "RemoteImageProxyOptions": ""

Просмотреть файл

@@ -2168,7 +2168,11 @@ type ImageProxySettings struct {
func (ips *ImageProxySettings) SetDefaults(ss ServiceSettings) { func (ips *ImageProxySettings) SetDefaults(ss ServiceSettings) {
if ips.Enable == nil { if ips.Enable == nil {
ips.Enable = NewBool(true) if ss.DEPRECATED_DO_NOT_USE_ImageProxyType == nil || *ss.DEPRECATED_DO_NOT_USE_ImageProxyType == "" {
ips.Enable = NewBool(false)
} else {
ips.Enable = NewBool(true)
}
} }
if ips.ImageProxyType == nil { if ips.ImageProxyType == nil {

Просмотреть файл

@@ -601,7 +601,7 @@ func TestImageProxySettingsSetDefaults(t *testing.T) {
ips := ImageProxySettings{} ips := ImageProxySettings{}
ips.SetDefaults(ServiceSettings{}) ips.SetDefaults(ServiceSettings{})
assert.Equal(t, true, *ips.Enable) assert.Equal(t, false, *ips.Enable)
assert.Equal(t, IMAGE_PROXY_TYPE_LOCAL, *ips.ImageProxyType) assert.Equal(t, IMAGE_PROXY_TYPE_LOCAL, *ips.ImageProxyType)
assert.Equal(t, "", *ips.RemoteImageProxyURL) assert.Equal(t, "", *ips.RemoteImageProxyURL)
assert.Equal(t, "", *ips.RemoteImageProxyOptions) assert.Equal(t, "", *ips.RemoteImageProxyOptions)