Skip to content

Commit 8ff3cdf

Browse files
marganiHossein MarganiFrassle
authored
Add --show-reads Support to .NET PreviewOptions and UpOptions (#542)
## Overview This PR adds support for the `--show-reads` flag in Pulumi CLI to the .NET SDK by introducing a new `bool? ShowReads` property in both `PreviewOptions` and `UpOptions`. ## Changes - Added `ShowReads` property to `PreviewOptions` and `UpOptions`. - Passed `ShowReads` as a nullable boolean to the `pulumi preview` and `pulumi up` CLI commands. ## Related Issue Closes #541 --------- Co-authored-by: Hossein Margani <[email protected]> Co-authored-by: Fraser Waters <[email protected]> Co-authored-by: Fraser Waters <[email protected]>
1 parent 9ed12ea commit 8ff3cdf

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
component: sdk/auto
2+
kind: Improvements
3+
body: Add --show-reads Support for Pulumi Up & Preview
4+
time: 2025-03-13T11:33:14.4527021Z
5+
custom:
6+
PR: "542"

sdk/Pulumi.Automation/PreviewOptions.cs

+5
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,10 @@ public sealed class PreviewOptions : UpdateOptions
3535
/// Refresh the state of the stack's resources before this preview.
3636
/// </summary>
3737
public bool? Refresh { get; set; }
38+
39+
/// <summary>
40+
/// Show resources that are being read in, alongside those being managed directly in the stack.
41+
/// </summary>
42+
public bool? ShowReads { get; set; }
3843
}
3944
}

sdk/Pulumi.Automation/Pulumi.Automation.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/Pulumi.Automation/UpOptions.cs

+5
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,10 @@ public sealed class UpOptions : UpdateOptions
4545
/// Refresh the state of the stack's resources before this update.
4646
/// </summary>
4747
public bool? Refresh { get; set; }
48+
49+
/// <summary>
50+
/// Show resources that are being read in, alongside those being managed directly in the stack.
51+
/// </summary>
52+
public bool? ShowReads { get; set; }
4853
}
4954
}

sdk/Pulumi.Automation/WorkspaceStack.cs

+12
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ public async Task<UpResult> UpAsync(
332332
if (options.ExpectNoChanges is true)
333333
args.Add("--expect-no-changes");
334334

335+
if (options.ShowReads.HasValue)
336+
{
337+
var showReads = options.ShowReads.Value ? "true" : "false";
338+
args.Add($"--show-reads={showReads}");
339+
}
340+
335341
if (options.Diff is true)
336342
args.Add("--diff");
337343

@@ -447,6 +453,12 @@ public async Task<PreviewResult> PreviewAsync(
447453
if (options.ExpectNoChanges is true)
448454
args.Add("--expect-no-changes");
449455

456+
if (options.ShowReads.HasValue)
457+
{
458+
var showReads = options.ShowReads.Value ? "true" : "false";
459+
args.Add($"--show-reads={showReads}");
460+
}
461+
450462
if (options.Diff is true)
451463
args.Add("--diff");
452464

0 commit comments

Comments
 (0)