7 instantiations of ContainerMountAnnotation
Aspire.Hosting (3)
ContainerResourceBuilderExtensions.cs (3)
64var annotation = new ContainerMountAnnotation(name, target, ContainerMountType.Volume, isReadOnly); 80var annotation = new ContainerMountAnnotation(null, target, ContainerMountType.Volume, false); 99var annotation = new ContainerMountAnnotation(Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory), target, ContainerMountType.BindMount, isReadOnly);
Aspire.Hosting.Containers.Tests (3)
ContainerMountAnnotationTests.cs (3)
17Assert.Throws<ArgumentNullException>("source", () => new ContainerMountAnnotation(source, "/usr/foo", ContainerMountType.BindMount, false)); 24Assert.Throws<ArgumentException>("source", () => new ContainerMountAnnotation("usr/foo", "/usr/foo", ContainerMountType.BindMount, false)); 30Assert.Throws<ArgumentException>("isReadOnly", () => new ContainerMountAnnotation(null, "/usr/foo", ContainerMountType.Volume, true));
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationExtensions.cs (1)
74var newMount = new ContainerMountAnnotation(newName, volume.Target, ContainerMountType.Volume, volume.IsReadOnly);
68 references to ContainerMountAnnotation
Aspire.Hosting (9)
ApplicationModel\ResourceExtensions.cs (2)
228public static bool TryGetContainerMounts(this IResource resource, [NotNullWhen(true)] out IEnumerable<ContainerMountAnnotation>? volumeMounts) 230return TryGetAnnotationsOfType<ContainerMountAnnotation>(resource, out volumeMounts);
ContainerResourceBuilderExtensions.cs (3)
64var annotation = new ContainerMountAnnotation(name, target, ContainerMountType.Volume, isReadOnly); 80var annotation = new ContainerMountAnnotation(null, target, ContainerMountType.Volume, false); 99var annotation = new ContainerMountAnnotation(Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory), target, ContainerMountType.BindMount, isReadOnly);
Dcp\ApplicationExecutor.cs (1)
1485foreach (var mount in containerMounts)
Publishing\ManifestPublishingContext.cs (3)
586if (container.TryGetAnnotationsOfType<ContainerMountAnnotation>(out var mounts)) 595foreach (var bindMount in bindMounts) 621foreach (var volume in volumes)
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
551foreach (var volume in mounts)
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
209var configFileMount = emulatorResource.Annotations.OfType<ContainerMountAnnotation>().Single(v => v.Target == AzureEventHubsEmulatorResource.EmulatorConfigJsonPath);
Aspire.Hosting.Azure.Tests (16)
AzureEventHubsExtensionsTests.cs (8)
109var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 126var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 143var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 160var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json"));
AzureResourceExtensionsTests.cs (8)
33var volumeAnnotation = storage.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 59var volumeAnnotation = storage.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 85var volumeAnnotation = storage.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 111var volumeAnnotation = storage.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Containers.Tests (2)
ContainerResourceTests.cs (2)
175Assert.True(containerResource.TryGetLastAnnotation<ContainerMountAnnotation>(out var mountAnnotation));
Aspire.Hosting.Garnet.Tests (4)
AddGarnetTests.cs (4)
130var volumeAnnotation = garnet.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 155var volumeAnnotation = garnet.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Kafka.Tests (4)
AddKafkaTests.cs (4)
123var volumeAnnotation = kafka.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 141var volumeAnnotation = kafka.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Keycloak.Tests (6)
KeycloakResourceBuilderTests.cs (6)
53var volumeAnnotation = keycloak.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 68var volumeAnnotation = keycloak.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 99var containerAnnotation = keycloak.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.MySql.Tests (4)
AddMySqlTests.cs (4)
261var volume = container.Annotations.OfType<ContainerMountAnnotation>().Single(); 279var volume = myAdmin.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Nats.Tests (2)
AddNatsTests.cs (2)
141var mountAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerMountAnnotation>());
Aspire.Hosting.PostgreSQL (2)
PostgresBuilderExtensions.cs (2)
160var serverFileMount = pgAdminContainer.Annotations.OfType<ContainerMountAnnotation>().Single(v => v.Target == "/pgadmin4/servers.json"); 299var serverFileMount = adminResource.Annotations.OfType<ContainerMountAnnotation>().Single(v => v.Target == "/.pgweb/bookmarks");
Aspire.Hosting.PostgreSQL.Tests (6)
AddPostgresTests.cs (6)
381var volume = container.Annotations.OfType<ContainerMountAnnotation>().Single(); 464var volume = pgadmin.Annotations.OfType<ContainerMountAnnotation>().Single(); 511var volume = pgadmin.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Redis.Tests (4)
AddRedisTests.cs (4)
269var volumeAnnotation = redis.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 294var volumeAnnotation = redis.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Valkey.Tests (4)
AddValkeyTests.cs (4)
130var volumeAnnotation = valkey.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 155var volumeAnnotation = valkey.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Playground.Tests (3)
Infrastructure\DistributedApplicationExtensions.cs (3)
53.OfType<ContainerMountAnnotation>() 72var volume = resourceVolume.Volume; 74var newMount = new ContainerMountAnnotation(newName, volume.Target, ContainerMountType.Volume, volume.IsReadOnly);