-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use only int64 and float64 #63
Conversation
I have used float on createdAt and updatedAt because of this : https://github.com/Kong/go-kong/runs/2574465387?check_suite_focus=true#step:7:279 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, please however:
- see the comment Feature Request: Controller-Gen Compatibility #54 (comment) - it doesn't affect the code of this PR, just FYI
- see the action required (in the attached comment)
- be advised that I'm checking with maintainers of Kong Gateway that the
created_at
change from int to float is appropriate.
linters-settings: | ||
lll: | ||
line-length: 150 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lll
has 120 as the default and this is what we have configured in other repos. Why do you want to change that?
Suggestion: remove the customization (leave the default) and wrap all changed lines that require it.
Sources []*CIDRPort `json:"sources,omitempty" yaml:"sources,omitempty"` | ||
Destinations []*CIDRPort `json:"destinations,omitempty" yaml:"destinations,omitempty"` | ||
Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` | ||
HTTPSRedirectStatusCode *int64 `json:"https_redirect_status_code,omitempty" yaml:"https_redirect_status_code,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mflendrich, this line is the reason why I changed lll parameters.
I can't find a way to resize it beneath 121 characters with int it's fine but with int64, it isn't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
golangci supports per-file exemptions, which would be appropriate here. go-kong doesn't currently have any, but deck does: https://github.com/Kong/kong/blob/master/kong.conf.default#L98-L126 is an example for this rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure of your link ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. Clipboard hurray. https://github.com/Kong/deck/blob/6fd816b2bb4603dc2479beeff8b6e1e7a6e1e167/.golangci.yml#L37-L40 was what I meant.
I don't think this fixes the issue. kubernetes-sigs/controller-tools#245 and the controller-gen source indicates that We'd approached this before in #17, which moves to a string-backed type, but decided against it because it's a breaking change in go-kong and |
OK, shall we drop the PR so ? |
Yeah--wouldn't help the issue with controller-gen and we don't have other reasons to modify the types. FWIW, the odd-looking discrepancy in the timestamp types is intentional. Kong actually defines both integer and float timestamp types, though only targets use the float variant. |
Fixes #54