Skip to content

Commit 1707b54

Browse files
authored
Merge pull request #44 from ArchetypicalSoftware/feature/update-targetframework-net10-0
Update to .NET 10 and adjust service references
2 parents b89941c + 3d78569 commit 1707b54

24 files changed

+143
-131
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Setup .NET
4444
uses: actions/setup-dotnet@v4
4545
with:
46-
dotnet-version: '8.0.x' # Specify the .NET version you are using
46+
dotnet-version: '10.0.x' # Specify the .NET version you are using
4747

4848
- name: Restore
4949
run: dotnet restore ./cli

cli/src/Vdk/Commands/AppCommand.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
namespace Vdk.Commands;
55

6-
public class AppCommand: RootCommand
6+
public class AppCommand : RootCommand
77
{
88
public AppCommand(CreateCommand create, RemoveCommand remove, ListCommand list, InitializeCommand init, UpdateCommand update, IHubClient client) : base("Vega CLI - Manage Vega development environment")
99
{
10-
AddCommand(create);
11-
AddCommand(remove);
12-
AddCommand(list);
13-
AddCommand(init);
14-
AddCommand(update);
10+
Add(create);
11+
Add(remove);
12+
Add(list);
13+
Add(init);
14+
Add(update);
1515
}
1616
}

cli/src/Vdk/Commands/CreateCloudProviderKindCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public CreateCloudProviderKindCommand(IConsole console, IHubClient client): base
1313
{
1414
_console = console;
1515
_client = client;
16-
this.SetHandler(InvokeAsync);
16+
SetAction(_ => InvokeAsync());
1717
}
1818

1919
public Task InvokeAsync()

cli/src/Vdk/Commands/CreateClusterCommand.cs

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ namespace Vdk.Commands;
1111

