Skip to content

Conversation

@arudell
Copy link
Member

@arudell arudell commented Dec 31, 2025

Description

This pull request refactors how SDN fabric details are handled across several modules by introducing a single SdnFabricInfrastructure class and using it as a strongly-typed parameter instead of a generic object. It also updates certificate creation and rotation functions to distribute generated certificates to all relevant SDN fabric nodes automatically. Additionally, the code simplifies and clarifies admin and role checks, and improves code organization by centralizing the class definition.

Type and Parameter Refactoring:

  • Introduced a centralized SdnFabricInfrastructure class in SdnDiagnostics.psm1 and removed its duplicate definition from SdnDiag.NetworkController.psm1. All relevant function parameters now use this class instead of [System.Object] for SDN fabric details. [1] [2] F9758a62L91R91, F9758a62L313R313, F6bf2815L475R475, [3] [4] [5] [6] [7] [8]

Certificate Distribution Enhancements:

  • Updated certificate creation functions (New-SdnNetworkControllerNodeCertificate, New-SdnMuxCertificate, New-SdnServerCertificate) to automatically distribute generated certificates to all nodes in the SDN fabric using the new SdnFabricInfrastructure parameter. [1] [2] [3]

Improved Role and Admin Checks:

  • Replaced feature-based checks with explicit role checks (Confirm-IsNetworkController, Confirm-IsLoadBalancerMux, Confirm-IsAdmin) for clarity and reliability when verifying the correct execution context. [1] [2]

Code Organization and Module Imports:

  • Added using module ..\SdnDiagnostics.psm1 to all SDN role modules to ensure the shared class and logic are available everywhere. [1] [2] [3] [4]

Minor Documentation and Logic Improvements:

  • Updated parameter documentation to clarify that FabricDetails refers to the environment info from Get-SdnInfrastructureInfo. [1] [2] [3]
  • Cleaned up and clarified try/catch and logging logic in certificate rotation functions. [1] [2] [3] [4] [5]

These changes make the codebase more maintainable, type-safe, and ensure consistent handling of SDN fabric details and certificate distribution across all SDN roles.

Change type

  • Bug fix (non-breaking change)
  • Code style update (formatting, local variables)
  • New Feature (non-breaking change that adds new functionality without impacting existing)
  • Breaking change (fix or feature that may cause functionality impact)
  • Other

Checklist:

  • My code follows the style and contribution guidelines of this project.
  • I have tested and validated my code changes.

@arudell arudell requested a review from a team as a code owner December 31, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When using New-SdnMuxCertificate, it fails if FabricDetails not provided

2 participants