-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d76b671
commit 0cfd66a
Showing
31 changed files
with
130 additions
and
65 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
2 changes: 2 additions & 0 deletions
2
src/Aspirate.Cli/Actions/Containers/PopulateContainerDetailsAction.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
2 changes: 1 addition & 1 deletion
2
src/Aspirate.Cli/Actions/Manifests/ApplyManifestsToClusterAction.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
50 changes: 50 additions & 0 deletions
50
src/Aspirate.Cli/Actions/Manifests/GenerateFinalKustomizeManifestAction.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,50 @@ | ||
namespace Aspirate.Cli.Actions.Manifests; | ||
|
||
public sealed class GenerateFinalKustomizeManifestAction( | ||
IAspireManifestCompositionService manifestCompositionService, | ||
IServiceProvider serviceProvider) : BaseAction(serviceProvider) | ||
{ | ||
public const string ActionKey = "GenerateFinalKustomizeManifestAction"; | ||
|
||
public override Task<bool> ExecuteAsync() | ||
{ | ||
if (CurrentState.SkipFinalKustomizeGeneration) | ||
{ | ||
return Task.FromResult(true); | ||
} | ||
|
||
if (NoSupportedComponentsExitAction()) | ||
{ | ||
return Task.FromResult(true); | ||
} | ||
|
||
if (!CurrentState.NonInteractive) | ||
{ | ||
Logger.WriteLine(); | ||
var shouldGenerateFinalKustomizeManifest = Logger.Confirm( | ||
"[bold]Would you like to generate the top level kustomize manifest to run against your kubernetes cluster?[/]"); | ||
|
||
if (!shouldGenerateFinalKustomizeManifest) | ||
{ | ||
Logger.MarkupLine("[yellow](!)[/] Skipping final manifest"); | ||
return Task.FromResult(true); | ||
} | ||
} | ||
|
||
var finalHandler = Services.GetRequiredKeyedService<IProcessor>(AspireLiterals.Final) as FinalProcessor; | ||
finalHandler.CreateFinalManifest(CurrentState.FinalResources, CurrentState.OutputPath, CurrentState.TemplatePath); | ||
|
||
return Task.FromResult(true); | ||
} | ||
|
||
private bool NoSupportedComponentsExitAction() | ||
{ | ||
if (CurrentState.HasSelectedSupportedComponents) | ||
{ | ||
return false; | ||
} | ||
|
||
Logger.MarkupLine("\r\n[bold]No supported components selected. Final manifest does not need to be generated as it would be empty.[/]"); | ||
return true; | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
src/Aspirate.Cli/Actions/Manifests/RemoveManifestsFromClusterAction.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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
...ors/Components/Final/FinalTemplateData.cs → ...Cli/Processors/Final/FinalTemplateData.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace Aspirate.Cli.Processors.Components.Final; | ||
namespace Aspirate.Cli.Processors.Final; | ||
|
||
public class FinalTemplateData(IReadOnlyCollection<string> manifests) : BaseTemplateData(null, null, manifests, false); |
2 changes: 1 addition & 1 deletion
2
...s/Postgresql/PostgresDatabaseProcessor.cs → ...s/Postgresql/PostgresDatabaseProcessor.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
2 changes: 1 addition & 1 deletion
2
...ostgresql/PostgresDatabaseTemplateData.cs → ...ostgresql/PostgresDatabaseTemplateData.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
2 changes: 1 addition & 1 deletion
2
...nts/Postgresql/PostgresServerProcessor.cs → ...ors/Postgresql/PostgresServerProcessor.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
2 changes: 1 addition & 1 deletion
2
.../Postgresql/PostgresServerTemplateData.cs → .../Postgresql/PostgresServerTemplateData.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Aspirate.Cli.Processors.Components.Postgresql; | ||
namespace Aspirate.Cli.Processors.Postgresql; | ||
|
||
public sealed class PostgresServerTemplateData(IReadOnlyCollection<string> manifests) | ||
: BaseTemplateData(null, null, manifests, false); |
2 changes: 1 addition & 1 deletion
2
...rs/Components/Project/ProjectProcessor.cs → ...li/Processors/Project/ProjectProcessor.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
2 changes: 1 addition & 1 deletion
2
...Components/Project/ProjectTemplateData.cs → ...Processors/Project/ProjectTemplateData.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
2 changes: 1 addition & 1 deletion
2
.../Components/RabbitMQ/RabbitMQProcessor.cs → .../Processors/RabbitMQ/RabbitMQProcessor.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
2 changes: 1 addition & 1 deletion
2
...mponents/RabbitMQ/RabbitMQTemplateData.cs → ...ocessors/RabbitMQ/RabbitMQTemplateData.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Aspirate.Cli.Processors.Components.RabbitMQ; | ||
namespace Aspirate.Cli.Processors.RabbitMQ; | ||
|
||
public sealed class RabbitMqTemplateData(IReadOnlyCollection<string> manifests) | ||
: BaseTemplateData(null, null, manifests, false); |
2 changes: 1 addition & 1 deletion
2
...essors/Components/Redis/RedisProcessor.cs → ...te.Cli/Processors/Redis/RedisProcessor.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
2 changes: 1 addition & 1 deletion
2
...ors/Components/Redis/RedisTemplateData.cs → ...Cli/Processors/Redis/RedisTemplateData.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Aspirate.Cli.Processors.Components.Redis; | ||
namespace Aspirate.Cli.Processors.Redis; | ||
|
||
public sealed class RedisTemplateData(IReadOnlyCollection<string> manifests) | ||
: BaseTemplateData(null, null, manifests, false); |
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
2 changes: 1 addition & 1 deletion
2
...ns/BaseActionWithNonInteractiveSupport.cs → ...BaseActionWithNonInteractiveValidation.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
Oops, something went wrong.