Skip to content

Conversation

richabanker
Copy link
Owner

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.:


@@ -82,7 +82,7 @@ type Endpoint struct {
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
// validation.
// +optional
Hostname *string
Hostname string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@richabanker richabanker changed the title test api review for apichange from *string to string test api review for api change from *string to string Feb 19, 2025
@richabanker richabanker changed the title test api review for api change from *string to string Hackathon test api review for api change from *string to string Feb 19, 2025
@richabanker richabanker force-pushed the hackathon branch 6 times, most recently from 4c04c6a to a311a42 Compare February 19, 2025 06:39
@richabanker richabanker force-pushed the hackathon-test-api-review-3 branch from c6f1d41 to 267ceba Compare February 19, 2025 06:40
@richabanker richabanker force-pushed the hackathon-test-api-review-3 branch from 267ceba to a0c618b Compare February 19, 2025 06:51
@@ -82,7 +82,7 @@ type Endpoint struct {
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
// validation.
// +optional
Hostname *string
Hostname string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@@ -82,7 +82,7 @@ type Endpoint struct {
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
// validation.
// +optional
Hostname *string
Hostname string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@@ -82,7 +82,7 @@ type Endpoint struct {
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
// validation.
// +optional
Hostname *string
Hostname string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@richabanker richabanker force-pushed the hackathon-test-api-review-3 branch from 115e7b3 to 4d27e14 Compare February 19, 2025 19:45
@@ -82,7 +82,7 @@ type Endpoint struct {
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
// validation.
// +optional
Hostname *string
Hostname string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest using *string instead of string to make the Hostname field optional and avoid sending an empty string when the value is unset.

@@ -82,7 +82,7 @@ type Endpoint struct {
// fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123)
// validation.
// +optional
Hostname *string
Hostname string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider providing a default value for the Hostname field.

@richabanker richabanker force-pushed the hackathon branch 2 times, most recently from 2c94705 to a535d8c Compare February 20, 2025 02:37
@richabanker richabanker closed this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant