-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] - Add OpenShift support #7385
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reviewing it. One comment for now.
from .exceptions import CliTestError | ||
from .checkers import (JMESPathCheck, JMESPathCheckExists, JMESPathCheckGreaterThan, NoneCheck, StringCheck, | ||
StringContainCheck) | ||
from .decorators import api_version_constraint | ||
from .utilities import create_random_name | ||
|
||
__all__ = ['ScenarioTest', 'LiveScenarioTest', 'ResourceGroupPreparer', 'StorageAccountPreparer', | ||
'RoleBasedServicePrincipalPreparer', 'CliTestError', 'JMESPathCheck', 'JMESPathCheckExists', 'NoneCheck', | ||
'RoleBasedServicePrincipalPreparer', 'ManagedApplicationPreparer', 'CliTestError', 'JMESPathCheck', 'JMESPathCheckExists', 'NoneCheck', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break the line at 120.
self.test_class_instance.kwargs[self.key] = name | ||
# The slice is the easiest way for know to return the Teanant from the same command | ||
return {self.parameter_name: self.result['appId'], self.parameter_secret: name, | ||
self.parameter_tenant: self.result['odata.metadata'][26:62]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This not very stable. Isn't there any alternative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it is not very clean, the response from the command is not returning this field tenantID
this is why I did this, to test.
I can add another cli command such as az account list
to get this info though ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a more stable solution than this. Please do that and also add comments regarding why it invokes that command to fetch the tenant id.
Add _ensure_osa_aad
# Conflicts: # src/command_modules/azure-cli-acs/HISTORY.rst # src/command_modules/azure-cli-acs/setup.py
aad_tenant_id=None, | ||
identifier=None, | ||
name=None): | ||
# TODO: This really needs to be unit tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I forgot to remove that comment, Can you tell me if my tests in test_osa_commands.py
are ok ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think so.
@@ -2199,3 +2243,109 @@ def _validate_aci_location(norm_location): | |||
if norm_location not in aci_locations: | |||
raise CLIError('Azure Container Instance is not available at location "{}".'.format(norm_location) + | |||
' The available locations are "{}"'.format(','.join(aci_locations))) | |||
|
|||
|
|||
def openshift_create(cmd, client, resource_group_name, name, # pylint: disable=too-many-locals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break this method into smaller methods to avoid too-many-locals
warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure to understand how I can do this. Those parameters are from the user. I am doing the same logic as the aks_create
fct around line 1415. Can you give me some hints here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"too many locals" means that you defined too many local variables in this method, which indicates that the body of the function is too large.
|
||
# We don't creating the AADIdentity for the user right now but maybe later so keeping this | ||
# Keeping this Due to SPN replication latency, we do a few retries here | ||
max_retry = 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make the retry last up to 90 seconds. I recommend you print warning to the stderr through logging so as to avoid the impression of command hanging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed that part since I added the auto creation of the AADIdentity : _ensure_osa_aad
ResourceGroupPreparer, ManagedApplicationPreparer, ScenarioTest, live_only) | ||
from azure_devtools.scenario_tests import AllowLargeResponse | ||
from azure.cli.testsdk.checkers import ( | ||
StringContainCheck, StringContainCheckIgnoreCase) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in the line.
Add _remove_nulls_osa Update NetworkProfile
Rename Models Rename node-count to compute-count fqdn mandatory
Please remove me from the reviewers list. |
self.result = {} | ||
self.app_name = app_name | ||
self.dev_setting_app_name = os.environ.get(dev_setting_app_name, None) | ||
self.dev_setting_app_secret = os.environ.get(dev_setting_app_secret, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the default value for os.environ.get
already None
?
Rename node-vm-size to compute-vm-size
Closing due to inactivity. Feel free to reopen when the PR is ready. |
Hi @tjprescott waiting after : Azure/azure-sdk-for-python#3378 to be merged |
Hi @julienstroheker no worries. Feel free to reopen when the Python SDK is merged. |
Please do not merge WIP
Related to :
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).
I adhere to the Command Guidelines.