Skip to content

Commit d2116fc

Browse files
committed
chore: add deprecation notice to number_of_zones
1 parent dc497c6 commit d2116fc

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PROVIDER_BIN:=$(shell basename `git rev-parse --show-toplevel`)
22
PROVIDER_NAME:=$(shell echo $(PROVIDER_BIN) | sed 's/terraform-provider-//g')
33
PROVIDER_DIRECTORY:=~/.terraform.d/plugins/local/altinity/${PROVIDER_NAME}
44
DEFAULT_GRAPHQL_SCHEMA_FILE:=internal/sdk/client/graphql.schema
5-
DEFAULT_GRAPHQL_SCHEMA_URL:=https://anywhere.dev.altinity.cloud/api/v1/graphql.schema
5+
DEFAULT_GRAPHQL_SCHEMA_URL:=https://anywhere.altinity.cloud/api/v1/graphql.schema
66

77
GRAPHQL_SCHEMA_URL:=$(or $(GRAPHQL_SCHEMA_URL),$(DEFAULT_GRAPHQL_SCHEMA_URL))
88
GRAPHQL_SCHEMA_FILE:=$(or $(GRAPHQL_SCHEMA_FILE),$(DEFAULT_GRAPHQL_SCHEMA_FILE))

internal/provider/common/attributes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ func GetNumberOfZonesAttribute(required, optional, computed bool) rschema.Int64A
139139
Optional: optional,
140140
Computed: computed,
141141
MarkdownDescription: NUMBER_OF_ZONES_DESCRIPTION,
142+
DeprecationMessage: "The 'number_of_zones' attribute is deprecated and will be removed soon. Use 'zones' instead.",
142143
Validators: []validator.Int64{
143144
int64validator.AtLeast(2),
144145
},

internal/provider/modifiers/zones_validation.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func (d *zonesAttributePlanModifier) MarkdownDescription(ctx context.Context) st
2323
return d.Description(ctx)
2424
}
2525

26+
// TODO: remove this modifier after deprecating number_of_zones
2627
func (d *zonesAttributePlanModifier) PlanModifyInt64(ctx context.Context, req planmodifier.Int64Request, resp *planmodifier.Int64Response) {
2728
var zones types.List
2829
diags := req.Plan.GetAttribute(ctx, path.Root("zones"), &zones)
@@ -43,10 +44,6 @@ func (d *zonesAttributePlanModifier) PlanModifyInt64(ctx context.Context, req pl
4344
return
4445
}
4546

46-
// if !zones.IsNull() && numberOfZones.ValueInt64() > 0 {
47-
// resp.Diagnostics.AddAttributeWarning(path.Root("zones"), "zones and number_of_zones are mutually exclusive", "if you set both, only zones will be used")
48-
// }
49-
5047
if !zones.IsNull() && len(zones.Elements()) > 0 {
5148
resp.PlanValue = types.Int64Value(int64(len(zones.Elements())))
5249
return

0 commit comments

Comments
 (0)