22 references to WorkloadMountKind
Aspire.Hosting.Native.Core (11)
Runtime\RuntimeStates.cs (6)
57
public static
WorkloadMountKind
ParseMountKind(string value) => value switch
59
"bind" =>
WorkloadMountKind
.Bind,
60
"volume" =>
WorkloadMountKind
.Volume,
71
public static string ToWire(this
WorkloadMountKind
kind) => kind switch
73
WorkloadMountKind
.Bind => "bind",
74
WorkloadMountKind
.Volume => "volume",
Runtime\WorkloadDefinition.cs (5)
17
internal sealed record WorkloadMount(
WorkloadMountKind
Type, string Source, string Target, bool ReadOnly);
109
mount.Type is not (
WorkloadMountKind
.Bind or
WorkloadMountKind
.Volume) ||
110
mount.Type ==
WorkloadMountKind
.Bind && (!Path.IsPathFullyQualified(mount.Source) ||
112
mount.Type ==
WorkloadMountKind
.Volume && (mount.Source.Length is < 1 or > 255 ||
Aspire.Hosting.Native.Core.Tests (5)
DcpJsonTests.cs (2)
22
VolumeMounts = [new DcpVolumeMount(
WorkloadMountKind
.Volume, "retained-data", "/data", false),
23
new DcpVolumeMount(
WorkloadMountKind
.Bind, "/host/config", "/config", true)]
NativeBuilderAuthoringTests.cs (1)
141
Aspire.Hosting.Native.Runtime.
WorkloadMountKind
.Volume, volume, "/data", false)),
NativeProtocolParsingTests.cs (1)
99
Assert.Equal(
WorkloadMountKind
.Volume, RuntimeStates.ParseMountKind("volume"));
WorkloadDefinitionTests.cs (1)
25
Assert.Equal([new WorkloadMount(
WorkloadMountKind
.Volume, "retained-data", "/data", false)], plan.Mounts);
Aspire.Hosting.Native.Server (6)
Api\DeclarativeWorkloadApi.cs (2)
179
.Append(new WorkloadMount(
WorkloadMountKind
.Volume, name, target, readOnly)).ToImmutableArray();
198
.Append(new WorkloadMount(
WorkloadMountKind
.Bind, source, target, readOnly)).ToImmutableArray();
Dcp\DcpDataTypes.cs (1)
36
[property: JsonConverter(typeof(WorkloadMountKindConverter))]
WorkloadMountKind
Type, string Source, string Target, bool ReadOnly);
Dcp\DcpStates.cs (3)
101
internal sealed class WorkloadMountKindConverter : JsonConverter<
WorkloadMountKind
>
103
public override
WorkloadMountKind
Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
105
public override void Write(Utf8JsonWriter writer,
WorkloadMountKind
value, JsonSerializerOptions options) =>