Skip to content

Commit e217d4b

Browse files
authored
Remove netcoreapp3.1 support (#235)
1 parent 7fc5b5c commit e217d4b

File tree

9 files changed

+9
-62
lines changed

9 files changed

+9
-62
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
component: sdk
2+
kind: Improvements
3+
body: Drop support for netcoreapp3.1
4+
time: 2024-03-04T21:00:58.198958Z
5+
custom:
6+
PR: "235"

sdk/Pulumi.Automation/Pulumi.Automation.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>netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0</TargetFrameworks>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<Authors>Pulumi</Authors>
77
<Company>Pulumi Corp.</Company>

sdk/Pulumi.Automation/Serialization/LocalSerializer.cs

-4
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ public static JsonSerializerOptions BuildJsonSerializerOptions()
6161
var options = new JsonSerializerOptions
6262
{
6363
AllowTrailingCommas = true,
64-
#if NETCOREAPP3_1
65-
IgnoreNullValues = true,
66-
#else
6764
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
68-
#endif
6965
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
7066
};
7167

sdk/Pulumi.FSharp/Pulumi.FSharp.fsproj

+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>netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0</TargetFrameworks>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<Authors>Pulumi</Authors>
77
<Company>Pulumi Corp.</Company>

sdk/Pulumi/Core/Output.cs

-46
Original file line numberDiff line numberDiff line change
@@ -270,33 +270,9 @@ async Task<OutputData<string>> GetData()
270270

271271
// This needs to handle nested potentially secret and unknown Output values, we do this by
272272
// hooking options to handle any seen Output<T> values.
273-
274-
// TODO: This can be simplified in net6.0 to just new System.Text.Json.JsonSerializerOptions(options);
275-
#if NETCOREAPP3_1
276-
var internalOptions = new System.Text.Json.JsonSerializerOptions();
277-
internalOptions.AllowTrailingCommas = options?.AllowTrailingCommas ?? internalOptions.AllowTrailingCommas;
278-
if (options != null)
279-
{
280-
foreach (var converter in options.Converters)
281-
{
282-
internalOptions.Converters.Add(converter);
283-
}
284-
}
285-
internalOptions.DefaultBufferSize = options?.DefaultBufferSize ?? internalOptions.DefaultBufferSize;
286-
internalOptions.DictionaryKeyPolicy = options?.DictionaryKeyPolicy ?? internalOptions.DictionaryKeyPolicy;
287-
internalOptions.Encoder = options?.Encoder ?? internalOptions.Encoder;
288-
internalOptions.IgnoreNullValues = options?.IgnoreNullValues ?? internalOptions.IgnoreNullValues;
289-
internalOptions.IgnoreReadOnlyProperties = options?.IgnoreReadOnlyProperties ?? internalOptions.IgnoreReadOnlyProperties;
290-
internalOptions.MaxDepth = options?.MaxDepth ?? internalOptions.MaxDepth;
291-
internalOptions.PropertyNameCaseInsensitive = options?.PropertyNameCaseInsensitive ?? internalOptions.PropertyNameCaseInsensitive;
292-
internalOptions.PropertyNamingPolicy = options?.PropertyNamingPolicy ?? internalOptions.PropertyNamingPolicy;
293-
internalOptions.ReadCommentHandling = options?.ReadCommentHandling ?? internalOptions.ReadCommentHandling;
294-
internalOptions.WriteIndented = options?.WriteIndented ?? internalOptions.WriteIndented;
295-
#else
296273
var internalOptions = options == null ?
297274
new System.Text.Json.JsonSerializerOptions() :
298275
new System.Text.Json.JsonSerializerOptions(options);
299-
#endif
300276

301277
// Add the magic converter to allow us to do nested outputs
302278
var outputConverter = new OutputJsonConverter(result.Resources, result.IsSecret);
@@ -341,31 +317,9 @@ async Task<OutputData<T>> GetData()
341317
return new OutputData<T>(result.Resources, default!, false, result.IsSecret);
342318
}
343319

