Skip to content

Commit

Permalink
skip resource group's latest api-version as it's unavailable (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-henglu authored Oct 16, 2024
1 parent d9e6518 commit 602363b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/azure/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strings"
"sync"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/terraform-provider-azapi/internal/azure/types"
)

Expand Down Expand Up @@ -50,6 +51,18 @@ func GetApiVersions(resourceType string) []string {
}
}
}

// TODO: remove the below codes when Resources RP 2024-07-01 is available
if strings.EqualFold(resourceType, arm.ResourceGroupResourceType.String()) {
temp := make([]string, 0)
for _, v := range res {
if v != "2024-07-01" {
temp = append(temp, v)
}
}
res = temp
}

sort.Strings(res)
return res
}
Expand Down

0 comments on commit 602363b

Please sign in to comment.