util

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeUpgradeJobStatusKey   = "nodeupgradejob.operations.kubeedge.io/status"
	NodeUpgradeJobStatusValue = ""
	NodeUpgradeHistoryKey     = "nodeupgradejob.operations.kubeedge.io/history"
)
View Source
const (
	TaskUpgrade  = "upgrade"
	TaskRollback = "rollback"
	TaskBackup   = "backup"
	TaskPrePull  = "prepull"

	ISO8601UTC = "2006-01-02T15:04:05Z"
)

Variables

This section is empty.

Functions

func FilterVersion

func FilterVersion(version string, expected string) bool

FilterVersion returns true only if the edge node version already on the upgrade req version is like: v1.22.6-kubeedge-v1.10.0-beta.0.185+95378fb019912a, expected is like v1.10.0

func GetImageRepo

func GetImageRepo(image string) (string, error)

GetImageRepo gets repo from a container image

func GetNodeName

func GetNodeName(resource string) string

func GetTaskID

func GetTaskID(resource string) string

func IsEdgeNode

func IsEdgeNode(node *metav1.Node) bool

IsEdgeNode checks whether a node is an Edge Node only if label {"node-role.kubernetes.io/edge": ""} exists, it is an edge node

func MergeAnnotationUpgradeHistory

func MergeAnnotationUpgradeHistory(origin, fromVersion, toVersion string) string

MergeAnnotationUpgradeHistory constructs the new history based on the origin history and we'll only keep 3 records

func NodeUpdated

func NodeUpdated(old, new v1alpha1.TaskStatus) bool

func RemoveDuplicateElement

func RemoveDuplicateElement(s []string) []string

RemoveDuplicateElement deduplicate

func VersionLess

func VersionLess(version1, version2 string) (bool, error)

Types

type TaskMessage

type TaskMessage struct {
	Type            string
	Name            string
	TimeOutSeconds  *uint32
	ShutDown        bool
	CheckItem       []string
	Concurrency     int32
	FailureTolerate float64
	NodeNames       []string
	LabelSelector   *v1.LabelSelector
	Status          v1alpha1.TaskStatus
	Msg             interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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