1 instantiation of ContainerExec
Aspire.Hosting (1)
Dcp\Model\ContainerExec.cs (1)
125
var containerExec = new
ContainerExec
(new ContainerExecSpec
30 references to ContainerExec
Aspire.Hosting (30)
Dcp\ContainerCreator.cs (12)
21
internal sealed class ContainerCreator : IObjectCreator<Container, ContainerNetworkEndpointContext>, IObjectCreator<
ContainerExec
, EmptyCreationContext>
189
var
containerExec =
ContainerExec
.Create(
201
var exeAppResource = new RenderedModelResource<
ContainerExec
>(containerExecutable, containerExec);
303
var containerExes = _appResources.Get().OfType<RenderedModelResource<
ContainerExec
>>().Where(ar => ar.DcpResource.Spec.ContainerName == dcpContainer.Metadata.Name).ToArray();
306
IObjectCreator<
ContainerExec
, EmptyCreationContext> containerExecCreator = this;
311
bool IObjectCreator<
ContainerExec
, EmptyCreationContext>.IsReadyToCreate(RenderedModelResource<
ContainerExec
> resource, EmptyCreationContext context)
314
async Task IObjectCreator<
ContainerExec
, EmptyCreationContext>.CreateObjectAsync(RenderedModelResource<
ContainerExec
> er, EmptyCreationContext context, ILogger _, IDcpObjectFactory factory, CancellationToken cancellationToken)
316
if (er.DcpResource is not
ContainerExec
containerExe)
318
throw new InvalidOperationException($"Expected an {nameof(
ContainerExec
)} resource, but got {er.DcpResourceKind} instead");
Dcp\DcpExecutor.cs (2)
347
ContainerExec
=> KnownResourceTypes.ContainerExec,
1072
ContainerExec
containerExec => s => _resourceWatcher.SnapshotBuilder.ToSnapshot(containerExec, s),
Dcp\DcpResourceState.cs (1)
14
public readonly ConcurrentDictionary<string,
ContainerExec
> ContainerExecsMap = [];
Dcp\DcpResourceWatcher.cs (9)
157
Task.Run(() => WatchKubernetesResourceAsync<
ContainerExec
>((t, r) => ProcessResourceChange(t, r, _resourceState.ContainerExecsMap, Model.Dcp.ContainerExecKind, (c, s) => _snapshotBuilder.ToSnapshot(c, s)))),
210
else if (_resourceState.ContainerExecsMap.TryGetValue(entry.ResourceName, out
var
containerExec))
550
resource is
ContainerExec
{ LogsAvailable: true };
575
if (resource is
ContainerExec
containerExec)
611
else if (_resourceState.ContainerExecsMap.TryGetValue(resourceName, out
var
containerExec))
613
enumerable = new ResourceLogSource<
ContainerExec
>(_logger, _kubernetesService, containerExec, follow: false);
654
ContainerExec
e when e.LogsAvailable => new ResourceLogSource<T>(_logger, _kubernetesService, resource, follow: true),
997
"ContainerExec" => _resourceState.ContainerExecsMap.TryGetValue(resourceName, out
var
containerExec) ? containerExec : null,
1030
else if (cr is
ContainerExec
containerExec)
Dcp\Model\ContainerExec.cs (4)
108
/// Create a new <see cref="
ContainerExec
"/> resource.
115
/// Create a new <see cref="
ContainerExec
"/> resource.
123
public static
ContainerExec
Create(string name, string containerName, string command, List<string>? args = null, string? workingDirectory = null)
125
var
containerExec = new ContainerExec(new ContainerExecSpec
Dcp\Model\GroupVersion.cs (1)
43
Schema.Add<
ContainerExec
>(ContainerExecKind, "containerexecs");
Dcp\ResourceSnapshotBuilder.cs (1)
98
public CustomResourceSnapshot ToSnapshot(
ContainerExec
executable, CustomResourceSnapshot previous)