Skip to content

Commit 15ad5bd

Browse files
authored
Move to net8.0 (#1463)
* Added net8.0 to the dotnet-version array used by actions * Changed framework version in Directory.Build.props * Removed unsed nuget * Update codeql-analysis.yml * Added net8.0 target framework * Updated code analyzer version to match net8.0 * Added net8.0 to tests * Updated sdk version * Updated version.json * Fixed build for non windows machines * Updated references in Directory.Build.targets * Added conditional exception handling to WatchServerDisconnect test case * Added missing project to solution
1 parent 00d78bc commit 15ad5bd

19 files changed

+91
-46
lines changed

Diff for: .github/workflows/buildtest.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
dotnet-version: |
1818
6.0.x
1919
7.0.x
20+
8.0.x
2021
# - name: Check Format
2122
# # don't check formatting on Windows b/c of CRLF issues.
2223
# if: matrix.os == 'ubuntu-latest'
@@ -68,6 +69,7 @@ jobs:
6869
dotnet-version: |
6970
6.0.x
7071
7.0.x
72+
8.0.x
7173
- name: Minikube
7274
run: minikube start
7375
- name: Test

Diff for: .github/workflows/codeql-analysis.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
3.1.x
3333
6.0.x
3434
7.0.x
35+
8.0.x
3536
3637
# Initializes the CodeQL tools for scanning.
3738
- name: Initialize CodeQL
@@ -43,8 +44,16 @@ jobs:
4344
# Prefix the list here with "+" to use these queries and those in the config file.
4445
# queries: ./path/to/local/query, your-org/your-repo/queries@main
4546

46-
- name: Autobuild
47-
uses: github/codeql-action/autobuild@v2
47+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
48+
# If this step fails, then you should remove it and run the build manually (see below)
49+
# Currently .NET8.0 isn't supported
50+
# - name: Autobuild
51+
# uses: github/codeql-action/autobuild@v2
52+
53+
- name: Restore dependencies
54+
run: dotnet restore
55+
- name: Build
56+
run: dotnet build --configuration Debug --no-restore
4857

4958
- name: Perform CodeQL Analysis
5059
uses: github/codeql-action/analyze@v2

Diff for: .github/workflows/docfx.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ jobs:
3434
with:
3535
dotnet-version: |
3636
6.0.x
37-
7.0.x
37+
7.0.x
38+
8.0.x
3839
3940
- name: Build
4041
run: dotnet build

Diff for: .github/workflows/draft.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
with:
2020
dotnet-version: |
2121
6.0.x
22-
7.0.x
22+
7.0.x
23+
8.0.x
2324
2425
- name: dotnet restore
2526
run: dotnet restore --verbosity minimal --configfile nuget.config
@@ -36,4 +37,4 @@ jobs:
3637
env:
3738
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3839
run: |
39-
gh release create -d --generate-notes v$env:NBGV_NuGetPackageVersion
40+
gh release create -d --generate-notes v$env:NBGV_NuGetPackageVersion

Diff for: .github/workflows/nuget.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
dotnet-version: |
2121
6.0.x
2222
7.0.x
23+
8.0.x
2324
2425
- name: dotnet restore
2526
run: dotnet restore --verbosity minimal --configfile nuget.config

Diff for: Directory.Build.targets

+21-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2-
<ItemGroup>
3-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
4-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4" PrivateAssets="all" />
5-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" />
6-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
7-
</ItemGroup>
2+
<ItemGroup>
3+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
4+
<PrivateAssets>all</PrivateAssets>
5+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
6+
</PackageReference>
7+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" >
8+
<PrivateAssets>all</PrivateAssets>
9+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
10+
</PackageReference>
11+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133">
12+
<PrivateAssets>all</PrivateAssets>
13+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
14+
</PackageReference>
15+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
16+
<PrivateAssets>all</PrivateAssets>
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
18+
</PackageReference>
19+
</ItemGroup>
820

9-
<ItemGroup>
10-
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" Visible="false" />
11-
</ItemGroup>
21+
<ItemGroup>
22+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" Visible="false" />
23+
</ItemGroup>
1224
</Project>

Diff for: examples/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66
</Project>

Diff for: examples/openTelemetryConsole/openTelemetryConsole.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="OpenTelemetry" Version="1.6.0" />
1110
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.6.0" />
1211
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc9.14" />
1312
</ItemGroup>

Diff for: global.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
21
{
3-
"sdk": {
4-
"version": "7.0.100",
5-
"rollForward": "latestMajor"
6-
},
7-
"msbuild-sdks": {
8-
"Microsoft.Build.Traversal" : "4.1.0"
9-
}
2+
"sdk": {
3+
"version": "8.0.100",
4+
"rollForward": "latestMajor"
5+
},
6+
"msbuild-sdks": {
7+
"Microsoft.Build.Traversal": "4.1.0"
8+
}
109
}

Diff for: kubernetes-client.sln

+29-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
3D1864AA-1FFC-4512-BB13-46055E410F73
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
@@ -65,6 +65,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cp", "examples\cp\cp.csproj
6565
EndProject
6666
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KubernetesClient.ModelConverter", "src\KubernetesClient.ModelConverter\KubernetesClient.ModelConverter.csproj", "{F1C8276A-8A60-4362-96B8-A006314446AE}"
6767
EndProject
68+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibKubernetesGenerator", "src\LibKubernetesGenerator\generators\LibKubernetesGenerator\LibKubernetesGenerator.csproj", "{5EBC9C3E-855A-4757-800A-CC038DB491CF}"
69+
EndProject
70+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibKubernetesGenerator.Automapper", "src\LibKubernetesGenerator\generators\LibKubernetesGenerator.Automapper\LibKubernetesGenerator.Automapper.csproj", "{999C6150-4EC7-44E1-B4B9-77556F8A3B93}"
71+
EndProject
6872
Global
6973
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7074
Debug|Any CPU = Debug|Any CPU
@@ -255,18 +259,6 @@ Global
255259
{F06D4C3A-7825-43A8-832B-6BDE3D355486}.Release|x64.Build.0 = Release|Any CPU
256260
{F06D4C3A-7825-43A8-832B-6BDE3D355486}.Release|x86.ActiveCfg = Release|Any CPU
257261
{F06D4C3A-7825-43A8-832B-6BDE3D355486}.Release|x86.Build.0 = Release|Any CPU
258-
{64C71596-B916-46EF-8115-B53E238F79D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
259-
{64C71596-B916-46EF-8115-B53E238F79D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
260-
{64C71596-B916-46EF-8115-B53E238F79D4}.Debug|x64.ActiveCfg = Debug|Any CPU
261-
{64C71596-B916-46EF-8115-B53E238F79D4}.Debug|x64.Build.0 = Debug|Any CPU
262-
{64C71596-B916-46EF-8115-B53E238F79D4}.Debug|x86.ActiveCfg = Debug|Any CPU
263-
{64C71596-B916-46EF-8115-B53E238F79D4}.Debug|x86.Build.0 = Debug|Any CPU
264-
{64C71596-B916-46EF-8115-B53E238F79D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
265-
{64C71596-B916-46EF-8115-B53E238F79D4}.Release|Any CPU.Build.0 = Release|Any CPU
266-
{64C71596-B916-46EF-8115-B53E238F79D4}.Release|x64.ActiveCfg = Release|Any CPU
267-
{64C71596-B916-46EF-8115-B53E238F79D4}.Release|x64.Build.0 = Release|Any CPU
268-
{64C71596-B916-46EF-8115-B53E238F79D4}.Release|x86.ActiveCfg = Release|Any CPU
269-
{64C71596-B916-46EF-8115-B53E238F79D4}.Release|x86.Build.0 = Release|Any CPU
270262
{DFBB1025-BD22-459D-A04D-E2AB31E129E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
271263
{DFBB1025-BD22-459D-A04D-E2AB31E129E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
272264
{DFBB1025-BD22-459D-A04D-E2AB31E129E2}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -435,6 +427,30 @@ Global
435427
{F1C8276A-8A60-4362-96B8-A006314446AE}.Release|x64.Build.0 = Release|Any CPU
436428
{F1C8276A-8A60-4362-96B8-A006314446AE}.Release|x86.ActiveCfg = Release|Any CPU
437429
{F1C8276A-8A60-4362-96B8-A006314446AE}.Release|x86.Build.0 = Release|Any CPU
430+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
431+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
432+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Debug|x64.ActiveCfg = Debug|Any CPU
433+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Debug|x64.Build.0 = Debug|Any CPU
434+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Debug|x86.ActiveCfg = Debug|Any CPU
435+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Debug|x86.Build.0 = Debug|Any CPU
436+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
437+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Release|Any CPU.Build.0 = Release|Any CPU
438+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Release|x64.ActiveCfg = Release|Any CPU
439+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Release|x64.Build.0 = Release|Any CPU
440+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Release|x86.ActiveCfg = Release|Any CPU
441+
{5EBC9C3E-855A-4757-800A-CC038DB491CF}.Release|x86.Build.0 = Release|Any CPU
442+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
443+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Debug|Any CPU.Build.0 = Debug|Any CPU
444+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Debug|x64.ActiveCfg = Debug|Any CPU
445+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Debug|x64.Build.0 = Debug|Any CPU
446+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Debug|x86.ActiveCfg = Debug|Any CPU
447+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Debug|x86.Build.0 = Debug|Any CPU
448+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Release|Any CPU.ActiveCfg = Release|Any CPU
449+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Release|Any CPU.Build.0 = Release|Any CPU
450+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Release|x64.ActiveCfg = Release|Any CPU
451+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Release|x64.Build.0 = Release|Any CPU
452+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Release|x86.ActiveCfg = Release|Any CPU
453+
{999C6150-4EC7-44E1-B4B9-77556F8A3B93}.Release|x86.Build.0 = Release|Any CPU
438454
EndGlobalSection
439455
GlobalSection(SolutionProperties) = preSolution
440456
HideSolutionNode = FALSE

Diff for: src/KubernetesClient.Kubectl/KubernetesClient.Kubectl.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<RootNamespace>k8s.kubectl</RootNamespace>

Diff for: src/KubernetesClient.ModelConverter/KubernetesClient.ModelConverter.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
3+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
44
<RootNamespace>k8s.ModelConverter</RootNamespace>
55
</PropertyGroup>
66

Diff for: src/KubernetesClient/KubernetesClient.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
55
<RootNamespace>k8s</RootNamespace>
66
<!-- seems bug in net7 json generator, some types missing in its result
77
net8 is still in preview, will enable it after net8 release -->

Diff for: tests/E2E.Tests/E2E.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<IsPackable>false</IsPackable>
44
<SignAssembly>true</SignAssembly>
55
<RootNamespace>k8s.E2E</RootNamespace>
6-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
6+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
77
</PropertyGroup>
88

99
<ItemGroup>

Diff for: tests/Kubectl.Tests/Kubectl.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>

Diff for: tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<PropertyGroup>
33
<IsPackable>false</IsPackable>
44
<RootNamespace>k8s.Tests</RootNamespace>
5-
<TargetFramework Condition="'$(OS)' != 'Windows_NT'">net6.0</TargetFramework>
6-
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net48</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net7.0;net8.0</TargetFrameworks>
6+
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net7.0;net8.0;net48</TargetFrameworks>
77
</PropertyGroup>
88

99
<ItemGroup>

Diff for: tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<IsPackable>false</IsPackable>
44
<RootNamespace>k8s.Tests</RootNamespace>
5-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
5+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
66
</PropertyGroup>
77

88
<ItemGroup>

Diff for: tests/KubernetesClient.Tests/WatchTests.cs

+5
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,12 @@ public async Task WatchServerDisconnect()
409409
await Task.WhenAny(waitForClosed.WaitAsync(), Task.Delay(TestTimeout)).ConfigureAwait(false);
410410
Assert.True(waitForClosed.IsSet);
411411
Assert.False(watcher.Watching);
412+
413+
#if NET8_0_OR_GREATER
414+
Assert.IsType<HttpIOException>(exceptionCatched);
415+
#else
412416
Assert.IsType<IOException>(exceptionCatched);
417+
#endif
413418
}
414419
}
415420

Diff for: version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "12.1",
3+
"version": "12.2",
44
"publicReleaseRefSpec": [
55
"^refs/heads/master$",
66
"^refs/tags/v\\d+\\.\\d+\\.\\d+"

0 commit comments

Comments
 (0)