@@ -850,7 +850,7 @@ NamespacedName
diskDrives
-DiskDrivesTemplate
+[]DiskDrivesTemplate
diff --git a/pkg/api/v1/vino_types.go b/pkg/api/v1/vino_types.go
index 22d4eca..c2d1a77 100644
--- a/pkg/api/v1/vino_types.go
+++ b/pkg/api/v1/vino_types.go
@@ -104,15 +104,15 @@ type VMRoutes struct {
//NodeSet node definitions
type NodeSet struct {
- //Parameter for Node master or worker-standard
+ //Parameter for Node master or worker
Name string `json:"name,omitempty"`
Count int `json:"count,omitempty"`
// BMHLabels labels will be copied directly to BMHs that will be created
// These labels will override keys from k8s node, that are specified in vino.NodeLabelKeysToCopy
- BMHLabels map[string]string `json:"bmhLabels,omitempty"`
- LibvirtTemplateDefinition NamespacedName `json:"libvirtTemplate,omitempty"`
- NetworkInterfaces []NetworkInterface `json:"networkInterfaces,omitempty"`
- DiskDrives *DiskDrivesTemplate `json:"diskDrives,omitempty"`
+ BMHLabels map[string]string `json:"bmhLabels,omitempty"`
+ LibvirtTemplateDefinition NamespacedName `json:"libvirtTemplate,omitempty"`
+ NetworkInterfaces []NetworkInterface `json:"networkInterfaces,omitempty"`
+ DiskDrives []DiskDrivesTemplate `json:"diskDrives,omitempty"`
// NetworkDataTemplate must have a template key
NetworkDataTemplate NamespacedName `json:"networkDataTemplate,omitempty"`
}
diff --git a/pkg/api/v1/zz_generated.deepcopy.go b/pkg/api/v1/zz_generated.deepcopy.go
index 031a33b..59d4c40 100644
--- a/pkg/api/v1/zz_generated.deepcopy.go
+++ b/pkg/api/v1/zz_generated.deepcopy.go
@@ -324,8 +324,10 @@ func (in *NodeSet) DeepCopyInto(out *NodeSet) {
}
if in.DiskDrives != nil {
in, out := &in.DiskDrives, &out.DiskDrives
- *out = new(DiskDrivesTemplate)
- (*in).DeepCopyInto(*out)
+ *out = make([]DiskDrivesTemplate, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
}
out.NetworkDataTemplate = in.NetworkDataTemplate
}
diff --git a/pkg/controllers/vino_controller.go b/pkg/controllers/vino_controller.go
index a48cb0b..ccabe3a 100644
--- a/pkg/controllers/vino_controller.go
+++ b/pkg/controllers/vino_controller.go
@@ -320,7 +320,7 @@ func (r *VinoReconciler) ensureDaemonSet(ctx context.Context, vino *vinov1.Vino)
// controller should watch for changes in daemonset to reconcile if it breaks, and change status
// of the vino object
// controlleruti.SetControllerReference(vino, ds, r.scheme)
- ctx, cancel := context.WithTimeout(ctx, time.Second*30)
+ ctx, cancel := context.WithTimeout(ctx, time.Second*180)
defer cancel()
return r.waitDaemonSet(ctx, ds)
@@ -440,7 +440,7 @@ func (r *VinoReconciler) waitDaemonSet(ctx context.Context, ds *appsv1.DaemonSet
}
logger.Info("DaemonSet is not in ready status, rechecking in 2 seconds")
}
- time.Sleep(2 * time.Second)
+ time.Sleep(10 * time.Second)
}
}
}
diff --git a/tools/deployment/test-cr.sh b/tools/deployment/test-cr.sh
index b9f5c6d..4dce391 100755
--- a/tools/deployment/test-cr.sh
+++ b/tools/deployment/test-cr.sh
@@ -14,7 +14,8 @@ function vinoDebugInfo () {
server_label="airshipit.org/server=s1"
rack_label="airshipit.org/rack=r1"
-copyLabel="airshipit.org/k8s-role=worker"
+master_copy_label="airshipit.org/k8s-role=master"
+worker_copy_label="airshipit.org/k8s-role=worker"
# Label all nodes with the same rack/label. We are ok with this for this simple test.
kubectl label node --overwrite=true --all $server_label $rack_label
@@ -34,7 +35,7 @@ until [[ $(kubectl get vino vino-test-cr 2>/dev/null) ]]; do
fi
sleep 2
done
-if ! kubectl wait --for=condition=Ready vino vino-test-cr --timeout=180s; then
+if ! kubectl wait --for=condition=Ready vino vino-test-cr --timeout=600s; then
vinoDebugInfo
fi
@@ -52,11 +53,17 @@ if ! kubectl -n vino-system rollout status ds default-vino-test-cr --timeout=10s
vinoDebugInfo
fi
-bmhCount=$(kubectl get baremetalhosts -n vino-system -l "$server_label,$server_label,$copyLabel" -o name | wc -l)
+masterCount=$(kubectl get baremetalhosts -n vino-system -l "$server_label,$server_label,$master_copy_label" -o name | wc -l)
-# with this setup set up, exactly 3 BMHs must have been created by VINO controller
+# with this setup set up, exactly 1 master must have been created by VINO controller
-[[ "$bmhCount" -eq "3" ]]
+[[ "$masterCount" -eq "1" ]]
+
+workerCount=$(kubectl get baremetalhosts -n vino-system -l "$server_label,$server_label,$worker_copy_label" -o name | wc -l)
+
+# with this setup set up, exactly 4 workers must have been created by VINO controller
+
+[[ "$workerCount" -eq "4" ]]
kubectl get baremetalhosts -n vino-system --show-labels=true