update FabricDetails to use class object for consistency #526
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request refactors how SDN fabric details are handled across several modules by introducing a single
SdnFabricInfrastructureclass 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:
SdnFabricInfrastructureclass inSdnDiagnostics.psm1and removed its duplicate definition fromSdnDiag.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:
New-SdnNetworkControllerNodeCertificate,New-SdnMuxCertificate,New-SdnServerCertificate) to automatically distribute generated certificates to all nodes in the SDN fabric using the newSdnFabricInfrastructureparameter. [1] [2] [3]Improved Role and Admin Checks:
Confirm-IsNetworkController,Confirm-IsLoadBalancerMux,Confirm-IsAdmin) for clarity and reliability when verifying the correct execution context. [1] [2]Code Organization and Module Imports:
using module ..\SdnDiagnostics.psm1to all SDN role modules to ensure the shared class and logic are available everywhere. [1] [2] [3] [4]Minor Documentation and Logic Improvements:
FabricDetailsrefers to the environment info fromGet-SdnInfrastructureInfo. [1] [2] [3]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
Checklist: