Merge pull request #12568 from dswarbrick/linode-int-overflow
Linode SD: cast InstanceSpec values to int64 to avoid overflows
This commit is contained in:
commit
c204e1b924
|
@ -304,10 +304,10 @@ func (d *Discovery) refreshData(ctx context.Context) ([]*targetgroup.Group, erro
|
||||||
linodeLabelGroup: model.LabelValue(instance.Group),
|
linodeLabelGroup: model.LabelValue(instance.Group),
|
||||||
linodeLabelHypervisor: model.LabelValue(instance.Hypervisor),
|
linodeLabelHypervisor: model.LabelValue(instance.Hypervisor),
|
||||||
linodeLabelBackups: model.LabelValue(backupsStatus),
|
linodeLabelBackups: model.LabelValue(backupsStatus),
|
||||||
linodeLabelSpecsDiskBytes: model.LabelValue(fmt.Sprintf("%d", instance.Specs.Disk<<20)),
|
linodeLabelSpecsDiskBytes: model.LabelValue(fmt.Sprintf("%d", int64(instance.Specs.Disk)<<20)),
|
||||||
linodeLabelSpecsMemoryBytes: model.LabelValue(fmt.Sprintf("%d", instance.Specs.Memory<<20)),
|
linodeLabelSpecsMemoryBytes: model.LabelValue(fmt.Sprintf("%d", int64(instance.Specs.Memory)<<20)),
|
||||||
linodeLabelSpecsVCPUs: model.LabelValue(fmt.Sprintf("%d", instance.Specs.VCPUs)),
|
linodeLabelSpecsVCPUs: model.LabelValue(fmt.Sprintf("%d", instance.Specs.VCPUs)),
|
||||||
linodeLabelSpecsTransferBytes: model.LabelValue(fmt.Sprintf("%d", instance.Specs.Transfer<<20)),
|
linodeLabelSpecsTransferBytes: model.LabelValue(fmt.Sprintf("%d", int64(instance.Specs.Transfer)<<20)),
|
||||||
}
|
}
|
||||||
|
|
||||||
addr := net.JoinHostPort(publicIPv4, strconv.FormatUint(uint64(d.port), 10))
|
addr := net.JoinHostPort(publicIPv4, strconv.FormatUint(uint64(d.port), 10))
|
||||||
|
|
Loading…
Reference in New Issue