You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: handler.go
    path of file: ./repos/aws-node-termination-handler/pkg/interruptionevent/draincordon
    
    the code of the file until where you have to start completion: // Copyright 2016-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
//     http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License

package draincordon

import (
	"fmt"

	"github.com/aws/aws-node-termination-handler/pkg/config"
	"github.com/aws/aws-node-termination-handler/pkg/ec2metadata"
	"github.com/aws/aws-node-termination-handler/pkg/interruptionevent/internal/common"
	"github.com/aws/aws-node-termination-handler/pkg/
    
func (h *Handler) HandleEvent(drainEvent *monitor.InterruptionEvent) error {
	if !common.IsAllowedKind(drainEvent.Kind, allowedKinds...) {
		return nil
	}

	nodeFound := true
	nodeName, err := h.commonHandler.GetNodeName(drainEvent)
	if err != nil {
		return fmt.Errorf("get node name for instanceID=%s: %w", drainEvent.InstanceID, err)
	}

	nodeLabels, err := h.commonHandler.Node.GetNodeLabels(nodeName)
	if err != nil {
		log.Warn().
			Err(err).
			Interface("fallbackNodeLabels", drainEvent.NodeLabels).
			Str("nodeName", nodeName).
			Msg("Failed to get node labels. Proceeding with fallback labels")
		nodeFound = false
	} else {
		drainEvent.NodeLabels = nodeLabels
	}

	if drainEvent.PreDrainTask != nil {
		h.commonHandler.RunPreDrainTask(nodeName, drainEvent)
	}

	podNameList, err := h.commonHandler.Node.FetchPodNameList(nodeName)
	if err != nil {
		log.Warn().
			Err(err).
			Strs("fallbackPodNames", podNameList).
			Str("nodeName", nodeName).
			Msg("Failed to fetch pod names. Proceeding with fallback pod names")
	} else {
		drainEvent.Pods = podNameList
	}

	err = h.commonHandler.Node.LogPods(podNameList, nodeName)
	if err != nil {
		log.Warn().Err(err).Str("nodeName", nodeName).Msg("Failed to log pods")
	}

	if h.commonHandler.NthConfig.CordonOnly || (!h.commonHandler.NthConfig.EnableSQSTerminationDraining && drainEvent.IsRebalanceRecommendation() && !h.commonHandler.NthConfig.EnableRebalanceDraining) {
		err = h.cordonNode(nodeName, drainEvent)
	} else {
		err = h.cordonAndDrainNode(nodeName, drainEvent)
	}

	if h.commonHandler.NthConfig.WebhookURL != "" {
		webhook.Post(h.nodeMetadata, drainEvent, h.commonHandler.NthConfig)
	}

	if err != nil {
		h.commonHandler.InterruptionEventStore.CancelInterruptionEvent(drainEvent.EventID)
	} else {
		h.commonHandler.InterruptionEventStore.MarkAllAsProcessed(nodeName)
	}

	if (err == nil || (!nodeFound && h.commonHandler.NthConfig.DeleteSqsMsgIfNodeNotFound)) && drainEvent.PostDrainTask != nil {
		h.commonHandler.RunPostDrainTask(nodeName, drainEvent)
	}
	return nil
}