Skip to content

Commit

Permalink
feat: use strings instead of float64s
Browse files Browse the repository at this point in the history
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:
kubernetes-sigs/controller-tools#245
  • Loading branch information
Travis Raines committed Feb 6, 2021
1 parent 4bee72f commit 0588f14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions kong/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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"`
Expand Down
6 changes: 3 additions & 3 deletions kong/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0588f14

Please sign in to comment.