From afb9f3ba2bace357ad1c5f57100ea8625c8f0dba Mon Sep 17 00:00:00 2001 From: Travis Raines Date: Fri, 5 Feb 2021 16:32:44 -0800 Subject: [PATCH] feat: use strings instead of float64s Convert the Upstream health threshold and Target createdat values from float64 to string. Use of float64 doesn't allow controller-gen to automate manifests from these types, and using string instead is the typical approach in other projects: https://github.com/kubernetes-sigs/controller-tools/issues/245 --- kong/types.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kong/types.go b/kong/types.go index 8e393a24c..82c229958 100644 --- a/kong/types.go +++ b/kong/types.go @@ -157,7 +157,7 @@ type PassiveHealthcheck struct { type Healthcheck struct { Active *ActiveHealthcheck `json:"active,omitempty" yaml:"active,omitempty"` Passive *PassiveHealthcheck `json:"passive,omitempty" yaml:"passive,omitempty"` - Threshold *float64 `json:"threshold,omitempty" yaml:"threshold,omitempty"` + Threshold *string `json:"threshold,omitempty" yaml:"threshold,omitempty"` } // HealthDataAddress represents the health data address of a target @@ -192,7 +192,7 @@ type HealthData struct { // +k8s:deepcopy-gen=true type UpstreamNodeHealth struct { ID *string `json:"id,omitempty" yaml:"id,omitempty"` - CreatedAt *float64 `json:"created_at,omitempty" yaml:"created_at,omitempty"` + CreatedAt *string `json:"created_at,omitempty" yaml:"created_at,omitempty"` Data *HealthData `json:"data,omitempty" yaml:"data,omitempty"` Health *string `json:"health,omitempty" yaml:"data,omitempty"` Target *string `json:"target,omitempty" yaml:"target,omitempty"` @@ -224,7 +224,7 @@ type Upstream struct { // Target represents a Target in Kong. // +k8s:deepcopy-gen=true type Target struct { - CreatedAt *float64 `json:"created_at,omitempty" yaml:"created_at,omitempty"` + CreatedAt *string `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Target *string `json:"target,omitempty" yaml:"target,omitempty"` Upstream *Upstream `json:"upstream,omitempty" yaml:"upstream,omitempty"`