diff --git a/server/channels/app/support_packet.go b/server/channels/app/support_packet.go index ff5772f6825..64bc709d221 100644 --- a/server/channels/app/support_packet.go +++ b/server/channels/app/support_packet.go @@ -150,7 +150,7 @@ func (a *App) generateSupportPacketYaml(c request.CTX) (*model.FileData, error) /* LDAP */ var vendorName, vendorVersion string - if ldap := a.Ldap(); ldap != nil { + if ldap := a.Ldap(); ldap != nil && (*a.Config().LdapSettings.Enable || *a.Config().LdapSettings.EnableSync) { vendorName, vendorVersion, err = ldap.GetVendorNameAndVendorVersion(c) if err != nil { rErr = multierror.Append(errors.Wrap(err, "error while getting LDAP vendor info")) diff --git a/server/channels/app/support_packet_test.go b/server/channels/app/support_packet_test.go index 8b91b814964..497a773a249 100644 --- a/server/channels/app/support_packet_test.go +++ b/server/channels/app/support_packet_test.go @@ -151,7 +151,21 @@ func TestGenerateSupportPacketYaml(t *testing.T) { assert.Equal(t, "FAIL: all broken", packet.FileStatus) }) - t.Run("no LDAP vendor info", func(t *testing.T) { + t.Run("no LDAP info if LDAP sync is disabled", func(t *testing.T) { + ldapMock := &emocks.LdapInterface{} + th.App.Channels().Ldap = ldapMock + + packet := generateSupportPacket(t) + + assert.Equal(t, "", packet.LdapVendorName) + assert.Equal(t, "", packet.LdapVendorVersion) + }) + + th.App.UpdateConfig(func(cfg *model.Config) { + cfg.LdapSettings.EnableSync = model.NewPointer(true) + }) + + t.Run("no LDAP vendor info found", func(t *testing.T) { ldapMock := &emocks.LdapInterface{} ldapMock.On( "GetVendorNameAndVendorVersion",