Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Set Image and Registry Seperately
Rather than fudge the registry into the image name, set the registry property explicitly.
  • Loading branch information
afscrome committed Dec 17, 2025
commit becf466bb63edabf19f60252d939e4ce29ab11eb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public static IResourceBuilder<OpenTelemetryCollectorResource> AddOpenTelemetryC

var resource = new OpenTelemetryCollectorResource(name);
var resourceBuilder = builder.AddResource(resource)
.WithImage(settings.CollectorImage, settings.CollectorTag)
.WithImage(settings.Image, settings.CollectorTag)
.WithImageRegistry(settings.Registry)
.WithEnvironment("ASPIRE_ENDPOINT", new HostUrl(url))
.WithEnvironment("ASPIRE_API_KEY", builder.Configuration[DashboardOtlpApiKeyVariableName])
.WithIconName("DesktopPulse");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,8 @@ public void CollectorUsesCustomImageAndTag()
Assert.True(collectorResource.TryGetLastAnnotation(out ContainerImageAnnotation? imageAnnotations));
Assert.NotNull(imageAnnotations);
Assert.Equal("mytag", imageAnnotations.Tag);
Assert.Equal("myregistry.io/myorg/mycollector", imageAnnotations.Image);
// Registry is likely set to null/empty when the full path is provided as image
Assert.Null(imageAnnotations.Registry);
Assert.Equal("myorg/mycollector", imageAnnotations.Image);
Assert.Equal("myregistry.io", imageAnnotations.Registry);
}

[Fact]
Expand Down
Loading