Skip to content

Commit 9a38c91

Browse files
committed
Make v1beta1 APIEndpoint host & port fields optional to fix v1beta1 e2e test
1 parent feb072b commit 9a38c91

11 files changed

+34
-56
lines changed

api/core/v1beta1/cluster_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,12 +1092,12 @@ func (c *ClusterStatus) GetTypedPhase() ClusterPhase {
10921092
type APIEndpoint struct {
10931093
// host is the hostname on which the API server is serving.
10941094
// TODO: Can't set MinLength=1 for now, because this struct is not always used in pointer fields so today we have cases where host is set to an empty string.
1095-
// +required
1095+
// +optional
10961096
// +kubebuilder:validation:MaxLength=512
10971097
Host string `json:"host"`
10981098

10991099
// port is the port on which the API server is serving.
1100-
// +required
1100+
// +optional
11011101
Port int32 `json:"port"`
11021102
}
11031103

api/core/v1beta1/zz_generated.openapi.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cluster.x-k8s.io_clusters.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/book/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
- [Best practices](./developer/providers/best-practices.md)
102102
- [Security guidelines](./developer/providers/security-guidelines.md)
103103
- [Version migration](developer/providers/migrations/overview.md)
104-
- [v1.8 to v1.9](./developer/providers/migrations/v1.8-to-v1.9.md)
105104
- [v1.9 to v1.10](./developer/providers/migrations/v1.9-to-v1.10.md)
106105
- [v1.10 to v1.11](./developer/providers/migrations/v1.10-to-v1.11.md)
106+
- [v1.11 to v1.12](./developer/providers/migrations/v1.11-to-v1.12.md)
107107
- [Troubleshooting](./user/troubleshooting.md)
108108
- [Reference](./reference/reference.md)
109109
- [API Reference](./reference/api/reference.md)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Cluster API v1.11 compared to v1.12
2+
3+
This document provides an overview over relevant changes between Cluster API v1.11 and v1.12 for
4+
maintainers of providers and consumers of our Go API.
5+
6+
## Go version
7+
8+
- The Go version used by Cluster API is Go 1.24.x
9+
10+
## Changes by Kind
11+
12+
### Deprecation
13+
14+
### Removals
15+
16+
### API Changes
17+
18+
### Other
19+
20+
### Suggested changes for providers
21+
22+
* For providers that copied the core Cluster API v1beta1 `APIEndpoint` struct and used it in their InfraCluster Go type
23+
it is recommended to now make the `Host` and `Port` fields optional (they already have been made optional in
24+
`clusterv1beta1.APIEndpoint` in Cluster API v1.12).
25+
tl;dr The fields were previously required, but due to side effects that validation was never enforced. These side
26+
effects might go away which then makes the fields suddenly required. To avoid issues we recommend making the fields
27+
optional. Similar to how they are optional in the v1beta2 `APIEndpoint` struct and v1beta2 InfraCluster contract.
28+
For more details, please see: https://github.com/kubernetes-sigs/cluster-api/pull/12634#discussion_r2275468291.
29+
But this might look differently depending on how your InfraCluster Go type and corresponding mutating webhook evolved over time.

docs/book/src/developer/providers/migrations/v1.8-to-v1.9.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

test/infrastructure/docker/api/v1beta1/dockercluster_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@ type DockerClusterV1Beta2Status struct {
116116
// APIEndpoint represents a reachable Kubernetes API endpoint.
117117
type APIEndpoint struct {
118118
// Host is the hostname on which the API server is serving.
119+
// +optional
119120
Host string `json:"host"`
120121

121122
// Port is the port on which the API server is serving.
122123
// Defaults to 6443 if not set.
124+
// +optional
123125
Port int `json:"port"`
124126
}
125127

test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_devclusters.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_devclustertemplates.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)