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: secret_convertion.go
    path of file: ./repos/kuma/pkg/plugins/runtime/k8s/controllers/gatewayapi
    
    the code of the file until where you have to start completion: package gatewayapi

import (
	"context"
	"fmt"

	"github.com/pkg/errors"
	"google.golang.org/protobuf/types/known/wrapperspb"
	kube_core "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/types"

	"github.com/kumahq/kuma/pkg/core/resources/apis/system"
	"github.com/kumahq/kuma/pkg/core/resources/model"
	core_store "github.com/kumahq/kuma
    
func convertSecret(secret *kube_core.Secret) ([]byte, error) {
	if secret.Type != kube_core.SecretTypeTLS {
		return nil, errors.Errorf("only secrets of type %q are supported", kube_core.SecretTypeTLS)
	}

	data := append(secret.Data["tls.key"], secret.Data["tls.crt"]...)

	if _, _, err := gateway.NewServerSecret(data); err != nil {
		// Don't return the exact error
		return nil, fmt.Errorf("malformed secret")
	}

	return data, nil
}