Skip to content

Azure Container Registry: Update API to 2023-11-01-preview#27983

Merged
stephybun merged 7 commits intohashicorp:mainfrom
magodo:acr_api_20231101preview
Nov 19, 2024
Merged

Azure Container Registry: Update API to 2023-11-01-preview#27983
stephybun merged 7 commits intohashicorp:mainfrom
magodo:acr_api_20231101preview

Conversation

@magodo
Copy link
Collaborator

@magodo magodo commented Nov 12, 2024

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

Update the API version from 2023-06-01-preview to 2023-11-01-preview, for Azure Container Registry service.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevent documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

The ones that failed also happen in the TC.

Test Result
> TF_ACC=1 go test -v -timeout=20h -run='TestAccContainerRegistry' ./internal/services/containers
=== RUN   TestAccContainerRegistryAgentPool_basic
=== PAUSE TestAccContainerRegistryAgentPool_basic
=== RUN   TestAccContainerRegistryAgentPool_requiresImport
=== PAUSE TestAccContainerRegistryAgentPool_requiresImport
=== RUN   TestAccContainerRegistryAgentPool_complete
=== PAUSE TestAccContainerRegistryAgentPool_complete
=== RUN   TestAccContainerRegistryCacheRule_basic
=== PAUSE TestAccContainerRegistryCacheRule_basic
=== RUN   TestAccContainerRegistryCacheRule_requiresImport
=== PAUSE TestAccContainerRegistryCacheRule_requiresImport
=== RUN   TestAccContainerRegistry_basic
=== PAUSE TestAccContainerRegistry_basic
=== RUN   TestAccContainerRegistry_requiresImport
=== PAUSE TestAccContainerRegistry_requiresImport
=== RUN   TestAccContainerRegistry_basicManagedStandard
=== PAUSE TestAccContainerRegistry_basicManagedStandard
=== RUN   TestAccContainerRegistry_basicManagedPremium
=== PAUSE TestAccContainerRegistry_basicManagedPremium
=== RUN   TestAccContainerRegistry_basic2Premium2basic
=== PAUSE TestAccContainerRegistry_basic2Premium2basic
=== RUN   TestAccContainerRegistry_complete
=== PAUSE TestAccContainerRegistry_complete
=== RUN   TestAccContainerRegistry_update
=== PAUSE TestAccContainerRegistry_update
=== RUN   TestAccContainerRegistry_geoReplicationLocation
=== PAUSE TestAccContainerRegistry_geoReplicationLocation
=== RUN   TestAccContainerRegistry_networkAccessProfileIp
=== PAUSE TestAccContainerRegistry_networkAccessProfileIp
=== RUN   TestAccContainerRegistry_networkAccessProfileUpdate
=== PAUSE TestAccContainerRegistry_networkAccessProfileUpdate
=== RUN   TestAccContainerRegistry_zoneRedundancy
=== PAUSE TestAccContainerRegistry_zoneRedundancy
=== RUN   TestAccContainerRegistry_geoReplicationZoneRedundancy
=== PAUSE TestAccContainerRegistry_geoReplicationZoneRedundancy
=== RUN   TestAccContainerRegistry_geoReplicationRegionEndpoint
=== PAUSE TestAccContainerRegistry_geoReplicationRegionEndpoint
=== RUN   TestAccContainerRegistry_anonymousPull
=== PAUSE TestAccContainerRegistry_anonymousPull
=== RUN   TestAccContainerRegistry_dataEndpoint
=== PAUSE TestAccContainerRegistry_dataEndpoint
=== RUN   TestAccContainerRegistry_networkRuleBypassOption
=== PAUSE TestAccContainerRegistry_networkRuleBypassOption
=== RUN   TestAccContainerRegistry_encryption
=== PAUSE TestAccContainerRegistry_encryption
=== RUN   TestAccContainerRegistryScopeMap_basic
=== PAUSE TestAccContainerRegistryScopeMap_basic
=== RUN   TestAccContainerRegistryScopeMap_requiresImport
=== PAUSE TestAccContainerRegistryScopeMap_requiresImport
=== RUN   TestAccContainerRegistryScopeMap_complete
=== PAUSE TestAccContainerRegistryScopeMap_complete
=== RUN   TestAccContainerRegistryTask_dockerStep
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTask_dockerStep (0.00s)
=== RUN   TestAccContainerRegistryTask_fileTaskStep
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTask_fileTaskStep (0.00s)
=== RUN   TestAccContainerRegistryTask_encodedTaskStep
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTask_encodedTaskStep (0.00s)
=== RUN   TestAccContainerRegistryTask_dockerStepBaseImageTrigger
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTask_dockerStepBaseImageTrigger (0.00s)
=== RUN   TestAccContainerRegistryTask_dockerStepSourceTrigger
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTask_dockerStepSourceTrigger (0.00s)
=== RUN   TestAccContainerRegistryTask_dockerStepTimerTrigger
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTask_dockerStepTimerTrigger (0.00s)
=== RUN   TestAccContainerRegistryTask_identity
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTask_identity (0.00s)
=== RUN   TestAccContainerRegistryTask_fileTaskStepRegistryCredential
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTask_fileTaskStepRegistryCredential (0.00s)
=== RUN   TestAccContainerRegistryTask_systemTask
=== PAUSE TestAccContainerRegistryTask_systemTask
=== RUN   TestAccContainerRegistryTask_requiresImport
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTask_requiresImport (0.00s)
=== RUN   TestAccContainerRegistryTaskSchedule_basic
    container_registry_task_resource_test.go:42: `ARM_TEST_ACR_TASK_GITHUB_REPO_URL` must be set for acceptance tests!
--- SKIP: TestAccContainerRegistryTaskSchedule_basic (0.00s)
=== RUN   TestAccContainerRegistryTokenPassword_basic
=== PAUSE TestAccContainerRegistryTokenPassword_basic
=== RUN   TestAccContainerRegistryTokenPassword_complete
=== PAUSE TestAccContainerRegistryTokenPassword_complete
=== RUN   TestAccContainerRegistryTokenPassword_update
=== PAUSE TestAccContainerRegistryTokenPassword_update
=== RUN   TestAccContainerRegistryTokenPassword_updateExpiryReflectNewValue
=== PAUSE TestAccContainerRegistryTokenPassword_updateExpiryReflectNewValue
=== RUN   TestAccContainerRegistryTokenPassword_requiresImport
=== PAUSE TestAccContainerRegistryTokenPassword_requiresImport
=== RUN   TestAccContainerRegistryToken_basic
=== PAUSE TestAccContainerRegistryToken_basic
=== RUN   TestAccContainerRegistryToken_requiresImport
=== PAUSE TestAccContainerRegistryToken_requiresImport
=== RUN   TestAccContainerRegistryToken_complete
=== PAUSE TestAccContainerRegistryToken_complete
=== RUN   TestAccContainerRegistryToken_update
=== PAUSE TestAccContainerRegistryToken_update
=== RUN   TestAccContainerRegistryWebhook_basic
=== PAUSE TestAccContainerRegistryWebhook_basic
=== RUN   TestAccContainerRegistryWebhook_withTags
=== PAUSE TestAccContainerRegistryWebhook_withTags
=== RUN   TestAccContainerRegistryWebhook_actions
=== PAUSE TestAccContainerRegistryWebhook_actions
=== RUN   TestAccContainerRegistryWebhook_status
=== PAUSE TestAccContainerRegistryWebhook_status
=== RUN   TestAccContainerRegistryWebhook_serviceUri
=== PAUSE TestAccContainerRegistryWebhook_serviceUri
=== RUN   TestAccContainerRegistryWebhook_scope
=== PAUSE TestAccContainerRegistryWebhook_scope
=== RUN   TestAccContainerRegistryWebhook_customHeaders
=== PAUSE TestAccContainerRegistryWebhook_customHeaders
=== CONT  TestAccContainerRegistryAgentPool_basic
=== CONT  TestAccContainerRegistry_encryption
=== CONT  TestAccContainerRegistryToken_requiresImport
=== CONT  TestAccContainerRegistry_update
=== CONT  TestAccContainerRegistryWebhook_actions
=== CONT  TestAccContainerRegistry_geoReplicationZoneRedundancy
=== CONT  TestAccContainerRegistry_networkRuleBypassOption
=== CONT  TestAccContainerRegistry_requiresImport
=== CONT  TestAccContainerRegistryCacheRule_basic
=== CONT  TestAccContainerRegistry_anonymousPull
=== CONT  TestAccContainerRegistry_basic2Premium2basic
=== CONT  TestAccContainerRegistryTokenPassword_complete
=== CONT  TestAccContainerRegistry_geoReplicationRegionEndpoint
=== CONT  TestAccContainerRegistryToken_basic
=== CONT  TestAccContainerRegistry_complete
=== CONT  TestAccContainerRegistry_basicManagedPremium
=== NAME  TestAccContainerRegistryCacheRule_basic
    testcase.go:173: Step 1/3 error: Error running apply: exit status 1
    Error: creating Cache Rule (Subscription: "0b1f6471-1bf0-4dda-aec3-cb9272f09590"
    Resource Group Name: "accTestRG-acr-cache-rule-241112163111246444"
    Registry Name: "testacccr241112163111246444"
    Cache Rule Name: "testacc-cr-cache-rule-241112163111246444"): performing Create: unexpected status 400 (400 Bad Request) with error: EnforceDockerAuthentication: Cannot create cache rule pointing to Docker Hub without credentials. Please add a credential set to cache rule. Learn more: https://aka.ms/acr/cache-auth

      with azurerm_container_registry_cache_rule.test,
      on terraform_plugin_test.tf line 40, in resource "azurerm_container_registry_cache_rule" "test":
      40: resource "azurerm_container_registry_cache_rule" "test" {

    creating Cache Rule (Subscription: "0b1f6471-1bf0-4dda-aec3-cb9272f09590"
    Resource Group Name: "accTestRG-acr-cache-rule-241112163111246444"
    Registry Name: "testacccr241112163111246444"
    Cache Rule Name: "testacc-cr-cache-rule-241112163111246444"): performing
    Create: unexpected status 400 (400 Bad Request) with error:
    EnforceDockerAuthentication: Cannot create cache rule pointing to Docker Hub
    without credentials. Please add a credential set to cache rule. Learn more:
    https://aka.ms/acr/cache-auth

--- PASS: TestAccContainerRegistry_requiresImport (89.11s)
=== CONT TestAccContainerRegistryWebhook_customHeaders
--- FAIL: TestAccContainerRegistryCacheRule_basic (90.49s)
=== CONT TestAccContainerRegistryWebhook_scope
--- PASS: TestAccContainerRegistry_basicManagedPremium (106.41s)
=== CONT TestAccContainerRegistryWebhook_serviceUri
--- PASS: TestAccContainerRegistryToken_requiresImport (128.06s)
=== CONT TestAccContainerRegistryWebhook_status
--- PASS: TestAccContainerRegistryToken_basic (132.38s)
=== CONT TestAccContainerRegistryWebhook_withTags
--- PASS: TestAccContainerRegistry_complete (140.18s)
=== CONT TestAccContainerRegistryWebhook_basic
--- PASS: TestAccContainerRegistry_geoReplicationRegionEndpoint (149.93s)
=== CONT TestAccContainerRegistryToken_update
--- PASS: TestAccContainerRegistry_geoReplicationZoneRedundancy (157.28s)
=== CONT TestAccContainerRegistryToken_complete
--- PASS: TestAccContainerRegistry_basic2Premium2basic (166.52s)
=== CONT TestAccContainerRegistryTask_systemTask
--- PASS: TestAccContainerRegistry_anonymousPull (176.59s)
=== CONT TestAccContainerRegistryScopeMap_complete
--- PASS: TestAccContainerRegistryTokenPassword_complete (178.18s)
=== CONT TestAccContainerRegistryScopeMap_requiresImport
--- PASS: TestAccContainerRegistryWebhook_actions (179.89s)
=== CONT TestAccContainerRegistryScopeMap_basic
--- PASS: TestAccContainerRegistry_networkRuleBypassOption (184.00s)
=== CONT TestAccContainerRegistryAgentPool_complete
--- PASS: TestAccContainerRegistryWebhook_scope (147.14s)
=== CONT TestAccContainerRegistryAgentPool_requiresImport
--- PASS: TestAccContainerRegistryWebhook_customHeaders (159.57s)
=== CONT TestAccContainerRegistryTokenPassword_basic
--- PASS: TestAccContainerRegistry_update (252.55s)
=== CONT TestAccContainerRegistry_basicManagedStandard
--- PASS: TestAccContainerRegistryWebhook_serviceUri (150.23s)
=== CONT TestAccContainerRegistryTokenPassword_updateExpiryReflectNewValue
--- PASS: TestAccContainerRegistryWebhook_status (152.81s)
=== CONT TestAccContainerRegistryTokenPassword_requiresImport
--- PASS: TestAccContainerRegistryWebhook_basic (141.66s)
=== CONT TestAccContainerRegistry_basic
--- PASS: TestAccContainerRegistryWebhook_withTags (153.61s)
=== CONT TestAccContainerRegistryTokenPassword_update
--- PASS: TestAccContainerRegistryToken_complete (137.10s)
=== CONT TestAccContainerRegistry_dataEndpoint
--- PASS: TestAccContainerRegistryTask_systemTask (134.63s)
=== CONT TestAccContainerRegistryCacheRule_requiresImport
--- PASS: TestAccContainerRegistryScopeMap_requiresImport (123.65s)
=== CONT TestAccContainerRegistry_networkAccessProfileUpdate
--- PASS: TestAccContainerRegistryScopeMap_complete (127.08s)
=== CONT TestAccContainerRegistry_zoneRedundancy
--- PASS: TestAccContainerRegistryScopeMap_basic (128.43s)
=== CONT TestAccContainerRegistry_networkAccessProfileIp
--- PASS: TestAccContainerRegistryToken_update (182.38s)
=== CONT TestAccContainerRegistry_geoReplicationLocation
=== NAME TestAccContainerRegistryCacheRule_requiresImport
testcase.go:173: Step 1/2 error: Error running apply: exit status 1

    Error: creating Cache Rule (Subscription: "0b1f6471-1bf0-4dda-aec3-cb9272f09590"
    Resource Group Name: "accTestRG-acr-cache-rule-241112163111247204"
    Registry Name: "testacccr241112163111247204"
    Cache Rule Name: "testacc-cr-cache-rule-241112163111247204"): performing Create: unexpected status 400 (400 Bad Request) with error: EnforceDockerAuthentication: Cannot create cache rule pointing to Docker Hub without credentials. Please add a credential set to cache rule. Learn more: https://aka.ms/acr/cache-auth

      with azurerm_container_registry_cache_rule.test,
      on terraform_plugin_test.tf line 40, in resource "azurerm_container_registry_cache_rule" "test":
      40: resource "azurerm_container_registry_cache_rule" "test" {

    creating Cache Rule (Subscription: "0b1f6471-1bf0-4dda-aec3-cb9272f09590"
    Resource Group Name: "accTestRG-acr-cache-rule-241112163111247204"
    Registry Name: "testacccr241112163111247204"
    Cache Rule Name: "testacc-cr-cache-rule-241112163111247204"): performing
    Create: unexpected status 400 (400 Bad Request) with error:
    EnforceDockerAuthentication: Cannot create cache rule pointing to Docker Hub
    without credentials. Please add a credential set to cache rule. Learn more:
    https://aka.ms/acr/cache-auth

--- PASS: TestAccContainerRegistry_basicManagedStandard (100.73s)
--- PASS: TestAccContainerRegistry_encryption (355.78s)
--- FAIL: TestAccContainerRegistryCacheRule_requiresImport (89.77s)
=== NAME TestAccContainerRegistry_networkAccessProfileUpdate
testcase.go:173: Step 4/6 error: Pre-apply plan check(s) failed:
'azurerm_container_registry.test' - expected action to not be Replace, path: [[name] [resource_group_name]]
=== NAME TestAccContainerRegistryTokenPassword_updateExpiryReflectNewValue
testcase.go:173: Step 4/6 error: Pre-apply plan check(s) failed:
'azurerm_container_registry_token_password.test' - expected action to not be Replace, path: [[password1 0 expiry]]
--- PASS: TestAccContainerRegistry_basic (120.32s)
=== NAME TestAccContainerRegistryTokenPassword_update
testcase.go:173: Step 4/9 error: Pre-apply plan check(s) failed:
'azurerm_container_registry_token_password.test' - expected action to not be Replace, path: [[password1 0 expiry] [password2 0 expiry]]
--- PASS: TestAccContainerRegistryTokenPassword_basic (184.06s)
--- FAIL: TestAccContainerRegistry_networkAccessProfileUpdate (135.74s)
=== NAME TestAccContainerRegistry_networkAccessProfileIp
testcase.go:173: Step 7/9 error: Error running apply: exit status 1

    Error: applying sku "Basic" for Registry (Subscription: "0b1f6471-1bf0-4dda-aec3-cb9272f09590"
    Resource Group Name: "acctestRG-241112163111240114"
    Registry Name: "testAccCr241112163111240114"): updating Registry (Subscription: "0b1f6471-1bf0-4dda-aec3-cb9272f09590"
    Resource Group Name: "acctestRG-241112163111240114"
    Registry Name: "testAccCr241112163111240114"): performing Update: unexpected status 409 (409 Conflict) with error: Conflict: Cannot update the registry SKU due to reason: Registry has IP rules. Please remove them before proceeding. For more information, please visit https://aka.ms/acr/vnet.. For more information on SKU tiers, please visit https://aka.ms/acr/tiers.

      with azurerm_container_registry.test,
      on terraform_plugin_test.tf line 33, in resource "azurerm_container_registry" "test":
      33: resource "azurerm_container_registry" "test" {

--- PASS: TestAccContainerRegistry_zoneRedundancy (156.95s)
--- PASS: TestAccContainerRegistryTokenPassword_requiresImport (180.26s)
--- FAIL: TestAccContainerRegistryTokenPassword_update (190.65s)
--- FAIL: TestAccContainerRegistry_networkAccessProfileIp (175.43s)
--- FAIL: TestAccContainerRegistryTokenPassword_updateExpiryReflectNewValue (231.42s)
--- PASS: TestAccContainerRegistry_dataEndpoint (219.93s)
--- PASS: TestAccContainerRegistryAgentPool_basic (668.77s)
--- PASS: TestAccContainerRegistryAgentPool_complete (495.10s)
--- PASS: TestAccContainerRegistryAgentPool_requiresImport (608.65s)
--- PASS: TestAccContainerRegistry_geoReplicationLocation (599.75s)
FAIL
FAIL github.com/hashicorp/terraform-provider-azurerm/internal/services/containers 932.089s
FAIL

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • Azure Container Registry: Update API to 2023-11-01-preview [GH-00000]

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #0000

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@magodo
Copy link
Collaborator Author

magodo commented Nov 19, 2024

@stephybun Updated, thx!

}

containerRegistryClient_v2023_06_01_preview, err := containerregistry_v2023_06_01_preview.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
containerRegistryClient_v2023_06_01_preview, err := containerregistry.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
containerRegistryClient_v2023_06_01_preview, err := containerregistry.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
containerRegistryClient_v2023_11_01_preview, err := containerregistry.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {

ContainerInstanceClient: containerInstanceClient,
CacheRulesClient: cacheRulesClient,
ContainerRegistryClient_v2023_06_01_preview: containerRegistryClient_v2023_06_01_preview,
ContainerRegistryClient: containerRegistryClient_v2023_06_01_preview,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ContainerRegistryClient: containerRegistryClient_v2023_06_01_preview,
ContainerRegistryClient: containerRegistryClient_v2023_11_01_preview,

@magodo
Copy link
Collaborator Author

magodo commented Nov 19, 2024

Thank you for pointing this out! Updated.

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @magodo LGTM 👍

@stephybun stephybun merged commit b209843 into hashicorp:main Nov 19, 2024
@github-actions github-actions bot added this to the v4.11.0 milestone Nov 19, 2024
stephybun added a commit that referenced this pull request Nov 19, 2024
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants