Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nforgeio/neonKUBE
Browse files Browse the repository at this point in the history
  • Loading branch information
neonforgedevbot committed Dec 16, 2023
2 parents d1242ea + 55bf72f commit 002334a
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 8 deletions.
14 changes: 14 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,18 @@
</Otherwise>
</Choose>

<!-- Build breaks for some reason without this, since the .NET 8.0 upgrade -->

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
</ItemGroup>

</Project>
20 changes: 18 additions & 2 deletions Tools/neon-cli/Commands/Cluster/ClusterDeleteCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,22 @@ private async Task RemoveCluster(ClusterProxy cluster, bool force)

if (!force)
{
var status = await cluster.GetClusterHealthAsync();

switch (status.State)
{
case ClusterState.Healthy:
case ClusterState.Unhealthy:

break;

default:

Console.Error.WriteLine($"*** ERROR: Cluster is not running.");
Program.Exit(1);
break;
}

var isLocked = await cluster.IsLockedAsync();

if (!isLocked.HasValue)
Expand All @@ -227,7 +243,7 @@ private async Task RemoveCluster(ClusterProxy cluster, bool force)

try
{
Console.WriteLine($"Removing: {cluster.Name}...");
Console.WriteLine($"Deleting: {cluster.Name}...");
await cluster.DeleteClusterAsync();

// Remove all contexts that reference the cluster.
Expand All @@ -240,7 +256,7 @@ private async Task RemoveCluster(ClusterProxy cluster, bool force)
}

KubeHelper.KubeConfig.Save();
Console.WriteLine($"REMOVED: {cluster.Name}");
Console.WriteLine($"Deleted: {cluster.Name}");
}
catch (TimeoutException)
{
Expand Down
2 changes: 1 addition & 1 deletion Tools/neon-cli/Commands/Cluster/ClusterLockCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public override async Task RunAsync(CommandLine commandLine)
case ClusterState.Unhealthy:

await cluster.LockAsync();
Console.WriteLine($"{cluster.Name}: is LOCKED");
Console.WriteLine($"{cluster.Name}: LOCKED");
break;

default:
Expand Down
2 changes: 1 addition & 1 deletion Tools/neon-cli/Commands/Cluster/ClusterPauseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public override async Task RunAsync(CommandLine commandLine)
try
{
await cluster.StopAsync(StopMode.Pause);
Console.WriteLine($"PAUSED: {cluster.Name}");
Console.WriteLine($"Paused: {cluster.Name}");
}
catch (TimeoutException)
{
Expand Down
2 changes: 1 addition & 1 deletion Tools/neon-cli/Commands/Cluster/ClusterResetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ await cluster.ResetAsync(
},
progress: progressMessage => Console.WriteLine(progressMessage));

Console.WriteLine($"RESET: {cluster.Name}");
Console.WriteLine($"Reset: {cluster.Name}");
break;

default:
Expand Down
2 changes: 1 addition & 1 deletion Tools/neon-cli/Commands/Cluster/ClusterStartCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public override async Task RunAsync(CommandLine commandLine)
try
{
await cluster.StartAsync();
Console.WriteLine($"STARTED: {cluster.Name}");
Console.WriteLine($"Started: {cluster.Name}");
}
catch (TimeoutException)
{
Expand Down
2 changes: 1 addition & 1 deletion Tools/neon-cli/Commands/Cluster/ClusterStopCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public override async Task RunAsync(CommandLine commandLine)
}

await cluster.StopAsync(turnoff ? StopMode.TurnOff : StopMode.Graceful);
Console.WriteLine($"STOPPED: {cluster.Name}");
Console.WriteLine($"Stopped: {cluster.Name}");
}
catch (TimeoutException)
{
Expand Down
2 changes: 1 addition & 1 deletion Tools/neon-cli/Commands/Cluster/ClusterUnlockCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public override async Task RunAsync(CommandLine commandLine)
case ClusterState.Unhealthy:

await cluster.UnlockAsync();
Console.WriteLine($"{cluster.Name}: is UNLOCKED");
Console.WriteLine($"{cluster.Name}: UNLOCKED");
break;

default:
Expand Down

0 comments on commit 002334a

Please sign in to comment.