Skip to content

Conversation

@pghildiyal
Copy link
Contributor

@pghildiyal pghildiyal commented Nov 22, 2021

Description

Autoscaling.MinReplicas and Autoscaling.MaxReplicas are giving type conversion error -
2021/11/19 10:40:54 http: panic serving 100.114.15.204:47584: interface conversion: interface {} is float64, not int

Fixes # (issue)
As per documentation at https://pkg.go.dev/encoding/json#Unmarshal
unspecified numbers are converted to float64 not int, therefore changed conversion to float64 instead of int.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

This has been tested by updating the test case in ValidatorHelper_test.go

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@pghildiyal pghildiyal changed the title used float64 instead of int FIX: used float64 instead of int Nov 22, 2021
kartik-579
kartik-579 previously approved these changes Nov 22, 2021
@kartik-579 kartik-579 merged commit f102fab into main Nov 22, 2021
@kartik-579 kartik-579 deleted the validate-conversion-fix branch November 22, 2021 05:58
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