util

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReclaimSpaceTimeoutKey     = "reclaim-space-timeout"
	MaxConcurrentReconcilesKey = "max-concurrent-reconciles"
)

Variables

This section is empty.

Functions

func GetErrorMessage

func GetErrorMessage(err error) string

GetErrorMessage returns the message from the error if it is a grpc error, else returns err.Error().

func IsUnimplementedError added in v0.6.0

func IsUnimplementedError(err error) bool

IsUnimplementedError returns true if the error is Unimplemented error.

func NormalizeLeaseName added in v0.8.0

func NormalizeLeaseName(name string) string

NormalizeLeaseName sanitizes the provided string so it can be used as name for a Lease object.

Taken from csi-lib-utils/leaderelection:sanitizeName()

func RemoveFromSlice

func RemoveFromSlice(slice []string, s string) []string

RemoveFromSlice removes given string from given slice.

Types

type Config added in v0.7.0

type Config struct {
	Namespace               string
	ReclaimSpaceTimeout     time.Duration
	MaxConcurrentReconciles int
}

Config holds the configuration options that can be overrrided via a config file.

func NewConfig added in v0.7.0

func NewConfig() Config

NewConfig returns a new Config object with default values.

func (*Config) ReadConfigMap added in v0.7.0

func (cfg *Config) ReadConfigMap(ctx context.Context, kubeClient *kubernetes.Clientset) error

ReadConfigFile fetches the config file and updates the config options with values read from the config map.

Jump to

Keyboard shortcuts

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