clustername

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderCatalog map[string]Provider

ProviderCatalog holds all the various kinds of clustername providers

Functions

func GetClusterID

func GetClusterID() (string, error)

GetClusterID looks for an env variable which should contain the cluster ID. This variable should come from a configmap, created by the cluster-agent. This function is meant for the node-agent to call (cluster-agent should call GetOrCreateClusterID)

func GetClusterName

func GetClusterName(ctx context.Context, hostname string) string

GetClusterName returns a k8s cluster name if it exists, either directly specified or autodiscovered

func ResetClusterName

func ResetClusterName()

ResetClusterName resets the clustername, which allows it to be detected again. Used for tests

Types

type Provider

type Provider func(context.Context) (string, error)

Provider is a generic function to grab the clustername and return it

Jump to

Keyboard shortcuts

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