Skip to content

Commit

Permalink
Merge pull request #103 from openshift-cherrypick-robot/cherry-pick-1…
Browse files Browse the repository at this point in the history
…02-to-release-4.15

[release-4.15] OCPBUGS-30215: Remove startupScript vmextension lookup
  • Loading branch information
openshift-merge-bot[bot] committed Mar 13, 2024
2 parents 90771ab + 1389e5b commit 2c8c33d
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions pkg/cloud/azure/actuators/machine/reconciler.go
Expand Up @@ -41,7 +41,6 @@ import (
"github.com/openshift/machine-api-provider-azure/pkg/cloud/azure/services/networkinterfaces"
"github.com/openshift/machine-api-provider-azure/pkg/cloud/azure/services/publicips"
"github.com/openshift/machine-api-provider-azure/pkg/cloud/azure/services/resourceskus"
"github.com/openshift/machine-api-provider-azure/pkg/cloud/azure/services/virtualmachineextensions"
"github.com/openshift/machine-api-provider-azure/pkg/cloud/azure/services/virtualmachines"
apicorev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -93,7 +92,6 @@ func NewReconciler(scope *actuators.MachineScope) *Reconciler {
interfaceLoadBalancersSvc: interfaceloadbalancers.NewService(scope),
networkInterfacesSvc: networkinterfaces.NewService(scope),
virtualMachinesSvc: virtualmachines.NewService(scope),
virtualMachinesExtSvc: virtualmachineextensions.NewService(scope),
publicIPSvc: publicips.NewService(scope),
disksSvc: disks.NewService(scope),
availabilitySetsSvc: availabilitysets.NewService(scope),
Expand Down Expand Up @@ -436,22 +434,6 @@ func (s *Reconciler) Exists(ctx context.Context) (bool, error) {
return false, fmt.Errorf("returned incorrect vm interface: %v", err)
}

if s.scope.MachineConfig.UserDataSecret == nil {
vmExtSpec := &virtualmachineextensions.Spec{
Name: "startupScript",
VMName: s.scope.Name(),
}

vmExt, err := s.virtualMachinesExtSvc.Get(ctx, vmExtSpec)
if err != nil && vmExt == nil {
return false, nil
}

if err != nil {
return false, fmt.Errorf("failed to get vm extension: %w", err)
}
}

switch machinev1.AzureVMState(*vm.ProvisioningState) {
case machinev1.VMStateDeleting:
return true, fmt.Errorf("vm for machine %s has unexpected 'Deleting' provisioning state", s.scope.Machine.GetName())
Expand Down

0 comments on commit 2c8c33d

Please sign in to comment.