util

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNextRevisionNumber

func GetNextRevisionNumber(revisions []*appsv1.ControllerRevision) int64

func GetNonLiveHistory

func GetNonLiveHistory(revisions []*appsv1.ControllerRevision, historyLimit int) []*appsv1.ControllerRevision

func GetPodLogs

func GetPodLogs(clientset *kubernetes.Clientset, pod *corev1.Pod) (string, error)

func GetRevisionWithNameNumber

func GetRevisionWithNameNumber(cr *appsv1.ControllerRevision) string

Compose revision in FlinkClusterStatus with name and number of ControllerRevision

func GetTime

func GetTime(timeStr string) time.Time

func HasTimeElapsed added in v0.4.2

func HasTimeElapsed(timeToCheckStr string, now time.Time, intervalSec int) bool

Check time has passed

func IsBlank

func IsBlank(s *string) bool

func MapDiff added in v0.4.2

func MapDiff[K comparable, V any](a, b map[K]V) map[K]DiffValue

func SetTimestamp

func SetTimestamp(target *string)

SetTimestamp sets the current timestamp to the target.

func UpperBoundedResourceList added in v0.4.2

func UpperBoundedResourceList(resources corev1.ResourceRequirements) *corev1.ResourceList

Types

type DiffValue added in v0.4.2

type DiffValue struct {
	Left  any
	Right any
}

type TimeConverter

type TimeConverter struct{}

TimeConverter converts between time.Time and string.

func (*TimeConverter) FromString

func (tc *TimeConverter) FromString(timeStr string) time.Time

FromString converts string to time.Time.

func (*TimeConverter) ToString

func (tc *TimeConverter) ToString(timestamp time.Time) string

ToString converts time.Time to string.

Jump to

Keyboard shortcuts

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