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: util.go
    path of file: ./repos/tidb-operator/pkg/backup/util
    
    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 util

import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"net/url"
	"path"
	"strings"
	"time"
	"unsafe"

	"github.com/Masterminds/semver"
	"github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1"
	"github.com/pingcap/tidb-operator/pkg/apis/util/config"
	"github.com/pingcap/tidb-operator/pkg/backup/constants"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/util/wait"
	corelisterv1 "k8s.io/client-go/listers/core/v1"
	"k8s.io/client-go/util/retry"
	"k8s.io/klog/v2"
)

var (
	// the first version which allows skipping setting tikv_gc_life_time
	// https://github.com/pingcap/br/pull/553
	tikvLessThanV408, _ = semver.NewConstraint("<v4.0.8-0")
	// the first version which supports log backup
	tikvLessThanV610, _ = semver.NewConstraint("<v6.1.0-0")
)

// CheckAllKeysExistInSecret check if all keys are included in the specific secret
// return the not-exist keys join by ","
func CheckAllKeysExistInSecret(secret *corev1.Secret, keys ...string) (string, bool) {
	var notExistKeys []string

	for _, key := range
    
func generateAzblobCertEnvVar(azblob *v1alpha1.AzblobStorageProvider, useAAD bool) ([]corev1.EnvVar, string, error) {
	if len(azblob.AccessTier) == 0 {
		azblob.AccessTier = "Cool"
	}
	envVars := []corev1.EnvVar{
		{
			Name:  "AZURE_ACCESS_TIER",
			Value: azblob.AccessTier,
		},
	}
	if azblob.SecretName != "" {
		envVars = append(envVars, []corev1.EnvVar{
			{
				Name: "AZURE_STORAGE_ACCOUNT",
				ValueFrom: &corev1.EnvVarSource{
					SecretKeyRef: &corev1.SecretKeySelector{
						LocalObjectReference: corev1.LocalObjectReference{Name: azblob.SecretName},
						Key:                  constants.AzblobAccountName,
					},
				},
			},
		}...)
		if useAAD {
			envVars = append(envVars, []corev1.EnvVar{
				{
					Name: "AZURE_CLIENT_ID",
					ValueFrom: &corev1.EnvVarSource{
						SecretKeyRef: &corev1.SecretKeySelector{
							LocalObjectReference: corev1.LocalObjectReference{Name: azblob.SecretName},
							Key:                  constants.AzblobClientID,
						},
					},
				},
				{
					Name: "AZURE_CLIENT_SECRET",
					ValueFrom: &corev1.EnvVarSource{
						SecretKeyRef: &corev1.SecretKeySelector{
							LocalObjectReference: corev1.LocalObjectReference{Name: azblob.SecretName},
							Key:                  constants.AzblobClientScrt,
						},
					},
				},
				{
					Name: "AZURE_TENANT_ID",
					ValueFrom: &corev1.EnvVarSource{
						SecretKeyRef: &corev1.SecretKeySelector{
							LocalObjectReference: corev1.LocalObjectReference{Name: azblob.SecretName},
							Key:                  constants.AzblobTenantID,
						},
					},
				},
			}...)
		} else {
			envVars = append(envVars, []corev1.EnvVar{
				{
					Name: "AZURE_STORAGE_KEY",
					ValueFrom: &corev1.EnvVarSource{
						SecretKeyRef: &corev1.SecretKeySelector{
							LocalObjectReference: corev1.LocalObjectReference{Name: azblob.SecretName},
							Key:                  constants.AzblobAccountKey,
						},
					},
				},
			}...)
		}
	}
	return envVars, "", nil
}