26 instantiations of ContainerWorkload
Aspire.Hosting.Native.Core.Tests (23)
DcpWorkloadCleanupTests.cs (7)
24var plan = new ContainerWorkload("example:1", 6379, [], []); 40var plan = new ContainerWorkload("example:1", 6379, [], []); 150await owner.StartWorkload(new ContainerWorkload("example:1", 6379, [], [])); 182await owner.StartWorkload(new ContainerWorkload("example:1", 6379, [], [])); 208owner.StartWorkload(new ContainerWorkload("example:1", 6379, [], []))); 235() => new ContainerWorkload("example:1", 6379, [], []), executor, options.Runtime, 272new ContainerWorkload("example:1", 6379, [], []), TestContext.Current.CancellationToken);
DeclarativeApplicationTests.cs (3)
39model.SetWorkload(resource, DeclaredWorkload.Create(new ContainerWorkload("generic/service:1", null, [], [], [], []))); 85var original = DeclaredWorkload.Create(new ContainerWorkload("generic/service:1", null, [], [], [], [])); 90Plan = new ContainerWorkload("invalid image", null, [], [], [], [])
NativeTimeProviderTests.cs (4)
128var started = owner.StartWorkload(new ContainerWorkload("example:1", 0, [], [])); 166await owner.StartWorkload(new ContainerWorkload("example:1", 0, [], [])); 207var started = owner.StartWorkload(new ContainerWorkload("example:1", 0, [], [])); 232await owner.StartWorkload(new ContainerWorkload("example:1", 0, [], []));
ResourceWorkloadTests.cs (3)
22owner.StartWorkload(new ContainerWorkload("example:1", 6379, [], []))); 92var webStart = webOwner.StartWorkload(new ContainerWorkload("example:1", 80, [], [])); 94await cacheOwner.StartWorkload(new ContainerWorkload("example:1", 6379, [], []));
SymbolicValueTests.cs (2)
79var sourcePlan = new ContainerWorkload("redis:8", 6379, [], []); 157var plan = new ContainerWorkload("redis:8", 6379, [], []);
WorkloadDefinitionTests.cs (4)
98WorkloadDefinition.Validate(new ContainerWorkload("example:1", null, [], [], [], endpoints)); 99WorkloadDefinition.Validate(new ContainerWorkload("example:1", null, [], [], [], [new("tcp", WorkloadProtocol.Tcp, "tcp", 65535, 65535, "")])); 102new ContainerWorkload("example:1", null, [], [], [], endpoints.Add(new("overflow", WorkloadProtocol.Tcp, "tcp", 33, 0, ""))))); 104new ContainerWorkload("example:1", null, [], [], [], [new("tcp", WorkloadProtocol.Tcp, "tcp", 65535, 65536, "")])));
Aspire.Hosting.Native.Server (3)
Api\DeclarativeWorkloadApi.cs (1)
16var plan = DeclaredWorkload.Create(new ContainerWorkload(image, null, [], [], [], []));
Api\RuntimeApi.cs (1)
170return new ContainerWorkload(container.Image, container.TargetPort,
Api\WorkloadApi.cs (1)
105var plan = new ContainerWorkload(launch.Image, launch.Entrypoint.Length == 0 ? null : launch.Entrypoint,
42 references to ContainerWorkload
Aspire.Hosting.Native.Core (10)
Model\DeclaredWorkload.cs (2)
42(ContainerWorkload first, ContainerWorkload second) => first.Image == second.Image && first.Command == second.Command &&
Runtime\DeclarativeApplication.cs (2)
105var context = workload.Plan is ContainerWorkload ? ValueNetworkContext.Container : ValueNetworkContext.Host; 205var context = workload.Plan is ContainerWorkload ? ValueNetworkContext.Container : ValueNetworkContext.Host;
Runtime\RuntimeGeneration.cs (1)
295var expectedContext = template is ContainerWorkload ? ValueNetworkContext.Container : ValueNetworkContext.Host;
Runtime\SymbolicWorkload.cs (1)
36ContainerWorkload container => container with { Variables = environment, Args = arguments },
Runtime\WorkloadDefinition.cs (4)
34case ContainerWorkload container: 76if (plan is ContainerWorkload && (endpoint.TargetPort == 0 || endpoint.EnvironmentVariable.Length > 0) || 85private static void ValidateContainer(ContainerWorkload plan, bool requireLocalPaths) 101private static void ValidateMounts(ContainerWorkload plan, bool requireLocalPaths)
Aspire.Hosting.Native.Core.Tests (14)
DcpWorkloadCleanupTests.cs (2)
24var plan = new ContainerWorkload("example:1", 6379, [], []); 40var plan = new ContainerWorkload("example:1", 6379, [], []);
DeclarativeApplicationTests.cs (4)
152var container = Assert.IsType<ContainerWorkload>(workload.Plan); 301StatusForPlan = plan => new(plan is ContainerWorkload ? WorkloadPhase.Running : WorkloadPhase.Exited, 1), 353StatusForPlan = plan => new(plan is ContainerWorkload ? WorkloadPhase.Running : WorkloadPhase.Exited, 0)
NativeBuilderAuthoringTests.cs (1)
142executor.Plans.Select(plan => Assert.Single(Assert.IsType<Aspire.Hosting.Native.Runtime.ContainerWorkload>(plan).Mounts)));
NativeProviderLifecycleTests.cs (1)
636StatusForPlan = plan => new(plan is ContainerWorkload ? WorkloadPhase.Running : WorkloadPhase.Exited, 0)
NativeRpcAuthoringTests.cs (2)
64var container = Assert.Single(executor.Plans.OfType<ContainerWorkload>());
SymbolicValueTests.cs (2)
79var sourcePlan = new ContainerWorkload("redis:8", 6379, [], []); 157var plan = new ContainerWorkload("redis:8", 6379, [], []);
WorkloadDefinitionTests.cs (2)
22var plan = Assert.IsType<ContainerWorkload>(Assert.Single(executor.Plans));
Aspire.Hosting.Native.Server (18)
Api\DeclarativeWorkloadApi.cs (5)
117ContainerWorkload container => (WorkloadPlan)(container with { Ports = ports }), 140ContainerWorkload container => (WorkloadPlan)(container with { Ports = ports }), 157if (current.Plan is not ContainerWorkload container) 174if (current.Plan is not ContainerWorkload container) 193if (current.Plan is not ContainerWorkload container)
Api\PublishingApi.cs (4)
65["kind"] = plan switch { ContainerWorkload => "container", ExecutableWorkload => "executable", _ => "resource" }, 66["image"] = (plan as ContainerWorkload)?.Image, 67["entrypoint"] = (plan as ContainerWorkload)?.Command, 80["mounts"] = new JsonArray(((plan as ContainerWorkload)?.Mounts ?? []).Select(mount => (JsonNode)new JsonObject
Api\RpcAuthoringApi.cs (1)
157if (current.Plan is not ContainerWorkload container || container.Image.Contains('@'))
Api\RuntimeApi.cs (1)
161private static ContainerWorkload ContainerPlan(ContainerLaunch container)
Api\WorkloadApi.cs (2)
95private static ContainerWorkload CreateContainerPlan(ContainerWorkloadLaunch launch) 105var plan = new ContainerWorkload(launch.Image, launch.Entrypoint.Length == 0 ? null : launch.Entrypoint,
Dcp\DcpWorkloadExecutor.cs (5)
38var collection = template is ContainerWorkload ? DcpResourceCollection.Containers : DcpResourceCollection.Executables; 98var collection = plan is ContainerWorkload ? DcpResourceCollection.Containers : DcpResourceCollection.Executables; 115new DcpServiceSpec(endpoint.Protocol, plan is ContainerWorkload ? DcpAddressAllocationMode.Proxyless : DcpAddressAllocationMode.Localhost) 129if (plan is ContainerWorkload container) 181var instanceId = plan is ContainerWorkload