Skip to content

Commit

Permalink
fix nil pointer for dnsrecord deletion (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
kon-angelo authored Jun 4, 2024
1 parent ccdb085 commit 724c08e
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/controller/dnsrecord/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"

"github.com/gardener/gardener-extension-provider-azure/pkg/apis/azure"
"github.com/gardener/gardener-extension-provider-azure/pkg/apis/azure/helper"
azureclient "github.com/gardener/gardener-extension-provider-azure/pkg/azure/client"
)
Expand Down Expand Up @@ -96,18 +95,8 @@ func (a *actuator) Reconcile(ctx context.Context, log logr.Logger, dns *extensio
}

// Delete deletes the DNSRecord.
func (a *actuator) Delete(ctx context.Context, log logr.Logger, dns *extensionsv1alpha1.DNSRecord, cluster *extensionscontroller.Cluster) error {
cloudProfile, err := helper.CloudProfileConfigFromCluster(cluster)
if err != nil {
return err
}

var cloudConfiguration *azure.CloudConfiguration
if cloudProfile != nil {
cloudConfiguration = cloudProfile.CloudConfiguration
}

azCloudConfiguration, err := azureclient.AzureCloudConfigurationFromCloudConfiguration(cloudConfiguration)
func (a *actuator) Delete(ctx context.Context, log logr.Logger, dns *extensionsv1alpha1.DNSRecord, _ *extensionscontroller.Cluster) error {
azCloudConfiguration, err := azureclient.AzureCloudConfigurationFromCloudConfiguration(nil)
if err != nil {
return err
}
Expand Down

0 comments on commit 724c08e

Please sign in to comment.