private bool SwitchToScope(EngineScopeType scope) { if (scope == EngineScopeType.Linux) { var result = _host.LinuxDaemon(_certificates); return(null != result && result.Success); } var res = _host.WindowsDaemon(_certificates); return(null != res && res.Success); }
internal EngineScope(DockerUri host, EngineScopeType scope, ICertificatePaths certificates = null) { Scope = scope; _host = host; _certificates = certificates; _original = host.IsWindowsEngine(certificates) ? EngineScopeType.Windows : EngineScopeType.Linux; if (scope == _original) { return; } SwitchToScope(Scope); }
public bool UseWindows() { if (Scope == EngineScopeType.Windows) { return(true); } var success = SwitchToScope(EngineScopeType.Windows); if (success) { Scope = EngineScopeType.Windows; } return(success); }
public bool UseLinux() { if (Scope == EngineScopeType.Linux) { return(true); } var success = SwitchToScope(EngineScopeType.Linux); if (success) { Scope = EngineScopeType.Linux; } return(success); }
public static IEngineScope EngineScope(EngineScopeType scope, DockerUri host = null, ICertificatePaths certificates = null) { return(new EngineScope(host, scope, certificates)); }