Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.14] OCPBUGS-30898: Remove startupScript vmextension lookup #106

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 0 additions & 18 deletions pkg/cloud/azure/actuators/machine/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,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 @@ -94,7 +93,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 @@ -437,22 +435,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