Skip to content

Commit 5d11950

Browse files
committed
Rename ReferencedResources to Resolved
This struct has already moved beyond external references, and seems be evolving towards a fully-resolved machine spec. For want of a better name we call it 'resolved', which is more accurate.
1 parent 5f09ba2 commit 5d11950

22 files changed

+146
-143
lines changed

api/v1alpha5/conversion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ func Convert_v1alpha5_Instance_To_v1beta1_BastionStatus(in *Instance, out *infra
455455
out.State = infrav1.InstanceState(in.State)
456456
out.IP = in.IP
457457
out.FloatingIP = in.FloatingIP
458-
out.ReferencedResources.ServerGroupID = in.ServerGroupID
458+
out.Resolved.ServerGroupID = in.ServerGroupID
459459
return nil
460460
}
461461

@@ -467,7 +467,7 @@ func Convert_v1beta1_BastionStatus_To_v1alpha5_Instance(in *infrav1.BastionStatu
467467
out.State = InstanceState(in.State)
468468
out.IP = in.IP
469469
out.FloatingIP = in.FloatingIP
470-
out.ServerGroupID = in.ReferencedResources.ServerGroupID
470+
out.ServerGroupID = in.Resolved.ServerGroupID
471471
return nil
472472
}
473473

api/v1alpha5/conversion_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func TestConvertFrom(t *testing.T) {
8787
Spec: OpenStackMachineSpec{},
8888
ObjectMeta: metav1.ObjectMeta{
8989
Annotations: map[string]string{
90-
"cluster.x-k8s.io/conversion-data": `{"spec":{"flavor":"","image":{}},"status":{"ready":false,"referencedResources":{},"resources":{}}}`,
90+
"cluster.x-k8s.io/conversion-data": "{\"spec\":{\"flavor\":\"\",\"image\":{}},\"status\":{\"ready\":false,\"resolved\":{},\"resources\":{}}}",
9191
},
9292
},
9393
},

api/v1alpha5/zz_generated.conversion.go

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

api/v1alpha6/openstackcluster_conversion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ func restorev1beta1ClusterStatus(previous *infrav1.OpenStackClusterStatus, dst *
368368
dst.BastionSecurityGroup = previous.BastionSecurityGroup
369369

370370
if previous.Bastion != nil {
371-
dst.Bastion.ReferencedResources = previous.Bastion.ReferencedResources
371+
dst.Bastion.Resolved = previous.Bastion.Resolved
372372
}
373373
if previous.Bastion != nil && previous.Bastion.Resources.Ports != nil {
374374
dst.Bastion.Resources.Ports = previous.Bastion.Resources.Ports

api/v1alpha6/openstackmachine_conversion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ var v1beta1OpenStackMachineRestorer = conversion.RestorerFor[*infrav1.OpenStackM
9696
),
9797
// No equivalent in v1alpha6
9898
"refresources": conversion.UnconditionalFieldRestorer(
99-
func(c *infrav1.OpenStackMachine) *infrav1.ReferencedMachineResources {
100-
return &c.Status.ReferencedResources
99+
func(c *infrav1.OpenStackMachine) *infrav1.ResolvedMachineSpec {
100+
return &c.Status.Resolved
101101
},
102102
),
103103
}

api/v1alpha6/zz_generated.conversion.go

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

api/v1alpha7/openstackcluster_conversion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ func restorev1alpha7ClusterStatus(previous *OpenStackClusterStatus, dst *OpenSta
350350
func restorev1beta1ClusterStatus(previous *infrav1.OpenStackClusterStatus, dst *infrav1.OpenStackClusterStatus) {
351351
// ReferencedResources have no equivalent in v1alpha7
352352
if previous.Bastion != nil {
353-
dst.Bastion.ReferencedResources = previous.Bastion.ReferencedResources
353+
dst.Bastion.Resolved = previous.Bastion.Resolved
354354
}
355355

356356
if previous.Bastion != nil && previous.Bastion.Resources.Ports != nil {

api/v1alpha7/openstackmachine_conversion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ var v1beta1OpenStackMachineRestorer = conversion.RestorerFor[*infrav1.OpenStackM
8383
),
8484
// No equivalent in v1alpha7
8585
"refresources": conversion.UnconditionalFieldRestorer(
86-
func(c *infrav1.OpenStackMachine) *infrav1.ReferencedMachineResources {
87-
return &c.Status.ReferencedResources
86+
func(c *infrav1.OpenStackMachine) *infrav1.ResolvedMachineSpec {
87+
return &c.Status.Resolved
8888
},
8989
),
9090
}

api/v1alpha7/zz_generated.conversion.go

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

api/v1beta1/openstackmachine_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ type OpenStackMachineStatus struct {
126126
// +optional
127127
InstanceState *InstanceState `json:"instanceState,omitempty"`
128128

129-
// ReferencedResources contains resolved references to resources that the machine depends on.
130-
ReferencedResources ReferencedMachineResources `json:"referencedResources,omitempty"`
129+
// Resolved contains parts of the machine spec with all external
130+
// references fully resolved.
131+
Resolved ResolvedMachineSpec `json:"resolved,omitempty"`
131132

132133
// Resources contains references to OpenStack resources created for the machine.
133134
Resources MachineResources `json:"resources,omitempty"`

0 commit comments

Comments
 (0)