utils

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllNodeUnit            = "unit-node-all"
	EdgeNodeUnit           = "unit-node-edge"
	CloudNodeUnit          = "unit-node-cloud"
	MasterNodeUnit         = "unit-node-master"
	MigrationCompletedAnno = "site.superedge.io/migration-done"
	NodeUnitCRDName        = "nodeunits.site.superedge.io"
	NodeGroupCRDName       = "nodegroups.site.superedge.io"
	KinsRoleLabelKey       = "site.superedge.io/kins-role"
	KinsResourceLabelKey   = "site.superedge.io/kins-resource"
)
View Source
const Finalizers = `
{"metadata":{"finalizers":null}}
`

Variables

This section is empty.

Functions

func CaculateNodeGroupStatus added in v0.9.0

func CaculateNodeGroupStatus(unitSet sets.String, ng *sitev1.NodeGroup) (*sitev1.NodeGroupStatus, error)

func CaculateNodeUnitStatus added in v0.9.0

func CaculateNodeUnitStatus(nodeMap map[string]*corev1.Node, nu *sitev1.NodeUnit) (*sitev1.NodeUnitStatus, error)

func CreateDefaultUnit

func CreateDefaultUnit(ctx context.Context, crdClient *crdClientset.Clientset) error

func DeleteNodeUnitFromSetNode added in v0.9.0

func DeleteNodeUnitFromSetNode(crdClient *crdClientset.Clientset, ng *sitev1.NodeGroup, unitMaps map[string]*sitev1.NodeUnit) error

func DeleteNodesFromSetNode

func DeleteNodesFromSetNode(kubeClient clientset.Interface, nu *sitev1.NodeUnit, nodeMaps map[string]*corev1.Node) error

func FoundNode added in v0.9.0

func FoundNode(nodes []string, node string) bool

func GetGroupsByUnit added in v0.9.0

func GetGroupsByUnit(groupLister crdv1listers.NodeGroupLister, nu *sitev1.NodeUnit) (nodeGroups []*sitev1.NodeGroup, groupList []string, err error)

GetUnitsByNode

func GetNodesByUnit

func GetNodesByUnit(nodeLister corelisters.NodeLister, nu *sitev1.NodeUnit) (sets.String, map[string]*corev1.Node, error)

func GetUnitByGroup added in v0.9.0

func GetUnitByGroup(unitLister crdv1listers.NodeUnitLister, ng *sitev1.NodeGroup) (sets.String, map[string]*sitev1.NodeUnit, error)

func GetUnitsByNode

func GetUnitsByNode(unitLister crdv1listers.NodeUnitLister, node *corev1.Node) (nodeUnits []*sitev1.NodeUnit, unitList []string, err error)

GetUnitsByNode

func HashAutoFindKeys added in v0.9.0

func HashAutoFindKeys(keyslices []string) string

func InitAllRosource added in v0.9.0

func InitAllRosource(ctx context.Context, crdClient *crdClientset.Clientset, extentionClient extensionclientset.Interface) error

func ListNodeFromLister added in v0.9.0

func ListNodeFromLister(nodeLister corelisters.NodeLister, selector labels.Selector, appendFn cache.AppendFunc) error

func ListNodeUnitFromLister added in v0.9.0

func ListNodeUnitFromLister(unitLister crdv1listers.NodeUnitLister, selector labels.Selector, appendFn cache.AppendFunc) error

func Migrator_v1alpha1_NodeGroup_To_v1alpha2_NodeGroup added in v0.9.0

func Migrator_v1alpha1_NodeGroup_To_v1alpha2_NodeGroup(ctx context.Context, crdClient *crdClientset.Clientset, extentionClient extensionclientset.Interface) error

func Migrator_v1alpha1_NodeUnit_To_v1alpha2_NodeUnit added in v0.9.0

func Migrator_v1alpha1_NodeUnit_To_v1alpha2_NodeUnit(ctx context.Context, crdClient *crdClientset.Clientset, extentionClient extensionclientset.Interface) error

func SetNodeToNodeUnits added in v0.9.0

func SetNodeToNodeUnits(crdClient *crdClientset.Clientset, ng *v1alpha2.NodeGroup, unitMaps map[string]*v1alpha2.NodeUnit) error

func SetNodeToNodes

func SetNodeToNodes(kubeClient clientset.Interface, nu *sitev1.NodeUnit, nodeMaps map[string]*corev1.Node) error

func TaintInSlices added in v0.9.0

func TaintInSlices(taintSlice []corev1.Taint, target corev1.Taint) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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