Skip to content

Hackathon test api change for int32 to int64#26

Closed
richabanker wants to merge 1 commit intohackathonfrom
hackathon-test-api-review-2
Closed

Hackathon test api change for int32 to int64#26
richabanker wants to merge 1 commit intohackathonfrom
hackathon-test-api-review-2

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


@richabanker richabanker force-pushed the hackathon-test-api-review-2 branch from 4e387d8 to a2fb2f0 Compare February 19, 2025 04:48
// The number of pods that have labels matching the labels of the pod template of the replication controller.
// +optional
FullyLabeledReplicas int32
FullyLabeledReplicas int64

Choose a reason for hiding this comment

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

Changing FullyLabeledReplicas from int32 to int64 seems unusual for a count of replicas. While not inherently wrong, consider the implications. Does this RC ever realistically manage more than 2,147,483,647 replicas? If not, int32 is more memory-efficient and aligns with other replica counts in the API. If there's a specific reason for expecting a higher number of replicas, then int64 is appropriate. Please clarify the reason for this change. Without a clear justification, it seems safer to keep it as int32.

@@ -4361,7 +4361,7 @@ type ReplicationControllerStatus struct {

// The number of pods that have labels matching the labels of the pod template of the replication controller.
// +optional

Choose a reason for hiding this comment

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

It is recommended that all public integer fields MUST use the Go int32 or Go int64 types, not int. The change from int32 to int64 may be necessary if replicas can be greater than max int32. If it is likely not to be greater than max int32, suggest not changing it since it is more narrow.

@@ -4361,7 +4361,7 @@ type ReplicationControllerStatus struct {

// The number of pods that have labels matching the labels of the pod template of the replication controller.
// +optional

Choose a reason for hiding this comment

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

Consider using int32 for FullyLabeledReplicas unless there's a specific reason to expect it to exceed the maximum value of int32. Using int32 is generally preferred for integers unless int64 is necessary.

@richabanker richabanker force-pushed the hackathon-test-api-review-2 branch from 6313ba4 to cd88116 Compare February 19, 2025 22:01
@@ -4361,7 +4361,7 @@ type ReplicationControllerStatus struct {

// The number of pods that have labels matching the labels of the pod template of the replication controller.
// +optional

Choose a reason for hiding this comment

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

It's generally preferable to use int32 unless int64 is specifically required. Check if int32 is sufficient for the range of FullyLabeledReplicas, to avoid potential compatibility issues with Javascript number representation.

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant