Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Resources.Container] Replace .NET 6 target with .NET 8 and add .NET Standard 2.0 target #2166

Merged
merged 4 commits into from
Oct 4, 2024
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
1 change: 0 additions & 1 deletion build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<NetFrameworkMinimumSupportedVersion>net462</NetFrameworkMinimumSupportedVersion>
<NetMinimumSupportedVersion>net6.0</NetMinimumSupportedVersion>
joegoldman2 marked this conversation as resolved.
Show resolved Hide resolved
<NetStandardMinimumSupportedVersion>netstandard2.0</NetStandardMinimumSupportedVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AnalysisLevel>latest-all</AnalysisLevel>
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Resources.Container/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Drop support for .NET 6 as this target is no longer supported
and add .NET 8/.NET Standard 2.0 targets.
([#2166](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2166))

## 1.0.0-beta.9

Released 2024-Jun-18
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Resources.Container/ContainerDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ private static string RemovePrefixAndSuffixIfNeeded(string input, int startIndex
{
containerId = GetIdFromLineV1(line);
}
#if NET
else if (cgroupVersion == ParseMode.V2 && line.Contains(Hostname, StringComparison.Ordinal))
#else
else if (cgroupVersion == ParseMode.V2 && line.Contains(Hostname))
#endif
{
containerId = GetIdFromLineV2(line);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(NetMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Extensions - Container Resource Detector from Container environment.</Description>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Resource Detectors for Container environment.</Description>
<MinVerTagPrefix>Resources.Container-</MinVerTagPrefix>
</PropertyGroup>

<!--Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property.-->
<!-- Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property. -->
<PropertyGroup>
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
</PropertyGroup>
Expand All @@ -20,4 +21,5 @@
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Unit test project for Container Detector for OpenTelemetry</Description>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
<TargetFrameworks>$(SupportedNetTargetsWithoutNet6)</TargetFrameworks>
<Description>Unit test project for Container Detector for OpenTelemetry.</Description>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Resources.Container\OpenTelemetry.Resources.Container.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>

</Project>
Loading