Example #1
0
        public Task <IRuntimeInfo> GetRuntimeInfoAsync()
        {
            IRuntimeInfo runtimeInfo = this.deploymentConfig.Runtime;

            if (runtimeInfo?.Type == "docker")
            {
                var platform = new DockerPlatformInfo(this.operatingSystemType, this.architecture, this.version);
                DockerRuntimeConfig config = (runtimeInfo as DockerRuntimeInfo)?.Config;
                runtimeInfo = new DockerReportedRuntimeInfo(runtimeInfo.Type, config, platform);
            }
            else if (runtimeInfo == null || runtimeInfo is UnknownRuntimeInfo)
            {
                var platform = new DockerPlatformInfo(this.operatingSystemType, this.architecture, this.version);
                runtimeInfo = new DockerReportedUnknownRuntimeInfo(platform);
            }

            return(Task.FromResult(runtimeInfo));
        }
 public DockerReportedRuntimeInfo(string type, DockerRuntimeConfig config, DockerPlatformInfo platform)
     : base(type, config)
 {
     this.Platform = Preconditions.CheckNotNull(platform);
 }