forked from pool/traefik
46 lines
1.7 KiB
Diff
46 lines
1.7 KiB
Diff
|
From 86a01a2a2558b05978883703b720a612e95a1b9d Mon Sep 17 00:00:00 2001
|
||
|
From: Fernandez Ludovic <ldez@users.noreply.github.com>
|
||
|
Date: Sat, 17 Feb 2024 14:01:10 +0100
|
||
|
Subject: [PATCH 1/2] fix: int overflow with go generate
|
||
|
|
||
|
---
|
||
|
pkg/collector/hydratation/hydration.go | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/pkg/collector/hydratation/hydration.go b/pkg/collector/hydratation/hydration.go
|
||
|
index 40736f0462..b0d2b316d1 100644
|
||
|
--- a/pkg/collector/hydratation/hydration.go
|
||
|
+++ b/pkg/collector/hydratation/hydration.go
|
||
|
@@ -56,7 +56,7 @@ func fill(field reflect.Value) error {
|
||
|
case reflect.Int64:
|
||
|
switch field.Type() {
|
||
|
case reflect.TypeOf(types.Duration(time.Second)):
|
||
|
- setTyped(field, int64(defaultNumber*int(time.Second)))
|
||
|
+ setTyped(field, types.Duration(defaultNumber*time.Second))
|
||
|
default:
|
||
|
setTyped(field, int64(defaultNumber))
|
||
|
}
|
||
|
|
||
|
From 6786d3889f1b6affbd3bdb6e86e6b25b5d8ff4d6 Mon Sep 17 00:00:00 2001
|
||
|
From: Fernandez Ludovic <ldez@users.noreply.github.com>
|
||
|
Date: Sat, 17 Feb 2024 15:17:31 +0100
|
||
|
Subject: [PATCH 2/2] chore: replace deprecated PtrTo with PointerTo
|
||
|
|
||
|
---
|
||
|
pkg/collector/hydratation/hydration.go | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/pkg/collector/hydratation/hydration.go b/pkg/collector/hydratation/hydration.go
|
||
|
index b0d2b316d1..c45cfcfbb1 100644
|
||
|
--- a/pkg/collector/hydratation/hydration.go
|
||
|
+++ b/pkg/collector/hydratation/hydration.go
|
||
|
@@ -98,7 +98,7 @@ func setMap(field reflect.Value) error {
|
||
|
key := reflect.ValueOf(fmt.Sprintf("%s%d", baseKeyName, i))
|
||
|
|
||
|
// generate value
|
||
|
- ptrType := reflect.PtrTo(field.Type().Elem())
|
||
|
+ ptrType := reflect.PointerTo(field.Type().Elem())
|
||
|
ptrValue := reflect.New(ptrType)
|
||
|
if err := fill(ptrValue); err != nil {
|
||
|
return err
|