зеркало из https://github.com/Azure/ARO-RP.git
move az, tests to GA API
This commit is contained in:
Родитель
44ff1c10dd
Коммит
30b452d510
|
@ -1 +1 @@
|
|||
d9294689796d385aa80932b862bc73e73595354467ef952b61d8154e62b81fdc swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2019-12-31-preview/redhatopenshift.json
|
||||
8ba9d8293e84e1c3aec3f562dc2ae6c0b97980cef352ccfeb7ea9b4589d0d770 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/redhatopenshift.json
|
||||
|
|
14
Makefile
14
Makefile
|
@ -16,7 +16,7 @@ clean:
|
|||
client: generate
|
||||
rm -rf pkg/client python/client
|
||||
mkdir pkg/client python/client
|
||||
sha256sum swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2019-12-31-preview/redhatopenshift.json >.sha256sum
|
||||
sha256sum swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/redhatopenshift.json >.sha256sum
|
||||
|
||||
sudo docker run \
|
||||
--rm \
|
||||
|
@ -26,8 +26,8 @@ client: generate
|
|||
--go \
|
||||
--license-header=MICROSOFT_APACHE_NO_VERSION \
|
||||
--namespace=redhatopenshift \
|
||||
--input-file=/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2019-12-31-preview/redhatopenshift.json \
|
||||
--output-folder=/github.com/Azure/ARO-RP/pkg/client/services/preview/redhatopenshift/mgmt/2019-12-31-preview/redhatopenshift
|
||||
--input-file=/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/redhatopenshift.json \
|
||||
--output-folder=/github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2020-04-30/redhatopenshift
|
||||
|
||||
sudo docker run \
|
||||
--rm \
|
||||
|
@ -38,13 +38,13 @@ client: generate
|
|||
--python \
|
||||
--azure-arm \
|
||||
--license-header=MICROSOFT_APACHE_NO_VERSION \
|
||||
--namespace=azure.mgmt.redhatopenshift.v2019_12_31_preview \
|
||||
--input-file=/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2019-12-31-preview/redhatopenshift.json \
|
||||
--namespace=azure.mgmt.redhatopenshift.v2020_04_30 \
|
||||
--input-file=/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/redhatopenshift.json \
|
||||
--output-folder=/python/client
|
||||
|
||||
sudo chown -R $$(id -un):$$(id -gn) pkg/client python/client
|
||||
sed -i -e 's|azure/aro-rp|Azure/ARO-RP|g' pkg/client/services/preview/redhatopenshift/mgmt/2019-12-31-preview/redhatopenshift/models.go pkg/client/services/preview/redhatopenshift/mgmt/2019-12-31-preview/redhatopenshift/redhatopenshiftapi/interfaces.go
|
||||
rm -rf python/client/azure/mgmt/redhatopenshift/v2019_12_31_preview/aio
|
||||
sed -i -e 's|azure/aro-rp|Azure/ARO-RP|g' pkg/client/services/redhatopenshift/mgmt/2020-04-30/redhatopenshift/models.go pkg/client/services/redhatopenshift/mgmt/2020-04-30/redhatopenshift/redhatopenshiftapi/interfaces.go
|
||||
rm -rf python/client/azure/mgmt/redhatopenshift/v2020_04_30/aio
|
||||
>python/client/__init__.py
|
||||
|
||||
go run ./vendor/golang.org/x/tools/cmd/goimports -w -local=github.com/Azure/ARO-RP pkg/client
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
|
||||
```bash
|
||||
curl -k \
|
||||
"https://localhost:8443/providers/Microsoft.RedHatOpenShift/operations?api-version=2019-12-31-preview"
|
||||
"https://localhost:8443/providers/Microsoft.RedHatOpenShift/operations?api-version=2020-04-30"
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@ against a development RP running at https://localhost:8443/.
|
|||
it:
|
||||
|
||||
```
|
||||
byte-compiling build/bdist.linux-x86_64/egg/azext_aro/vendored_sdks/azure/mgmt/redhatopenshift/v2019_12_31_preview/models/_models_py3.py to _models_py3.pyc
|
||||
File "build/bdist.linux-x86_64/egg/azext_aro/vendored_sdks/azure/mgmt/redhatopenshift/v2019_12_31_preview/models/_models_py3.py", line 45
|
||||
byte-compiling build/bdist.linux-x86_64/egg/azext_aro/vendored_sdks/azure/mgmt/redhatopenshift/v2020_04_30/models/_models_py3.py to _models_py3.pyc
|
||||
File "build/bdist.linux-x86_64/egg/azext_aro/vendored_sdks/azure/mgmt/redhatopenshift/v2020_04_30/models/_models_py3.py", line 45
|
||||
def __init__(self, *, visibility=None, url: str=None, ip: str=None, **kwargs) -> None:
|
||||
^
|
||||
SyntaxError: invalid syntax
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/client/services/preview/redhatopenshift/mgmt/2019-12-31-preview/redhatopenshift"
|
||||
"github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2020-04-30/redhatopenshift"
|
||||
)
|
||||
|
||||
// OpenShiftClustersClient is a minimal interface for azure OpenshiftClustersClient
|
||||
|
|
|
@ -6,7 +6,7 @@ package redhatopenshift
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/client/services/preview/redhatopenshift/mgmt/2019-12-31-preview/redhatopenshift"
|
||||
"github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2020-04-30/redhatopenshift"
|
||||
)
|
||||
|
||||
// OpenShiftClustersClientAddons contains addons for OpenShiftClustersClient
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/client/services/preview/redhatopenshift/mgmt/2019-12-31-preview/redhatopenshift"
|
||||
"github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2020-04-30/redhatopenshift"
|
||||
)
|
||||
|
||||
// OperationsClient is a minimal interface for azure OperationsClient
|
||||
|
|
|
@ -6,7 +6,7 @@ package redhatopenshift
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/client/services/preview/redhatopenshift/mgmt/2019-12-31-preview/redhatopenshift"
|
||||
"github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2020-04-30/redhatopenshift"
|
||||
)
|
||||
|
||||
// OperationsClientAddons contains addons for OperationsClient
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
|
||||
redhatopenshift "github.com/Azure/ARO-RP/pkg/client/services/preview/redhatopenshift/mgmt/2019-12-31-preview/redhatopenshift"
|
||||
redhatopenshift "github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2020-04-30/redhatopenshift"
|
||||
)
|
||||
|
||||
// MockOpenShiftClustersClient is a mock of OpenShiftClustersClient interface
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import urllib3
|
||||
|
||||
from azext_aro.custom import rp_mode_development
|
||||
from azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2019_12_31_preview import AzureRedHatOpenShiftClient
|
||||
from azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2020_04_30 import AzureRedHatOpenShiftClient
|
||||
from azure.cli.core.commands.client_factory import get_mgmt_service_client
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ from azext_aro._help import helps # pylint: disable=unused-import
|
|||
|
||||
def load_command_table(self, _):
|
||||
aro_sdk = CliCommandType(
|
||||
operations_tmpl='azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2019_12_31_preview.operations#OpenShiftClustersOperations.{}', # pylint: disable=line-too-long
|
||||
operations_tmpl='azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2020_04_30.operations#OpenShiftClustersOperations.{}', # pylint: disable=line-too-long
|
||||
client_factory=cf_aro)
|
||||
|
||||
with self.command_group('aro', aro_sdk, client_factory=cf_aro, is_preview=True) as g:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import random
|
||||
import os
|
||||
|
||||
import azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2019_12_31_preview.models as v2019_12_31_preview
|
||||
import azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2020_04_30.models as v2020_04_30
|
||||
|
||||
from azext_aro._aad import AADManager
|
||||
from azext_aro._rbac import assign_contributor_to_vnet
|
||||
|
@ -65,29 +65,29 @@ def aro_create(cmd, # pylint: disable=too-many-locals
|
|||
assign_contributor_to_vnet(cmd.cli_ctx, vnet, client_sp.object_id)
|
||||
assign_contributor_to_vnet(cmd.cli_ctx, vnet, rp_client_sp.object_id)
|
||||
|
||||
oc = v2019_12_31_preview.OpenShiftCluster(
|
||||
oc = v2020_04_30.OpenShiftCluster(
|
||||
location=location,
|
||||
tags=tags,
|
||||
cluster_profile=v2019_12_31_preview.ClusterProfile(
|
||||
cluster_profile=v2020_04_30.ClusterProfile(
|
||||
pull_secret=pull_secret or "",
|
||||
domain=domain or random_id,
|
||||
resource_group_id='/subscriptions/%s/resourceGroups/%s' %
|
||||
(subscription_id, cluster_resource_group or "aro-" + random_id),
|
||||
),
|
||||
service_principal_profile=v2019_12_31_preview.ServicePrincipalProfile(
|
||||
service_principal_profile=v2020_04_30.ServicePrincipalProfile(
|
||||
client_id=client_id,
|
||||
client_secret=client_secret,
|
||||
),
|
||||
network_profile=v2019_12_31_preview.NetworkProfile(
|
||||
network_profile=v2020_04_30.NetworkProfile(
|
||||
pod_cidr=pod_cidr or '10.128.0.0/14',
|
||||
service_cidr=service_cidr or '172.30.0.0/16',
|
||||
),
|
||||
master_profile=v2019_12_31_preview.MasterProfile(
|
||||
master_profile=v2020_04_30.MasterProfile(
|
||||
vm_size=master_vm_size or 'Standard_D8s_v3',
|
||||
subnet_id=master_subnet,
|
||||
),
|
||||
worker_profiles=[
|
||||
v2019_12_31_preview.WorkerProfile(
|
||||
v2020_04_30.WorkerProfile(
|
||||
name='worker', # TODO: 'worker' should not be hard-coded
|
||||
vm_size=worker_vm_size or 'Standard_D2s_v3',
|
||||
disk_size_gb=worker_vm_disk_size_gb or 128,
|
||||
|
@ -95,11 +95,11 @@ def aro_create(cmd, # pylint: disable=too-many-locals
|
|||
count=worker_count or 3,
|
||||
)
|
||||
],
|
||||
apiserver_profile=v2019_12_31_preview.APIServerProfile(
|
||||
apiserver_profile=v2020_04_30.APIServerProfile(
|
||||
visibility=apiserver_visibility or 'Public',
|
||||
),
|
||||
ingress_profiles=[
|
||||
v2019_12_31_preview.IngressProfile(
|
||||
v2020_04_30.IngressProfile(
|
||||
name='default', # TODO: 'default' should not be hard-coded
|
||||
visibility=ingress_visibility or 'Public',
|
||||
)
|
||||
|
@ -135,7 +135,7 @@ def aro_list_credentials(client, resource_group_name, resource_name):
|
|||
|
||||
|
||||
def aro_update(client, resource_group_name, resource_name, no_wait=False):
|
||||
oc = v2019_12_31_preview.OpenShiftClusterUpdate()
|
||||
oc = v2020_04_30.OpenShiftClusterUpdate()
|
||||
|
||||
return sdk_no_wait(no_wait, client.update,
|
||||
resource_group_name=resource_group_name,
|
||||
|
|
Загрузка…
Ссылка в новой задаче