Make ACR feature work with sovereign clouds (#4289)
This commit is contained in:
Родитель
43570039d7
Коммит
ea21b375d1
|
@ -3,6 +3,9 @@
|
|||
- Python Dockerfiles will now be scaffolded with the `python:3-slim` tag, so that they do not need to be updated annually. [#4234](https://github.com/microsoft/vscode-docker/pull/4234)
|
||||
- Python debugging will now use the `debugpy` debug configuration instead of the now-deprecated `python` debug configuration. This requires recent versions of the [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) and [Python Debugger](https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy) extensions. [#4221](https://github.com/microsoft/vscode-docker/issues/4221)
|
||||
|
||||
### Fixed
|
||||
- Sovereign clouds such as Azure China and Azure US Government should now work with the connect to Azure Container Registry feature. [#4287](https://github.com/microsoft/vscode-docker/issues/4287)
|
||||
|
||||
## 1.29.0 - 12 February 2024
|
||||
### Added
|
||||
- Node.js 18 is now used, requiring at minimum VSCode 1.82.0. [#4167](https://github.com/microsoft/vscode-docker/pull/4167)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@azure/storage-blob": "^12.14.0",
|
||||
"@microsoft/compose-language-service": "^0.2.0",
|
||||
"@microsoft/vscode-azext-azureappservice": "~2.0",
|
||||
"@microsoft/vscode-azext-azureauth": "^1.4.0",
|
||||
"@microsoft/vscode-azext-azureauth": "^2.3.0",
|
||||
"@microsoft/vscode-azext-azureutils": "^2.0.0",
|
||||
"@microsoft/vscode-azext-utils": "^2.1.1",
|
||||
"@microsoft/vscode-container-client": "^0.1.1",
|
||||
|
@ -211,12 +211,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@azure/arm-resources-subscriptions": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@azure/arm-resources-subscriptions/-/arm-resources-subscriptions-2.0.2.tgz",
|
||||
"integrity": "sha512-PQwKnRAi3OOYB2jHXsmhl2TF9jFjk5fBmTqbyVvsP0ULV7GB1LafCAlMULoCSm+G4AHxYxj8xm3twt1EMOyHDw==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/arm-resources-subscriptions/-/arm-resources-subscriptions-2.1.0.tgz",
|
||||
"integrity": "sha512-vKiu/3Yh84IV3IuJJ+0Fgs/ZQpvuGzoZ3dAoBksIV++Uu/Qz9RcQVz7pj+APWYIuODuR9I0eGKswZvzynzekug==",
|
||||
"dependencies": {
|
||||
"@azure/core-auth": "^1.3.0",
|
||||
"@azure/core-client": "^1.6.1",
|
||||
"@azure/core-client": "^1.7.0",
|
||||
"@azure/core-paging": "^1.2.0",
|
||||
"@azure/core-rest-pipeline": "^1.8.0",
|
||||
"tslib": "^2.2.0"
|
||||
|
@ -259,23 +259,6 @@
|
|||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/arm-subscriptions": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/arm-subscriptions/-/arm-subscriptions-5.1.0.tgz",
|
||||
"integrity": "sha512-6BeOF2eQWNLq22ch7xP9RxYnPjtGev54OUCGggKOWoOvmesK7jUZbIyLk8JeXDT21PEl7iyYnxw78gxJ7zBxQw==",
|
||||
"dependencies": {
|
||||
"@azure/abort-controller": "^1.0.0",
|
||||
"@azure/core-auth": "^1.3.0",
|
||||
"@azure/core-client": "^1.6.1",
|
||||
"@azure/core-lro": "^2.2.0",
|
||||
"@azure/core-paging": "^1.2.0",
|
||||
"@azure/core-rest-pipeline": "^1.8.0",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/core-auth": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz",
|
||||
|
@ -731,11 +714,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@microsoft/vscode-azext-azureauth": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureauth/-/vscode-azext-azureauth-1.4.0.tgz",
|
||||
"integrity": "sha512-lUFSJPyVJ1E1Fsa3rWm368zIRudS9SNcnXyLgWI/INNfK4sFZ622K8TpvF+93Lht/JI6K2R7+EUZ1El7/gzeUA==",
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureauth/-/vscode-azext-azureauth-2.3.0.tgz",
|
||||
"integrity": "sha512-mnVIyke5rc9ua+g81zF133UCZerKJwILJ51OvMv24VVfdo9qYaqgy2kOa/O6JwICXylcpL2/ODNw+RkFg58b1g==",
|
||||
"dependencies": {
|
||||
"@azure/arm-subscriptions": "^5.1.0",
|
||||
"@azure/arm-resources-subscriptions": "^2.1.0",
|
||||
"@azure/ms-rest-azure-env": "^2.0.0"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2998,7 +2998,7 @@
|
|||
"@azure/storage-blob": "^12.14.0",
|
||||
"@microsoft/compose-language-service": "^0.2.0",
|
||||
"@microsoft/vscode-azext-azureappservice": "~2.0",
|
||||
"@microsoft/vscode-azext-azureauth": "^1.4.0",
|
||||
"@microsoft/vscode-azext-azureauth": "^2.3.0",
|
||||
"@microsoft/vscode-azext-azureutils": "^2.0.0",
|
||||
"@microsoft/vscode-azext-utils": "^2.1.1",
|
||||
"@microsoft/vscode-container-client": "^0.1.1",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { AzureSubscription } from '@microsoft/vscode-azext-azureauth';
|
||||
import type { AzureSubscription } from '@microsoft/vscode-azext-azureauth';
|
||||
import { LoginInformation, httpRequest } from '@microsoft/vscode-docker-registries';
|
||||
import { AuthenticationProvider } from "@microsoft/vscode-docker-registries/";
|
||||
import * as vscode from 'vscode';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import type { Registry as AcrRegistry, RegistryListCredentialsResult } from '@azure/arm-containerregistry';
|
||||
import { AzureSubscription, VSCodeAzureSubscriptionProvider } from '@microsoft/vscode-azext-azureauth';
|
||||
import { VSCodeAzureSubscriptionProvider, type AzureSubscription } from '@microsoft/vscode-azext-azureauth';
|
||||
import { IActionContext, callWithTelemetryAndErrorHandling } from '@microsoft/vscode-azext-utils';
|
||||
import { RegistryV2DataProvider, V2Registry, V2RegistryItem, V2Repository, V2Tag, getContextValue, registryV2Request } from '@microsoft/vscode-docker-registries';
|
||||
import { CommonRegistryItem, isRegistry, isRegistryRoot, isRepository, isTag } from '@microsoft/vscode-docker-registries/lib/clients/Common/models';
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import type { ContainerRegistryManagementClient } from '@azure/arm-containerregistry';
|
||||
import { AzureSubscription } from '@microsoft/vscode-azext-azureauth';
|
||||
import type { AzureSubscription } from '@microsoft/vscode-azext-azureauth';
|
||||
import { l10n } from 'vscode';
|
||||
import { getArmContainerRegistry } from './lazyPackages';
|
||||
|
||||
function parseResourceId(id: string): RegExpMatchArray {
|
||||
const matches: RegExpMatchArray | null = id.match(/\/subscriptions\/(.*)\/resourceGroups\/(.*)\/providers\/(.*)\/(.*)/i);
|
||||
|
@ -20,5 +21,12 @@ export function getResourceGroupFromId(id: string): string {
|
|||
}
|
||||
|
||||
export async function createAzureContainerRegistryClient(subscriptionItem: AzureSubscription): Promise<ContainerRegistryManagementClient> {
|
||||
return new (await import('@azure/arm-containerregistry')).ContainerRegistryManagementClient(subscriptionItem.credential, subscriptionItem.subscriptionId);
|
||||
const armContainerRegistry = await getArmContainerRegistry();
|
||||
return new armContainerRegistry.ContainerRegistryManagementClient(
|
||||
subscriptionItem.credential,
|
||||
subscriptionItem.subscriptionId,
|
||||
{
|
||||
endpoint: subscriptionItem.environment.resourceManagerEndpointUrl
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче