-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[k8sconfiguration] Parameter Validation and Table Formatting (#2871)
* Push updates to k8sconfiguration keys and fix issue with known hosts * Remove print statement * Increase CLI version and add to changelog * Remove deprecated CLIError and reduce history.rst text * Joinnis/add validators (#1) * Push updates to k8sconfiguration keys and fix issue with known hosts * Add validations for naming * Remove print statement * Add validator testing to the set of tests * Add unit testing and greater scenario test coverage * Delete test_kubernetesconfiguration_scenario.py * Remove dots from the regex for naming * Add the scenario tests back * Add good key scenario test to scenarios * Remove numeric checks for configurations * Reduce scneario testing * Move validation of configuration name into creation command * Add table formatting for list and show * Update version * Update the error message for validation failure * Update the test cases for the new error messages * Change error message and regex check * Add proper formatting to code files * Updated final formatting checks * Updated error messages * Update error message and help text * Final update to error messaging * Update test_validators.py * Update based on PR comments Co-authored-by: Jonathan Innis <jonathaninnis@Jonathans-MacBook-Pro.local>
- Loading branch information
1 parent
bc8af1f
commit 175ee47
Showing
11 changed files
with
881 additions
and
1,453 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from collections import OrderedDict | ||
|
||
|
||
def k8sconfiguration_list_table_format(results): | ||
return [__get_table_row(result) for result in results] | ||
|
||
|
||
def k8sconfiguration_show_table_format(result): | ||
return __get_table_row(result) | ||
|
||
|
||
def __get_table_row(result): | ||
return OrderedDict([ | ||
('name', result['name']), | ||
('repositoryUrl', result['repositoryUrl']), | ||
('operatorName', result['operatorInstanceName']), | ||
('operatorNamespace', result['operatorNamespace']), | ||
('scope', result['operatorScope']), | ||
('provisioningState', result['provisioningState']) | ||
]) |
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
Oops, something went wrong.