Fixed: Don't block updates under docker unless configured in package_info
This commit is contained in:
parent
65323d5e87
commit
5a7e34e291
|
@ -328,6 +328,28 @@ namespace NzbDrone.Core.Test.UpdateTests
|
||||||
.Verify(v => v.SaveConfigDictionary(It.Is<Dictionary<string, object>>(d => d.ContainsKey("Branch") && (string)d["Branch"] == "fake")), Times.Once());
|
.Verify(v => v.SaveConfigDictionary(It.Is<Dictionary<string, object>>(d => d.ContainsKey("Branch") && (string)d["Branch"] == "fake")), Times.Once());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_not_update_with_built_in_updater_inside_docker_container()
|
||||||
|
{
|
||||||
|
Mocker.GetMock<IDeploymentInfoProvider>().Setup(x => x.PackageUpdateMechanism).Returns(UpdateMechanism.Docker);
|
||||||
|
|
||||||
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
|
Mocker.GetMock<IProcessProvider>()
|
||||||
|
.Verify(c => c.Start(It.IsAny<string>(), It.Is<string>(s => s.StartsWith("12")), null, null, null), Times.Never());
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_not_update_with_built_in_updater_when_external_updater_is_configured()
|
||||||
|
{
|
||||||
|
Mocker.GetMock<IDeploymentInfoProvider>().Setup(x => x.IsExternalUpdateMechanism).Returns(true);
|
||||||
|
|
||||||
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
|
Mocker.GetMock<IProcessProvider>()
|
||||||
|
.Verify(c => c.Start(It.IsAny<string>(), It.Is<string>(s => s.StartsWith("12")), null, null, null), Times.Never());
|
||||||
|
}
|
||||||
|
|
||||||
[TearDown]
|
[TearDown]
|
||||||
public void TearDown()
|
public void TearDown()
|
||||||
{
|
{
|
||||||
|
|
|
@ -237,18 +237,18 @@ namespace NzbDrone.Core.Update
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_osInfo.IsDocker)
|
|
||||||
{
|
|
||||||
_logger.ProgressDebug("Updating is disabled inside a docker container. Please update the container image.");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (OsInfo.IsNotWindows && !_configFileProvider.UpdateAutomatically && updateTrigger != CommandTrigger.Manual)
|
if (OsInfo.IsNotWindows && !_configFileProvider.UpdateAutomatically && updateTrigger != CommandTrigger.Manual)
|
||||||
{
|
{
|
||||||
_logger.ProgressDebug("Auto-update not enabled, not installing available update.");
|
_logger.ProgressDebug("Auto-update not enabled, not installing available update.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_configFileProvider.UpdateMechanism == UpdateMechanism.BuiltIn && _deploymentInfoProvider.PackageUpdateMechanism == UpdateMechanism.Docker)
|
||||||
|
{
|
||||||
|
_logger.ProgressDebug("Built-In updater disabled inside a docker container. Please update the container image.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// Safety net, ConfigureUpdateMechanism should take care of invalid settings
|
// Safety net, ConfigureUpdateMechanism should take care of invalid settings
|
||||||
if (_configFileProvider.UpdateMechanism == UpdateMechanism.BuiltIn && _deploymentInfoProvider.IsExternalUpdateMechanism)
|
if (_configFileProvider.UpdateMechanism == UpdateMechanism.BuiltIn && _deploymentInfoProvider.IsExternalUpdateMechanism)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue