Skip to content

Commit

Permalink
Merge pull request #845 from Juniper/bug/844-constant-int-overflow
Browse files Browse the repository at this point in the history
Fix build on 32-bit platforms
  • Loading branch information
chrismarget-j authored Aug 31, 2024
2 parents 0c1dcab + 7809094 commit e41de26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apstra/resource_freeform_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (o *resourceFreeformResource) ValidateConfig(ctx context.Context, req resou
resp.Diagnostics.AddAttributeError(
path.Root("integer_value"),
errInvalidConfig,
fmt.Sprintf("When type is %s, value must be between %d and %d, got %s", config.Type, constants.AsnMin, constants.AsnMax, config.IntValue.String()),
fmt.Sprintf("When type is %s, value must be between %d and %d, got %s", config.Type, constants.AsnMin, uint32(constants.AsnMax), config.IntValue.String()),
)
}
case apstra.FFResourceTypeVni:
Expand Down Expand Up @@ -116,7 +116,7 @@ func (o *resourceFreeformResource) ValidateConfig(ctx context.Context, req resou
resp.Diagnostics.AddAttributeError(
path.Root("integer_value"),
errInvalidConfig,
fmt.Sprintf("When type is %s, value must be between %d and %d, got %s", config.Type, 1, math.MaxUint32, config.IntValue.String()),
fmt.Sprintf("When type is %s, value must be between %d and %d, got %s", config.Type, 1, uint32(math.MaxUint32), config.IntValue.String()),
)
}
case apstra.FFResourceTypeHostIpv4:
Expand Down

0 comments on commit e41de26

Please sign in to comment.