Skip to content

Commit f69ab6f

Browse files
authored
Merge pull request #937 from yastij/automated-cherry-pick-of-#925-upstream-release-0.6
Automated cherry pick of #925: Use DataSecretName to get Bootstrap data
2 parents 8b8e776 + aebece3 commit f69ab6f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

controllers/vspheremachine_controller.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"time"
2626

2727
"github.com/pkg/errors"
28+
corev1 "k8s.io/api/core/v1"
2829
apierrors "k8s.io/apimachinery/pkg/api/errors"
2930
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3031
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -388,7 +389,13 @@ func (r machineReconciler) reconcileNormalPre7(ctx *context.MachineContext, vsph
388389
}))
389390

390391
// Instruct the VSphereVM to use the CAPI bootstrap data resource.
391-
vm.Spec.BootstrapRef = ctx.Machine.Spec.Bootstrap.ConfigRef
392+
// TODO: BootstrapRef field should be replaced with BootstrapSecret of type string
393+
vm.Spec.BootstrapRef = &corev1.ObjectReference{
394+
APIVersion: "v1",
395+
Kind: "Secret",
396+
Name: *ctx.Machine.Spec.Bootstrap.DataSecretName,
397+
Namespace: ctx.Machine.ObjectMeta.Namespace,
398+
}
392399

393400
// Initialize the VSphereVM's labels map if it is nil.
394401
if vm.Labels == nil {

0 commit comments

Comments
 (0)