344-
#if NETCOREAPP3_1
345-
var internalOptions = new System.Text.Json.JsonSerializerOptions();
346-
internalOptions.AllowTrailingCommas = options?.AllowTrailingCommas ?? internalOptions.AllowTrailingCommas;
347-
if (options != null)
348-
{
349-
foreach (var converter in options.Converters)
350-
{
351-
internalOptions.Converters.Add(converter);
352-
}
353-
}
354-
internalOptions.DefaultBufferSize = options?.DefaultBufferSize ?? internalOptions.DefaultBufferSize;
355-
internalOptions.DictionaryKeyPolicy = options?.DictionaryKeyPolicy ?? internalOptions.DictionaryKeyPolicy;
356-
internalOptions.Encoder = options?.Encoder ?? internalOptions.Encoder;
357-
internalOptions.IgnoreNullValues = options?.IgnoreNullValues ?? internalOptions.IgnoreNullValues;
358-
internalOptions.IgnoreReadOnlyProperties = options?.IgnoreReadOnlyProperties ?? internalOptions.IgnoreReadOnlyProperties;
359-
internalOptions.MaxDepth = options?.MaxDepth ?? internalOptions.MaxDepth;
360-
internalOptions.PropertyNameCaseInsensitive = options?.PropertyNameCaseInsensitive ?? internalOptions.PropertyNameCaseInsensitive;
361-
internalOptions.PropertyNamingPolicy = options?.PropertyNamingPolicy ?? internalOptions.PropertyNamingPolicy;
362-
internalOptions.ReadCommentHandling = options?.ReadCommentHandling ?? internalOptions.ReadCommentHandling;
363-
internalOptions.WriteIndented = options?.WriteIndented ?? internalOptions.WriteIndented;
364-
#else
365320
var internalOptions = options == null ?
366321
new System.Text.Json.JsonSerializerOptions() :
367322
new System.Text.Json.JsonSerializerOptions(options);
368-
#endif
369323

370324
// Add the magic converter to allow us to do nested outputs
371325
var outputConverter = new OutputJsonConverter(result.Resources, result.IsSecret);

sdk/Pulumi/Deployment/GrpcEngine.cs

-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ internal class GrpcEngine : IEngine
1717
private static readonly object _channelsLock = new object();
1818
public GrpcEngine(string engineAddress)
1919
{
20-
// Allow for insecure HTTP/2 transport (only needed for netcoreapp3.x)
21-
// https://docs.microsoft.com/en-us/aspnet/core/grpc/troubleshoot?view=aspnetcore-6.0#call-insecure-grpc-services-with-net-core-client
22-
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
2320
// maxRpcMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb)
2421
const int maxRpcMessageSize = 400 * 1024 * 1024;
2522
if (_engineChannels.TryGetValue(engineAddress, out var engineChannel))

sdk/Pulumi/Deployment/GrpcMonitor.cs

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ internal class GrpcMonitor : IMonitor
1919
private static readonly object _channelsLock = new object();
2020
public GrpcMonitor(string monitorAddress)
2121
{
22-
// Allow for insecure HTTP/2 transport (only needed for netcoreapp3.x)
23-
// https://docs.microsoft.com/en-us/aspnet/core/grpc/troubleshoot?view=aspnetcore-6.0#call-insecure-grpc-services-with-net-core-client
24-
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
2522
// maxRpcMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb)
2623
const int maxRpcMessageSize = 400 * 1024 * 1024;
2724
if (_monitorChannels.TryGetValue(monitorAddress, out var monitorChannel))

sdk/Pulumi/Provider/Host.cs

-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ internal class GrpcHost : IHost
9999
private static readonly object _channelsLock = new object();
100100
public GrpcHost(string engineAddress)
101101
{
102-
// Allow for insecure HTTP/2 transport (only needed for netcoreapp3.x)
103-
// https://docs.microsoft.com/en-us/aspnet/core/grpc/troubleshoot?view=aspnetcore-6.0#call-insecure-grpc-services-with-net-core-client
104-
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
105102
// maxRpcMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb)
106103
const int maxRpcMessageSize = 400 * 1024 * 1024;
107104
if (_engineChannels.TryGetValue(engineAddress, out var engineChannel))

sdk/Pulumi/Pulumi.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>netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0</TargetFrameworks>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<Authors>Pulumi</Authors>
77
<Company>Pulumi Corp.</Company>

0 commit comments

Comments
 (0)