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

import (
	"context"
	"fmt"
	"strings"
	"time"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime/schema"
)

// CommandCompletion generates CLI suggestions from resources in a given cluster
// It uses a list of arguments and a substring from the CLI to filter suggestions.
type CommandCompletion struct {
	k8sAPI    *KubernetesAPI
	namespace string
}

// NewCommandCompletion creates a command completion module
func NewCommandCompletion(
	k8sAPI *KubernetesAPI,
	namespace string,
) *CommandCompletion {
	return &CommandCompletion{
		k8sAPI:    k8sAPI,
		namespace: namespace,
	}
}

    
func (c *CommandCompletion) getGroupVersionKindForResource(resourceName string) (*schema.GroupVersionResource, error) {
	_, apiResourceList, err := c.k8sAPI.Discovery().ServerGroupsAndResources()
	if err != nil {
		return nil, err
	}

	// find the plural name to ensure the resource we are searching for is not a subresource
	// i.e. deployment/scale
	pluralResourceName, err := PluralResourceNameFromFriendlyName(resourceName)
	if err != nil {
		return nil, fmt.Errorf("%s not a valid resource name", resourceName)
	}

	gvr, err := findGroupVersionResource(resourceName, pluralResourceName, apiResourceList)
	if err != nil {
		return nil, fmt.Errorf("could not find GroupVersionResource for %s", resourceName)
	}

	return gvr, nil
}