Skip to content

Commit

Permalink
Aspire: update to nightly 8.0.0-preview.3.24072.10
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysFR committed Jan 23, 2024
1 parent 64faec4 commit af73f19
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Import Project="..\Common\VersionInfo.props" />

<ItemGroup>
<PackageReference Include="Aspire.Hosting" Version="8.0.0-preview.2.23619.3" />
<PackageReference Include="Aspire.Hosting" Version="8.0.0-preview.3.24072.10" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Aspire.FoundationDB.Hosting/FdbAspireHostingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private static IResourceBuilder<FdbContainerResource> ConfigureContainer(IResour
{
return container
.WithAnnotation(new ManifestPublishingCallbackAnnotation((ctx) => WriteFdbContainerToManifest(ctx, container.Resource)))
.WithAnnotation(new ServiceBindingAnnotation(ProtocolType.Tcp, port: container.Resource.Port, containerPort: 4550)) // default container port is set to 4550
.WithAnnotation(new EndpointAnnotation(ProtocolType.Tcp, port: container.Resource.Port, containerPort: 4550)) // default container port is set to 4550
.WithAnnotation(new ContainerImageAnnotation { Image = "foundationdb/foundationdb", Tag = container.Resource.DockerTag })
.WithVolumeMount("fdb_data", "/var/fdb/data", VolumeMountType.Named, isReadOnly: false) //HACKHACK: TODO: make this configurable!
.WithEnvironment((context) =>
Expand Down
2 changes: 2 additions & 0 deletions Aspire.FoundationDB.Hosting/FdbClusterResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Aspire.Hosting.ApplicationModel
using System.Globalization;
using System.Linq;
using System.Net;
using Doxense.Diagnostics.Contracts;
using FoundationDB.Client;

public class FdbClusterResource : Resource, IFdbResource
Expand Down Expand Up @@ -74,6 +75,7 @@ public int GetNextPort()

internal FdbContainerResource CreateContainer(string name, bool coordinator)
{
Contract.Debug.Requires(name != null);

var fdbContainer = new FdbContainerResource(name, this)
{
Expand Down
1 change: 1 addition & 0 deletions Aspire.FoundationDB.Hosting/FdbConnectionResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace Aspire.Hosting.ApplicationModel
{
using System;
using System.Data.Common;
using FoundationDB.Client;

Expand Down
8 changes: 6 additions & 2 deletions Aspire.FoundationDB.Hosting/FdbContainerResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ namespace Aspire.Hosting.ApplicationModel
{
using System.Linq;
using System.Net;
using Doxense.Diagnostics.Contracts;

public class FdbContainerResource : ContainerResource, IFdbResource, IResourceWithParent<FdbClusterResource>
{
public FdbContainerResource(string name, FdbClusterResource parent) : base(name)
{
Contract.NotNull(parent);
this.Parent = parent;
}

Expand All @@ -30,15 +32,17 @@ public FdbContainerResource(string name, FdbClusterResource parent) : base(name)

internal EndPoint GetEndpoint()
{
if (!this.TryGetServiceBindings(out var bindings))
if (!this.TryGetAllocatedEndPoints(out var bindings))
{
throw new DistributedApplicationException("Expected allocated endpoints!");
}

var allocatedEndpoint = bindings.Single();

//note: we expect the address to be "localhost".
Contract.Debug.Assert(allocatedEndpoint.Address == "localhost");
var addr = IPAddress.Loopback;
var port = allocatedEndpoint.Port ?? this.Port;
var port = allocatedEndpoint.Port;

return new IPEndPoint(addr, port);
}
Expand Down
1 change: 1 addition & 0 deletions Aspire.FoundationDB.Hosting/FdbVersionPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Aspire.Hosting.ApplicationModel
{
using System;

/// <summary>Specify the versionning rules for the FoundationDB docker image</summary>
public enum FdbVersionPolicy
{
/// <summary>Use the exact version specified</summary>
Expand Down

0 comments on commit af73f19

Please sign in to comment.