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: statefulset.go
    path of file: ./repos/tidb-operator/tests/e2e/util/statefulset
    
    the code of the file until where you have to start completion: // Copyright 2019 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package statefulset

import (
	"context"
	"fmt"
	"regexp"
	"strconv"

	appsv1 "k8s.io/api/apps/v1"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/apimachinery/pkg/util/sets"
	"k8s.io/client-go/kubernetes"
	typedappsv
    
func GetMemberContainersFromSts(cli kubernetes.Interface, stsGetter typedappsv1.StatefulSetsGetter, namespace, stsName string, component v1alpha1.MemberType) ([]corev1.Container, error) {
	sts, err := stsGetter.StatefulSets(namespace).Get(context.TODO(), stsName, metav1.GetOptions{})
	if err != nil {
		return nil, fmt.Errorf("failed to get sts %s/%s: %v", namespace, stsName, err)
	}

	listOption := metav1.ListOptions{
		LabelSelector: labels.SelectorFromSet(sts.Spec.Selector.MatchLabels).String(),
	}
	podList, err := cli.CoreV1().Pods(sts.Namespace).List(context.TODO(), listOption)
	if err != nil {
		return nil, fmt.Errorf("failed to list pods of sts %s/%s: %v", namespace, stsName, err)
	}
	if len(podList.Items) == 0 {
		return nil, fmt.Errorf("no pod found of sts %s/%s", namespace, stsName)
	}

	containers := getContainersFromPods(podList.Items, string(component))
	if len(containers) == 0 {
		return nil, fmt.Errorf("no container %q found of sts %s/%s", component, namespace, stsName)
	}

	return containers, nil
}