Skip to content

Commit dc08df7

Browse files
i-am-tomtgummerer
andauthored
Expose --remote-executor-image in the Automation API (#587)
Forgot about this one, as it wasn't listed on the ticket. This PR makes the `--remote-executor-image` flags accessible in the `dotnet` Automation API. * pulumi/pulumi#19286 * pulumi/pulumi#15697 * pulumi/pulumi#19304 Fixes pulumi/pulumi#15693. --------- Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
1 parent 91c0c9a commit dc08df7

File tree

7 files changed

+124
-0
lines changed

7 files changed

+124
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
component: sdk/auto
2+
kind: Improvements
3+
body: Expose `--remote-executor-*` flags in the Automation API
4+
time: 2025-05-06T15:07:46.076901+02:00
5+
custom:
6+
PR: "587"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2016-2025, Pulumi Corporation
2+
3+
namespace Pulumi.Automation
4+
{
5+
/// <summary>
6+
/// Credentials for the remote execution Docker image.
7+
/// </summary>
8+
public class DockerImageCredentials
9+
{
10+
/// <summary>
11+
/// The username for the image.
12+
/// </summary>
13+
public string Username { get; set; }
14+
15+
/// <summary>
16+
/// The password for the image.
17+
/// </summary>
18+
public string Password { get; set; }
19+
20+
public DockerImageCredentials(string username, string password)
21+
{
22+
this.Username = username;
23+
this.Password = password;
24+
}
25+
}
26+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2016-2025, Pulumi Corporation
2+
3+
namespace Pulumi.Automation
4+
{
5+
/// <summary>
6+
/// Information about the remote execution image.
7+
/// </summary>
8+
public class ExecutorImage
9+
{
10+
public ExecutorImage(string image)
11+
{
12+
this.Image = image;
13+
}
14+
15+
/// <summary>
16+
/// The Docker image to use.
17+
/// </summary>
18+
public string Image { get; set; }
19+
20+
/// <summary>
21+
/// Credentials for the remote execution Docker image.
22+
/// </summary>
23+
public DockerImageCredentials? Credentials { get; set; }
24+
}
25+
}

sdk/Pulumi.Automation/LocalWorkspace.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public sealed class LocalWorkspace : Workspace
3939
private readonly IDictionary<string, EnvironmentVariableValue>? _remoteEnvironmentVariables;
4040
private readonly IList<string>? _remotePreRunCommands;
4141
private readonly bool _remoteSkipInstallDependencies;
42+
private readonly ExecutorImage? _remoteExecutorImage;
4243

4344
internal Task ReadyTask { get; }
4445

@@ -334,6 +335,7 @@ internal LocalWorkspace(
334335
this.Remote = options.Remote;
335336
this._remoteGitProgramArgs = options.RemoteGitProgramArgs;
336337
this._remoteSkipInstallDependencies = options.RemoteSkipInstallDependencies;
338+
this._remoteExecutorImage = options.RemoteExecutorImage;
337339

338340
if (options.EnvironmentVariables != null)
339341
this.EnvironmentVariables = new Dictionary<string, string?>(options.EnvironmentVariables);
@@ -1004,6 +1006,21 @@ internal IReadOnlyList<string> GetRemoteArgs()
10041006
args.Add("--remote-skip-install-dependencies");
10051007
}
10061008

1009+
if (_remoteExecutorImage != null)
1010+
{
1011+
args.Add("--remote-executor-image");
1012+
args.Add(_remoteExecutorImage.Image);
1013+
1014+
if (_remoteExecutorImage.Credentials != null)
1015+
{
1016+
args.Add("--remote-executor-image-username");
1017+
args.Add(_remoteExecutorImage.Credentials.Username);
1018+
1019+
args.Add("--remote-executor-image-password");
1020+
args.Add(_remoteExecutorImage.Credentials.Password);
1021+
}
1022+
}
1023+
10071024
return args;
10081025
}
10091026

sdk/Pulumi.Automation/LocalWorkspaceOptions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ public class LocalWorkspaceOptions
9191
/// </summary>
9292
internal IList<string>? RemotePreRunCommands { get; set; }
9393

94+
/// <summary>
95+
/// Optional information about a remote execution image.
96+
/// </summary>
97+
internal ExecutorImage? RemoteExecutorImage { get; set; }
98+
9499
/// <summary>
95100
/// Whether to skip the default dependency installation step.
96101
/// </summary>

sdk/Pulumi.Automation/Pulumi.Automation.xml

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/Pulumi.Automation/RemoteWorkspaceOptions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@ public IList<string> PreRunCommands
3434
/// Whether to skip the default dependency installation step.
3535
/// </summary>
3636
public bool SkipInstallDependencies { get; set; }
37+
38+
/// <summary>
39+
/// Information about a remote execution image.
40+
/// </summary>
41+
public ExecutorImage? ExecutorImage { get; set; }
3742
}
3843
}

0 commit comments

Comments
 (0)