-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix accept secrets=false to configure provider with nested secrets (#641
) Fixes #640 panic when passing nested secret values to provider config Our current design for handling program-originating secrets in bridged providers is to basically let the engine (Pulumi CLI) handle it for us. Bridged providers return "acceptsSecrets=false" to the engine, which then does not pass secret bits to Configure or Create but instead passes plain data and does some heuristic matching on the resource/provider outputs to make sure secret data stays secret. Unfortunately due to how Configure was written in dockerHybridProvider struct here which multiplexes traffic between bridged and native providers, this information got lost and the docker provider returned acceptsSecrets=true to the engine, while not protecting the bridged provider from unexpected secrets. This caused a panic deep in the bridged provider when a secret was passed. The fix is to ensure the hybrid provider returns the same options as the bridgedProvider, with a notable exception of supportsPreview - which currently is supported in the bridged but not the native provider, and has to be disabled when mixing them into the hybrid provider.
- Loading branch information
Showing
7 changed files
with
93 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
examples/test-secrets-in-explicit-provider/csharp/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Pulumi; | ||
using System.Collections.Generic; | ||
|
||
return await Deployment.RunAsync(() => | ||
{ | ||
var provider = new Pulumi.Docker.Provider("docker", new Pulumi.Docker.ProviderArgs | ||
{ | ||
Host = "host", | ||
RegistryAuth = new List<Pulumi.Docker.Inputs.ProviderRegistryAuthArgs> | ||
{ | ||
new Pulumi.Docker.Inputs.ProviderRegistryAuthArgs | ||
{ | ||
Address = "somewhere.org", | ||
Username = "some-user", | ||
Password = "some-password" | ||
} | ||
} | ||
}); | ||
return new Dictionary<string, object?> | ||
{ | ||
["outputKey"] = "outputValue" | ||
}; | ||
}); |
3 changes: 3 additions & 0 deletions
3
examples/test-secrets-in-explicit-provider/csharp/Pulumi.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: docker-640 | ||
runtime: dotnet | ||
description: A minimal C# Pulumi program reproducing pulumi/pulumi-docker/issues/640 |
14 changes: 14 additions & 0 deletions
14
examples/test-secrets-in-explicit-provider/csharp/docker-640.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Pulumi" Version="3.*" /> | ||
<PackageReference Include="Pulumi.Docker" Version="4.*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters