Skip to content

Commit 87cda37

Browse files
Copilotdanegsta
andauthored
Update LogsAvailable to return true for any non-null/non-empty resource state (#11895)
* Initial plan * Update LogsAvailable to check for non-null/non-empty State Co-authored-by: danegsta <[email protected]> * Remove LogsAvailableTests.cs as requested Co-authored-by: danegsta <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: danegsta <[email protected]>
1 parent 7eecf8e commit 87cda37

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

src/Aspire.Hosting/Dcp/Model/Container.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,6 @@ public static Container Create(string name, string image)
547547
}
548548

549549
public bool LogsAvailable =>
550-
this.Status?.State == ContainerState.Starting
551-
|| this.Status?.State == ContainerState.Building
552-
|| this.Status?.State == ContainerState.Running
553-
|| this.Status?.State == ContainerState.Paused
554-
|| this.Status?.State == ContainerState.Stopping
555-
|| this.Status?.State == ContainerState.Exited
556-
|| (this.Status?.State == ContainerState.FailedToStart && this.Status?.ContainerId is not null);
550+
!string.IsNullOrEmpty(this.Status?.State);
557551
}
558552

src/Aspire.Hosting/Dcp/Model/ContainerExec.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,5 @@ public static ContainerExec Create(string name, string containerName, string com
141141
}
142142

143143
public bool LogsAvailable =>
144-
this.Status?.State == ExecutableState.Running
145-
|| this.Status?.State == ExecutableState.Finished
146-
|| this.Status?.State == ExecutableState.Terminated
147-
|| this.Status?.State == ExecutableState.Stopping;
144+
!string.IsNullOrEmpty(this.Status?.State);
148145
}

src/Aspire.Hosting/Dcp/Model/Executable.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,7 @@ public static Executable Create(string name, string executablePath)
241241
}
242242

243243
public bool LogsAvailable =>
244-
this.Status?.State == ExecutableState.Running
245-
|| this.Status?.State == ExecutableState.Finished
246-
|| this.Status?.State == ExecutableState.Terminated;
244+
!string.IsNullOrEmpty(this.Status?.State);
247245

248246
public void SetProjectLaunchConfiguration(ProjectLaunchConfiguration launchConfiguration)
249247
{

0 commit comments

Comments
 (0)