Skip to content
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

Add "Spring" extension and deprecate "Spring-Cloud" extension #4770

Merged
merged 13 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint
  • Loading branch information
yuwzho committed May 5, 2022
commit 791dea467d3b521db8b9cfa90dced178eff3f917
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,4 @@

/src/scvmm/ @nascarsayan

/src/azext_spring/ @yuwzho
yuwzho marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/spring-cloud/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Release History
===============
3.1.6
---
* Mark command as deprecated implicitly because command group 'spring-cloud' is deprecated and will be removed in a future release. Use 'spring' instead.
* Command group 'spring-cloud' is deprecated and will be removed in a future release. Use 'spring' instead.
yuwzho marked this conversation as resolved.
Show resolved Hide resolved

3.1.5
---
Expand Down
2 changes: 1 addition & 1 deletion src/spring/azext_spring/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _update_application_insights_asc_create(cmd,


def spring_update(cmd, client, resource_group, name, app_insights_key=None, app_insights=None,
disable_app_insights=None, sku=None, tags=None, build_pool_size=None, no_wait=False):
disable_app_insights=None, sku=None, tags=None, build_pool_size=None, no_wait=False):
"""
TODO (jiec) app_insights_key, app_insights and disable_app_insights are marked as deprecated.
Will be decommissioned in future releases.
Expand Down
46 changes: 23 additions & 23 deletions src/spring/azext_spring/spring_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,29 +105,29 @@ def _get_factory(cmd, client, resource_group, name, location=None, sku=None):


def spring_create(cmd, client, resource_group, name,
location=None,
vnet=None,
service_runtime_subnet=None,
app_subnet=None,
reserved_cidr_range=None,
service_runtime_network_resource_group=None,
app_network_resource_group=None,
app_insights_key=None,
app_insights=None,
sampling_rate=None,
disable_app_insights=None,
enable_java_agent=None,
sku=None,
tags=None,
zone_redundant=False,
build_pool_size=None,
enable_application_configuration_service=False,
enable_service_registry=False,
enable_gateway=False,
gateway_instance_count=None,
enable_api_portal=False,
api_portal_instance_count=None,
no_wait=False):
location=None,
vnet=None,
service_runtime_subnet=None,
app_subnet=None,
reserved_cidr_range=None,
service_runtime_network_resource_group=None,
app_network_resource_group=None,
app_insights_key=None,
app_insights=None,
sampling_rate=None,
disable_app_insights=None,
enable_java_agent=None,
sku=None,
tags=None,
zone_redundant=False,
build_pool_size=None,
enable_application_configuration_service=False,
enable_service_registry=False,
enable_gateway=False,
gateway_instance_count=None,
enable_api_portal=False,
api_portal_instance_count=None,
no_wait=False):
"""
Because Standard/Basic tier vs. Enterprise tier creation are very different. Here routes the command to different
implementation according to --sku parameters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def test_app_deploy_enterprise(self, file_mock):
def test_app_deploy_build_enterprise(self, file_mock):
file_mock.return_value = mock.MagicMock()
deployment=self._get_deployment()
self._execute('rg', 'asc', 'app', deployment=deployment, artifact_path='my-path', build_env='{"BP_JVM_VERSION": "8.*"}')
self._execute('rg', 'asc', 'app', deployment=deployment, artifact_path='my-path', build_env={'BP_JVM_VERSION': '8.*'})
resource = self.put_build_resource
self.assertEqual({"BP_JVM_VERSION": "8.*"}, resource.properties.env)

Expand Down Expand Up @@ -615,7 +615,7 @@ def test_app_with_large_instance_count_basic(self):

def test_app_with_persistent_storage_enterprise(self):
client = self._get_basic_mock_client(sku='Enterprise')
with self.assertRaisesRegexp(CLIError, 'Enterprise tier spring instance does not support --enable-persistent-storage'):
with self.assertRaisesRegexp(CLIError, 'Enterprise tier Spring instance does not support --enable-persistent-storage'):
self._execute('rg', 'asc', 'app', cpu='500m', memory='2Gi', instance_count=1, enable_persistent_storage=True, client=client)

def test_app_with_persistent_storage(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def test_vnet_location(self):
service_runtime_subnet='/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/svc')
with self.assertRaises(CLIError) as context:
validate_vnet(_get_test_cmd(), ns)
self.assertTrue('--vnet and Azure Spring instance should be in the same location.' in str(context.exception))
self.assertTrue('--vnet and Azure Spring Apps instance should be in the same location.' in str(context.exception))


def _mock_term_client(accepted, registered):
Expand Down Expand Up @@ -317,7 +317,7 @@ def test_term_not_accept(self):
ns = Namespace(sku='Enterprise')
with self.assertRaises(InvalidArgumentValueError) as context:
validate_sku(_get_test_cmd(), ns)
self.assertTrue('Terms for Azure Spring Enterprise is not accepted.' in str(context.exception))
self.assertTrue('Terms for Azure Spring Apps Enterprise is not accepted.' in str(context.exception))

@mock.patch('azure.cli.core.commands.client_factory.get_mgmt_service_client', _mock_not_registered_client)
def test_provider_not_registered(self):
Expand Down