Skip to content

[CON-13686] Make HA flag optional in Kubernetes cluster create request for version-based API defaults#970

Open
pyadagiri-do wants to merge 4 commits into
digitalocean:mainfrom
pyadagiri-do:pyadagiri/hadefault
Open

[CON-13686] Make HA flag optional in Kubernetes cluster create request for version-based API defaults#970
pyadagiri-do wants to merge 4 commits into
digitalocean:mainfrom
pyadagiri-do:pyadagiri/hadefault

Conversation

@pyadagiri-do
Copy link
Copy Markdown

@pyadagiri-do pyadagiri-do commented Mar 16, 2026

Summary

Makes the HA field optional (*bool with omitempty) in KubernetesClusterCreateRequest so the API can apply version-based defaults when omitted:

  • Versions < 1.36: default false
  • Versions >= 1.36: default true

Changes

  • KubernetesClusterCreateRequest.HA: bool*bool with omitempty
  • Added TestKubernetesClusterCreateRequest_HA_JsonMarshal to verify JSON marshaling

Jira

https://do-internal.atlassian.net/browse/CON-13686


DO NOT REVIEW - Draft PR for WIP

Comment thread kubernetes.go Outdated
// Create cluster with highly available control plane
HA bool `json:"ha"`
// HA enables a highly available control plane. When omitted, the API applies
// version-based defaults: false for versions <= 1.36, true for versions > 1.36.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// version-based defaults: false for versions <= 1.36, true for versions > 1.36.
// version-based defaults: false for versions < 1.36, true for versions >= 1.36.

We're planning to make this switch with version 1.36 for now, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(if so, please correct the UpdateClusterRequest comment as well)

Copy link
Copy Markdown
Author

@pyadagiri-do pyadagiri-do Mar 16, 2026

Choose a reason for hiding this comment

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

Updated above comment. No change in behaviour for UpdateClusterRequest for HA

Copy link
Copy Markdown
Author

@pyadagiri-do pyadagiri-do left a comment

Choose a reason for hiding this comment

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

addressing comments

Comment thread kubernetes.go Outdated
// Create cluster with highly available control plane
HA bool `json:"ha"`
// HA enables a highly available control plane. When omitted, the API applies
// version-based defaults: false for versions <= 1.36, true for versions > 1.36.
Copy link
Copy Markdown
Author

@pyadagiri-do pyadagiri-do Mar 16, 2026

Choose a reason for hiding this comment

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

Updated above comment. No change in behaviour for UpdateClusterRequest for HA

Copy link
Copy Markdown
Author

@pyadagiri-do pyadagiri-do left a comment

Choose a reason for hiding this comment

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

addressed comment

@pyadagiri-do pyadagiri-do marked this pull request as ready for review May 12, 2026 03:40
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.

2 participants