Skip to content

Commit 9aaa03a

Browse files
authored
Merge pull request #13186 from sbueringer/pr-fix-cp-contract
🐛 Fix v1beta1 ControlPlane contract to handle .status.initialized correctly
2 parents f43ecd0 + 54a4ea4 commit 9aaa03a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/book/src/developer/providers/contracts/control-plane.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,10 +618,10 @@ preserves compatibility with the deprecated v1beta1 contract; compatibility will
618618

619619
With regards to initialization completed:
620620

621-
Cluster API will continue to temporarily support ControlPlane resource using `status.initialize` and the `status.ready` field to
621+
Cluster API will continue to temporarily support ControlPlane resource using the `status.initialized` field to
622622
report initialization completed.
623623

624-
After compatibility with the deprecated v1beta1 contract will be removed, `status.initialize` and `status.ready` fields in
624+
After compatibility with the deprecated v1beta1 contract will be removed, the `status.initialized` field in
625625
the ControlPlane resource will be ignored.
626626

627627
</aside>

internal/contract/controlplane.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (c *ControlPlaneContract) StatusVersion() *String {
102102
func (c *ControlPlaneContract) Initialized(contractVersion string) *Bool {
103103
if contractVersion == "v1beta1" {
104104
return &Bool{
105-
path: []string{"status", "ready"},
105+
path: []string{"status", "initialized"},
106106
}
107107
}
108108

internal/contract/controlplane_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestControlPlane(t *testing.T) {
7070
g.Expect(got).ToNot(BeNil())
7171
g.Expect(*got).To(BeTrue())
7272

73-
g.Expect(ControlPlane().Initialized("v1beta1").Path()).To(Equal(Path{"status", "ready"}))
73+
g.Expect(ControlPlane().Initialized("v1beta1").Path()).To(Equal(Path{"status", "initialized"}))
7474

7575
objV1beta1 := &unstructured.Unstructured{Object: map[string]interface{}{}}
7676
err = ControlPlane().Initialized("v1beta1").Set(objV1beta1, true)

0 commit comments

Comments
 (0)