Skip to content

VDK IS AMAZING#30

Open
ewassef wants to merge 2 commits intomainfrom
feature/tenantId
Open

VDK IS AMAZING#30
ewassef wants to merge 2 commits intomainfrom
feature/tenantId

Conversation

@ewassef
Copy link
Contributor

@ewassef ewassef commented May 16, 2025

This pull request introduces several enhancements and new features, primarily focusing on improving configuration management, error handling, and Kubernetes integration. The most significant changes include the addition of a configuration management system, enhanced error handling in commands, and updates to Kubernetes namespace handling. Below is a detailed breakdown of the changes by theme:

Configuration Management

  • Added ConfigManager class to handle loading, saving, and ensuring configuration, including prompting for a Tenant GUID and opening a browser for account creation if necessary (cli/src/Vdk/Services/ConfigManager.cs).
  • Introduced VdkConfig model to represent configuration data such as TenantId and environment (cli/src/Vdk/Services/ConfigManager.cs).

Kubernetes Integration

  • Added KubernetesConfigMapHelper to create a ConfigMap for storing cluster information (cli/src/Vdk/Services/KubernetesConfigMapHelper.cs).
  • Updated ReverseProxyClient to handle the vega-system namespace instead of vega, including creating or updating a ConfigMap for cluster information after Flux bootstrap (cli/src/Vdk/Services/ReverseProxyClient.cs). [1] [2] [3] [4]

Error Handling Enhancements

  • Added try-catch blocks with error logging in the InvokeAsync methods of CreateRegistryCommand, RemoveRegistryCommand, and RemoveProxyCommand to handle exceptions gracefully (cli/src/Vdk/Commands/CreateRegistryCommand.cs, cli/src/Vdk/Commands/RemoveRegistryCommand.cs, cli/src/Vdk/Commands/RemoveProxyCommand.cs). [1] [2] [3]

Command Improvements

  • Enhanced CreateClusterCommand and InitializeCommand to ensure configuration exists before proceeding, using the new ConfigManager (cli/src/Vdk/Commands/CreateClusterCommand.cs, cli/src/Vdk/Commands/InitializeCommand.cs). [1] [2]
  • Updated CreateClusterCommand to accept a Func<string, IKubernetesClient> for dynamic Kubernetes client creation (cli/src/Vdk/Commands/CreateClusterCommand.cs).

Testing Infrastructure

  • Added a CommandTestBase class with mock support for IConsole to simplify unit testing for commands (cli/tests/Vdk.Tests/CommandTestBase.cs).

mahichr
mahichr previously approved these changes May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants