From 3bbec7e95444b8af96c46f280471b5d33d82f4e9 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Wed, 13 Mar 2019 15:57:18 -0400 Subject: [PATCH] MM-14560 Changed local image proxy to be off by default (#10444) --- config/default.json | 2 +- model/config.go | 6 +++++- model/config_test.go | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/default.json b/config/default.json index 8bb76cd38f..41fe64a1f2 100644 --- a/config/default.json +++ b/config/default.json @@ -415,7 +415,7 @@ "PluginStates": {} }, "ImageProxySettings": { - "Enable": true, + "Enable": false, "ImageProxyType": "local", "RemoteImageProxyURL": "", "RemoteImageProxyOptions": "" diff --git a/model/config.go b/model/config.go index 231ca80006..3d316ffb22 100644 --- a/model/config.go +++ b/model/config.go @@ -2168,7 +2168,11 @@ type ImageProxySettings struct { func (ips *ImageProxySettings) SetDefaults(ss ServiceSettings) { 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 { diff --git a/model/config_test.go b/model/config_test.go index 731e7070b8..6ed646c585 100644 --- a/model/config_test.go +++ b/model/config_test.go @@ -601,7 +601,7 @@ func TestImageProxySettingsSetDefaults(t *testing.T) { ips := ImageProxySettings{} 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, "", *ips.RemoteImageProxyURL) assert.Equal(t, "", *ips.RemoteImageProxyOptions)