зеркало из https://github.com/Azure/AgentBaker.git
fix: put creating cache rules when creating acr (#5114)
This commit is contained in:
Родитель
0f75dfabe2
Коммит
8d3ebb5552
|
@ -243,10 +243,15 @@ func createPrivateAzureContainerRegistry(ctx context.Context, t *testing.T, reso
|
|||
}
|
||||
|
||||
t.Logf("Private Azure Container Registry created\n")
|
||||
if err := addCacheRuelsToPrivateAzureContainerRegistry(ctx, t, config.ResourceGroupName, config.PrivateACRName); err != nil {
|
||||
return fmt.Errorf("failed to add cache rules to private acr: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func addCacheRuelsToPrivateAzureContainerRegistry(ctx context.Context, t *testing.T, resourceGroup, privateACRName string) error {
|
||||
t.Logf("Adding cache rules to private Azure Container Registry in rg %s\n", resourceGroup)
|
||||
|
||||
cacheParams := armcontainerregistry.CacheRule{
|
||||
Properties: &armcontainerregistry.CacheRuleProperties{
|
||||
SourceRepository: to.Ptr("mcr.microsoft.com/*"),
|
||||
|
|
|
@ -107,9 +107,6 @@ func prepareCluster(ctx context.Context, t *testing.T, cluster *armcontainerserv
|
|||
if err := createPrivateAzureContainerRegistry(ctx, t, config.ResourceGroupName, config.PrivateACRName); err != nil {
|
||||
return nil, fmt.Errorf("failed to create private acr: %w", err)
|
||||
}
|
||||
if err := addCacheRuelsToPrivateAzureContainerRegistry(ctx, t, config.ResourceGroupName, config.PrivateACRName); err != nil {
|
||||
return nil, fmt.Errorf("failed to add cache rules to private acr: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
cluster, err := getOrCreateCluster(ctx, t, cluster)
|
||||
|
|
Загрузка…
Ссылка в новой задаче