1212
public class CreateClusterCommand : Command
1313
{
14+
private readonly Func<string, IKubernetesClient> _clientFunc;
15+
private readonly GlobalConfiguration _configs;
1416
private readonly IConsole _console;
15-
private readonly IKindVersionInfoService _kindVersionInfo;
16-
private readonly IYamlObjectSerializer _yaml;
1717
private readonly IFileSystem _fileSystem;
18-
private readonly IKindClient _kind;
19-
private readonly IHubClient _hub;
2018
private readonly IFluxClient _flux;
19+
private readonly IHubClient _hub;
20+
private readonly IKindClient _kind;
21+
private readonly IKindVersionInfoService _kindVersionInfo;
2122
private readonly IReverseProxyClient _reverseProxy;
22-
private readonly Func<string, IKubernetesClient> _clientFunc;
23-
private readonly GlobalConfiguration _configs;
23+
private readonly IYamlObjectSerializer _yaml;
2424

2525
public CreateClusterCommand(
2626
IConsole console,
@@ -45,15 +45,24 @@ public CreateClusterCommand(
4545
_reverseProxy = reverseProxy;
4646
_clientFunc = clientFunc;
4747
_configs = configs;
48-
var nameOption = new Option<string>(new[] { "-n", "--Name" }, () => Defaults.ClusterName, "The name of the kind cluster to create.");
49-
var controlNodes = new Option<int>(new[] { "-c", "--ControlPlaneNodes" }, () => Defaults.ControlPlaneNodes, "The number of control plane nodes in the cluster.");
50-
var workers = new Option<int>(new[] { "-w", "--Workers" }, () => Defaults.WorkerNodes, "The number of worker nodes in the cluster.");
51-
var kubeVersion = new Option<string>(new[] { "-k", "--KubeVersion" }, () => "1.29", "The kubernetes api version.");
52-
AddOption(nameOption);
53-
AddOption(controlNodes);
54-
AddOption(workers);
55-
AddOption(kubeVersion);
56-
this.SetHandler(InvokeAsync, nameOption, controlNodes, workers, kubeVersion);
48+
var nameOption = new Option<string>("--Name") { DefaultValueFactory = _ => Defaults.ClusterName, Description = "The name of the kind cluster to create." };
49+
nameOption.Aliases.Add("-n");
50+
var controlNodes = new Option<int>("--ControlPlaneNodes") { DefaultValueFactory = _ => Defaults.ControlPlaneNodes, Description = "The number of control plane nodes in the cluster." };
51+
controlNodes.Aliases.Add("-c");
52+
var workers = new Option<int>("--Workers") { DefaultValueFactory = _ => Defaults.WorkerNodes, Description = "The number of worker nodes in the cluster." };
53+
workers.Aliases.Add("-w");
54+
var kubeVersion = new Option<string>("--KubeVersion") { DefaultValueFactory = _ => "1.29", Description = "The kubernetes api version." };
55+
kubeVersion.Aliases.Add("-k");
56+
57+
Options.Add(nameOption);
58+
Options.Add(controlNodes);
59+
Options.Add(workers);
60+
Options.Add(kubeVersion);
61+
SetAction(parseResult => InvokeAsync(
62+
parseResult.GetValue(nameOption) ?? Defaults.ClusterName,
63+
parseResult.GetValue(controlNodes),
64+
parseResult.GetValue(workers),
65+
parseResult.GetValue(kubeVersion)));
5766
}
5867

5968
public async Task InvokeAsync(string name = Defaults.ClusterName, int controlPlaneNodes = 1, int workerNodes = 2, string? kubeVersionRequested = null)

cli/src/Vdk/Commands/CreateCommand.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ namespace Vdk.Commands;
44

55
public class CreateCommand: Command
66
{
7-
public CreateCommand(CreateClusterCommand createCluster, CreateRegistryCommand createRegistry, CreateProxyCommand createProxy, CreateCloudProviderKindCommand createCloudProviderKindCommand)
7+
public CreateCommand(CreateClusterCommand createCluster, CreateRegistryCommand createRegistry, CreateProxyCommand createProxy, CreateCloudProviderKindCommand createCloudProviderKindCommand)
88
: base("create", "Create vega development resources")
99
{
10-
AddCommand(createCluster);
11-
AddCommand(createRegistry);
12-
AddCommand(createProxy);
13-
AddCommand(createCloudProviderKindCommand);
10+
Subcommands.Add(createCluster);
11+
Subcommands.Add(createRegistry);
12+
Subcommands.Add(createProxy);
13+
Subcommands.Add(createCloudProviderKindCommand);
1414
}
1515
}

cli/src/Vdk/Commands/CreateProxyCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public CreateProxyCommand(IConsole console, IReverseProxyClient client) : base("
1313
{
1414
_console = console;
1515
_client = client;
16-
this.SetHandler(InvokeAsync);
16+
SetAction(_ => InvokeAsync());
1717
}
1818

1919
public Task InvokeAsync()

cli/src/Vdk/Commands/CreateRegistryCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public CreateRegistryCommand(IConsole console, IHubClient client): base("registr
1313
{
1414
_console = console;
1515
_client = client;
16-
this.SetHandler(InvokeAsync);
16+
SetAction(_ => InvokeAsync());
1717
}
1818

1919
public Task InvokeAsync()

cli/src/Vdk/Commands/InitializeCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public InitializeCommand(CreateClusterCommand createCluster, CreateProxyCommand
2424
_kind = kind;
2525
_console = console;
2626
_kindVersionInfo = kindVersionInfo;
27-
this.SetHandler(InvokeAsync);
27+
SetAction(_ => InvokeAsync());
2828
}
2929

3030
public async Task InvokeAsync()

cli/src/Vdk/Commands/ListClustersCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public ListClustersCommand(IConsole console, IKindClient client) : base("cluster
1313
{
1414
_console = console;
1515
_client = client;
16-
this.SetHandler(InvokeAsync);
16+
SetAction(_ => InvokeAsync());
1717
}
1818

1919
public Task InvokeAsync()

cli/src/Vdk/Commands/ListCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class ListCommand: Command
66
{
77
public ListCommand(ListClustersCommand clustersCommand, ListKubernetesVersions kubernetesVersions) : base("list", "List Vega development resources")
88
{
9-
AddCommand(clustersCommand);
10-
AddCommand(kubernetesVersions);
9+
Subcommands.Add(clustersCommand);
10+
Subcommands.Add(kubernetesVersions);
1111
}
1212
}

0 commit comments

Comments
 (0)