Skip to content

fix(azure): restore deprecated non-Context wrappers for backward compatibility#1754

Open
james00012 wants to merge 2 commits intomainfrom
fix/azure-restore-deprecated-wrappers
Open

fix(azure): restore deprecated non-Context wrappers for backward compatibility#1754
james00012 wants to merge 2 commits intomainfrom
fix/azure-restore-deprecated-wrappers

Conversation

@james00012
Copy link
Copy Markdown
Contributor

@james00012 james00012 commented Apr 10, 2026

Summary

Restores deprecated non-Context wrapper functions that were deleted in PRs #1740-#1742 during the Azure SDK migration. These wrappers delegate to Context variants with context.Background() for backward compatibility, following the pattern established in servicebus.go.

Note: the wrappers return new SDK types (e.g., *armcompute.VirtualMachine) since the Context functions they delegate to were already migrated. Consumers who only call these functions without accessing fields will compile as before. Those accessing fields will need to update to the new SDK's nested Properties pattern.

Files changed (10):

  • compute.go — restored ~22 deprecated wrappers
  • disk.go — restored ~4 deprecated wrappers
  • availabilityset.go — restored ~9 deprecated wrappers
  • nsg.go — restored ~2 deprecated wrappers
  • networkinterface.go — restored ~6 deprecated wrappers
  • publicaddress.go — restored ~7 deprecated wrappers
  • loadbalancer.go — restored ~10 deprecated wrappers
  • virtualnetwork.go — restored ~12 deprecated wrappers
  • storage.go — restored ~18 deprecated wrappers
  • cosmosdb.go — restored ~10 deprecated wrappers

No existing functions modified. No test changes. Purely additive.

Validated

  • go build ./...
  • go test -tags azure -c -o /dev/null ./modules/azure/...
  • go test ./modules/azure/... — all unit tests pass
  • make lint — 0 issues

…atibility

Restores deprecated non-Context wrapper functions that were accidentally
deleted in PRs #1740-#1742 during the Azure SDK migration. These wrappers
delegate to Context variants with context.Background() for backward
compatibility, following the pattern established in servicebus.go.
//
// Deprecated: Use [AvailabilitySetExistsContextE] instead.
func AvailabilitySetExistsE(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) (bool, error) {
return AvailabilitySetExistsContextE(t, context.Background(), avsName, resGroupName, subscriptionID)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we add t.Helper() ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants