Skip to content

fix: address inconsistencies in SKU property case-sensitivity string checks#31

Merged
matthchr merged 2 commits intoAzure:mainfrom
CustardTart32:czhong/case-insensitive-capabilities
Nov 14, 2025
Merged

fix: address inconsistencies in SKU property case-sensitivity string checks#31
matthchr merged 2 commits intoAzure:mainfrom
CustardTart32:czhong/case-insensitive-capabilities

Conversation

@CustardTart32
Copy link
Contributor

This PR addresses inconsistencies in case-sensitivity when matching SKU capabilities. Previously, some functions used case-sensitive string matches whilst other functions used case-insensitive matches for SKU capability names.

@HuShaoRu
Copy link
Contributor

in (v1) sku.go restriction.Type (line 349,373,476,539) and func MemberOf (line 579),
in v2/sku.go restriction.Type (line 319,339,438,500) and func MemberOf (line 541) are still case-sensitive. is it expected?

Copy link
Member

@matthchr matthchr left a comment

Choose a reason for hiding this comment

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

Generally LGTM, but agree with @HuShaoRu you should fix the other comparisons as well.

@CustardTart32 CustardTart32 changed the title fix: make sku capability name checks case-insensitive fix: address inconsistencies in SKU property case-sensitivity string checks Nov 14, 2025
@CustardTart32
Copy link
Contributor Author

CustardTart32 commented Nov 14, 2025

Pushed a comment to add a case-insensitive check for the MemberOf function. It should be fine to leave the examples provided by Shaoru as is. The restriction type checks are strict equality checks on two enum values rather than two arbitrary string values.

// ResourceSKURestrictionsType - The type of restrictions.
type ResourceSKURestrictionsType string

const (
	ResourceSKURestrictionsTypeLocation ResourceSKURestrictionsType = "Location"
	ResourceSKURestrictionsTypeZone     ResourceSKURestrictionsType = "Zone"
)

@matthchr matthchr merged commit e5d6c26 into Azure:main Nov 14, 2025
2 checks passed
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.

3 participants