-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Labels
bugFeature bugs that should be fixed.Feature bugs that should be fixed.customer-response-pendingIssues that are pending customer responseIssues that are pending customer responsefeature-artifact-syncIssues related to Artifact Sync featureIssues related to Artifact Sync feature
Description
Describe the bug
After creating a ACR for psresources with a cache rule against MAR, there is no way to get the module into the ACR.
The cache rule blocks pushes for the target-repo in the cache rule.
I need a way for my acr to pull the pwsh module referenced in the cache rule
OR
be allowed to push/copy this module into the acr.
To Reproduce
Steps to reproduce the behavior:
- create acr
- create cache rule
- copy psresource into the acr (
oras copy,Import-AzContainerRegistryImage,az acr import) - get error
$resourceGroupName = 'rg-pwshacr'
$registryName = 'acrtest736'
Connect-AzAccount
New-AzContainerRegistry -Name $registryName -ResourceGroupName $resourceGroupName -Sku 'Basic' -Location 'swedencentral'
$body = @{
properties = @{
sourceRepository = 'mcr.microsoft.com/psresource/az.ssh'
targetRepository = "az.ssh"
}
}
$subId = (Get-AzContext).Subscription.Id
$uri = "https://management.azure.com/subscriptions/$subId/resourceGroups/$resourceGroupName/providers/Microsoft.ContainerRegistry/registries/$registryName/cacheRules/nameforcacherule?api-version=2023-01-01-preview"
Invoke-AzRestMethod -Uri $uri -Method PUT -Payload ($body | ConvertTo-Json)
$splat = @{
RegistryName = $registryName
ResourceGroupName = $resourceGroupName
SourceRegistryUri = 'mcr.microsoft.com'
SourceImage = 'psresource/az.ssh:0.2.1'
TargetTag = 'az.ssh:0.2.1'
}
Import-AzContainerRegistryImage @splatExpected behavior
Two possible behaviors:
- the acr does the pull for me (automatically or manually triggered)
- I can use
Import-AzContainerRegistryImagewithout error, as long as the source registry and source image matches the cache rule. e.g. I should not be able to have a cache rule for a MAR-module and push my local module to that acr- repository
Screenshots
oras copy
Import-AzContainerRegistryImage
az acr import
Any relevant environment information
- OS: win11

Metadata
Metadata
Assignees
Labels
bugFeature bugs that should be fixed.Feature bugs that should be fixed.customer-response-pendingIssues that are pending customer responseIssues that are pending customer responsefeature-artifact-syncIssues related to Artifact Sync featureIssues related to Artifact Sync feature