util

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSVToMap

func CSVToMap(reader io.Reader) (map[string]string, error)

func GetResourceVersion

func GetResourceVersion(c client.Client, o client.Object, name, namespace string, timeout, poll time.Duration) string

getResourceVersion fetches the current resource version for an object, returns an empty string if the object doesn't exists

func LoadRedisDataset

func LoadRedisDataset(ctx context.Context, srv *redis.Server, file string) error

func MinioClient

func MinioClient(ctx context.Context, cfg *rest.Config, podKey types.NamespacedName, user, passwd string) (*s3.Client, chan struct{}, error)

func MustParseRFC3339

func MustParseRFC3339(in string) time.Time

func NewTestPortForwarder

func NewTestPortForwarder(cfg *rest.Config, key types.NamespacedName, localPort, podPort uint32,
	out io.Writer, stopCh chan struct{}, readyCh chan struct{}) (*portforward.PortForwarder, error)

func PortForward

func PortForward(cfg *rest.Config, key types.NamespacedName, podPort uint32) (uint32, chan struct{}, error)

func RecordToKeyValues

func RecordToKeyValues(headers []string, record []string) map[string]string

func RedisClient

func RedisClient(cfg *rest.Config, podKey types.NamespacedName) (*redis.Server, chan struct{}, error)

func SentinelClient

func SentinelClient(cfg *rest.Config, podKey types.NamespacedName) (*redis.Server, chan struct{}, error)

Types

type ExpectedResource

type ExpectedResource struct {
	Namespace   string
	Name        string
	Missing     bool
	LastVersion string
}

func (*ExpectedResource) Assert

func (er *ExpectedResource) Assert(c client.Client, o client.Object, timeout, poll time.Duration) func()

checkResource checks if a k8s resource exists, has been updated or is missing)

type ExpectedWorkload

type ExpectedWorkload struct {
	Namespace      string
	Name           string
	Replicas       int32
	ContainerName  string
	ContainerImage string
	ContainterCmd  []string
	ContainterArgs []string
	HPA            bool
	PDB            bool
	PodMonitor     bool
	EnvoyConfig    bool
	LastVersion    string
}

func (*ExpectedWorkload) Assert

func (ew *ExpectedWorkload) Assert(c client.Client, dep *appsv1.Deployment, timeout, poll time.Duration) func()

checkWorkloadResources checks if all the k8s resource generated by a workload exists and matches the expectedWorkload specification

Jump to

Keyboard shortcuts

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