Skip to content

Commit cc6d06a

Browse files
[Resources.Container] Replace .NET 6 target with .NET 8 and add .NET Standard 2.0 target (open-telemetry#2166)
Co-authored-by: joegoldman2 <[email protected]> Co-authored-by: Mikel Blanchard <[email protected]>
1 parent 5e7c50d commit cc6d06a

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

build/Common.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
88
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
99
<NetFrameworkMinimumSupportedVersion>net462</NetFrameworkMinimumSupportedVersion>
10-
<NetMinimumSupportedVersion>net6.0</NetMinimumSupportedVersion>
1110
<NetStandardMinimumSupportedVersion>netstandard2.0</NetStandardMinimumSupportedVersion>
1211
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1312
<AnalysisLevel>latest-all</AnalysisLevel>

src/OpenTelemetry.Resources.Container/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

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

711
Released 2024-Jun-18

src/OpenTelemetry.Resources.Container/ContainerDetector.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ private static string RemovePrefixAndSuffixIfNeeded(string input, int startIndex
152152
{
153153
containerId = GetIdFromLineV1(line);
154154
}
155+
#if NET
155156
else if (cgroupVersion == ParseMode.V2 && line.Contains(Hostname, StringComparison.Ordinal))
157+
#else
158+
else if (cgroupVersion == ParseMode.V2 && line.Contains(Hostname))
159+
#endif
156160
{
157161
containerId = GetIdFromLineV2(line);
158162
}

src/OpenTelemetry.Resources.Container/OpenTelemetry.Resources.Container.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
4-
<TargetFrameworks>$(NetMinimumSupportedVersion)</TargetFrameworks>
5-
<Description>OpenTelemetry Extensions - Container Resource Detector from Container environment.</Description>
5+
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
6+
<Description>OpenTelemetry Resource Detectors for Container environment.</Description>
67
<MinVerTagPrefix>Resources.Container-</MinVerTagPrefix>
78
</PropertyGroup>
89

9-
<!--Do not run Package Baseline Validation as this package has never released a stable version.
10-
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property.-->
10+
<!-- Do not run Package Baseline Validation as this package has never released a stable version.
11+
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property. -->
1112
<PropertyGroup>
1213
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
1314
</PropertyGroup>
@@ -20,4 +21,5 @@
2021
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
2122
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
2223
</ItemGroup>
24+
2325
</Project>
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

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

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

13-
<ItemGroup>
14-
<Folder Include="Resources\" />
15-
</ItemGroup>
16-
1713
</Project>

0 commit comments

Comments
 (0)