@@ -14,6 +14,8 @@ import (
1414 ctrl "sigs.k8s.io/controller-runtime"
1515 "sigs.k8s.io/controller-runtime/pkg/client"
1616 "sigs.k8s.io/controller-runtime/pkg/client/fake"
17+
18+ csv1beta1 "github.com/appuio/machine-api-provider-cloudscale/api/cloudscale/provider/v1beta1"
1719)
1820
1921func Test_MachineSetReconciler_Reconcile (t * testing.T ) {
@@ -37,7 +39,12 @@ func Test_MachineSetReconciler_Reconcile(t *testing.T) {
3739 Spec : machinev1beta1.MachineSetSpec {},
3840 }
3941
40- setFlavorOnMachineSet (ms , "plus-4-2" )
42+ providerData := csv1beta1.CloudscaleMachineProviderSpec {
43+ Flavor : "plus-4-2" ,
44+ RootVolumeSizeGB : 50 ,
45+ }
46+
47+ setMachineSetProviderData (ms , & providerData )
4148
4249 c := fake .NewClientBuilder ().
4350 WithScheme (scheme ).
@@ -57,10 +64,11 @@ func Test_MachineSetReconciler_Reconcile(t *testing.T) {
5764 assert .Equal (t , "4096" , updated .Annotations [memoryKey ])
5865 assert .Equal (t , "0" , updated .Annotations [gpuKey ])
5966 assert .Equal (t , "a=a,b=b,kubernetes.io/arch=amd64" , updated .Annotations [labelsKey ])
67+ assert .Equal (t , "50Gi" , updated .Annotations [diskKey ])
6068}
6169
62- func setFlavorOnMachineSet (machine * machinev1beta1.MachineSet , flavor string ) {
70+ func setMachineSetProviderData (machine * machinev1beta1.MachineSet , providerData * csv1beta1. CloudscaleMachineProviderSpec ) {
6371 machine .Spec .Template .Spec .ProviderSpec .Value = & runtime.RawExtension {
64- Raw : []byte (fmt .Sprintf (`{"flavor": "%s"}` , flavor )),
72+ Raw : []byte (fmt .Sprintf (`{"flavor": "%s", "rootVolumeSizeGB": %d }` , providerData . Flavor , providerData . RootVolumeSizeGB )),
6573 }
6674}
0 commit comments