Hackathon test api review for api change from *string to string#27
Hackathon test api review for api change from *string to string#27richabanker wants to merge 1 commit intohackathonfrom
Conversation
| // validation. | ||
| // +optional | ||
| Hostname *string | ||
| Hostname string |
There was a problem hiding this comment.
The change from *string to string for the Hostname field has implications. Changing from a pointer to a value type changes the semantic meaning of the Hostname field.
4c04c6a to
a311a42
Compare
c6f1d41 to
267ceba
Compare
e330f26 to
29df677
Compare
267ceba to
a0c618b
Compare
| // validation. | ||
| // +optional | ||
| Hostname *string | ||
| Hostname string |
There was a problem hiding this comment.
Hostname should be a pointer to a string. Optional fields should be pointers to distinguish between unset and empty string. Also add +optional tag. e.g. Hostname *string json:"hostname,omitempty" +optional
4f7dbdb to
6b1984c
Compare
a0c618b to
8c5fce0
Compare
| // validation. | ||
| // +optional | ||
| Hostname *string | ||
| Hostname string |
There was a problem hiding this comment.
This field should use a pointer *string to distinguish between an unset value and an empty string. Additionally, include the omitempty tag to omit the field from JSON encoding when empty. It also needs a +optional tag.
5fd75a7 to
a933833
Compare
8c5fce0 to
115e7b3
Compare
| // validation. | ||
| // +optional | ||
| Hostname *string | ||
| Hostname string |
There was a problem hiding this comment.
Consider making Hostname a pointer (*string) to differentiate between an unset value and an empty string. This makes the field optional and backwards compatible. Also add the +optional tag.
039d256 to
99ea87f
Compare
115e7b3 to
4d27e14
Compare
| // validation. | ||
| // +optional | ||
| Hostname *string | ||
| Hostname string |
There was a problem hiding this comment.
Suggest using *string instead of string to make the Hostname field optional and avoid sending an empty string when the value is unset.
| // validation. | ||
| // +optional | ||
| Hostname *string | ||
| Hostname string |
There was a problem hiding this comment.
Consider providing a default value for the Hostname field.
2c94705 to
a535d8c
Compare
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: