tiflash

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewUnderlayClientFunc = func(c client.Client) timanager.NewUnderlayClientFunc[*v1alpha1.TiFlash, tiflashapi.TiFlashClient] {
	return func(f *v1alpha1.TiFlash) (tiflashapi.TiFlashClient, error) {
		ctx := context.Background()
		var cluster v1alpha1.Cluster
		if err := c.Get(ctx, client.ObjectKey{
			Name:      f.Spec.Cluster.Name,
			Namespace: f.Namespace,
		}, &cluster); err != nil {
			return nil, fmt.Errorf("cannot find cluster %s: %w", f.Spec.Cluster.Name, err)
		}

		if coreutil.IsTLSClusterEnabled(&cluster) {
			tlsConfig, err := apicall.GetClientTLSConfig[scope.TiFlash](ctx, c, f)
			if err != nil {
				return nil, fmt.Errorf("cannot get tls config from secret: %w", err)
			}

			url := coreutil.TiFlashProxyStatusURL(f, true)
			return tiflashapi.NewTiFlashClient(url, defaultTimeout, tlsConfig), nil
		}

		url := coreutil.TiFlashProxyStatusURL(f, false)
		return tiflashapi.NewTiFlashClient(url, defaultTimeout, nil), nil
	}
}

Functions

func CacheKeys

func CacheKeys(f *v1alpha1.TiFlash) ([]string, error)

CacheKeys returns the keys of the TiFlash. If any keys are changed, client will be renewed The first key is primary key to get client from manager

func Key

func Key(f *v1alpha1.TiFlash) string

Types

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL