Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions manifests/machineconfigcontroller/install-config-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: machine-config-controller-install-config
namespace: kube-system
rules:
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["cluster-config-v1"]
verbs: ["get"]
13 changes: 13 additions & 0 deletions manifests/machineconfigcontroller/install-config-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: machine-config-controller-install-config
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: machine-config-controller-install-config
subjects:
- kind: ServiceAccount
namespace: {{.TargetNamespace}}
name: machine-config-controller
8 changes: 4 additions & 4 deletions pkg/controller/bootimage/platform_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func reconcileAWSProviderSpec(streamData *stream.Stream, arch string, _ *osconfi
return true, newProviderSpec, nil
}

func reconcileVSphereProviderSpec(streamData *stream.Stream, arch string, infra *osconfigv1.Infrastructure, providerSpec *machinev1beta1.VSphereMachineProviderSpec, _ string, secretClient clientset.Interface) (bool, *machinev1beta1.VSphereMachineProviderSpec, error) {
func reconcileVSphereProviderSpec(streamData *stream.Stream, arch string, infra *osconfigv1.Infrastructure, providerSpec *machinev1beta1.VSphereMachineProviderSpec, _ string, kubeClient clientset.Interface) (bool, *machinev1beta1.VSphereMachineProviderSpec, error) {

if infra.Spec.PlatformSpec.VSphere == nil {
klog.Warningf("Reconcile skipped: VSphere field is nil in PlatformSpec %v", infra.Spec.PlatformSpec)
Expand All @@ -195,20 +195,20 @@ func reconcileVSphereProviderSpec(streamData *stream.Stream, arch string, infra
newProviderSpec := providerSpec.DeepCopy()

// Fetch the creds configmap
credsSc, err := secretClient.CoreV1().Secrets("kube-system").Get(context.TODO(), "vsphere-creds", metav1.GetOptions{})
credsSc, err := kubeClient.CoreV1().Secrets("kube-system").Get(context.TODO(), "vsphere-creds", metav1.GetOptions{})
if err != nil {
return false, nil, fmt.Errorf("failed to fetch vsphere-creds Secret during machineset sync: %w", err)
}

newBootImg, patchRequired, err := createNewVMTemplate(streamData, providerSpec, infra, credsSc, arch, artifacts.Release)
newBootImg, patchRequired, err := createNewVMTemplate(streamData, providerSpec, infra, credsSc, kubeClient, arch, artifacts.Release)
if err != nil {
return false, nil, err
}

// If patch is required, marshal the new providerspec into the machineset
if patchRequired {
// Ensure the ignition stub is the minimum acceptable spec required for boot image updates
if err := upgradeStubIgnitionIfRequired(providerSpec.UserDataSecret.Name, secretClient); err != nil {
if err := upgradeStubIgnitionIfRequired(providerSpec.UserDataSecret.Name, kubeClient); err != nil {
return false, nil, err
}
newProviderSpec.Template = newBootImg
Expand Down
Loading