utils

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResourceOperability

func CheckResourceOperability(res client.Object, productName string) error

func GetCABundle added in v0.4.0

func GetCABundle(serviceURL string) ([]byte, error)

func GetHashMap added in v0.4.2

func GetHashMap[T any](objs []T) (map[uint32]T, sets.Set[uint32])

func GetProductLabel added in v0.4.0

func GetProductLabel(productName string) map[string]string

func GetStructHash added in v0.4.2

func GetStructHash(req interface{}) uint32

func IsBelongsToProduct

func IsBelongsToProduct(res client.Object, productName string) bool

IsBelongsToProduct check resouces is maintain by nautes

func IsLegal

func IsLegal(res client.Object, productName string) (string, bool)

IsLegal used to check resources is availabel for reconcile. It will return two vars, pass or not and the reason if check is failed.

func IsOwner

func IsOwner(owner, object client.Object, scheme *runtime.Scheme) bool

IsOwner check k8s resource is belongs to another resource

func RemoveOwner

func RemoveOwner(owner, object client.Object, scheme *runtime.Scheme) error

Types

type EntryPoint added in v0.4.1

type EntryPoint struct {
	Domain   string
	Port     int
	Protocol string
}

func GetEntryPointFromCluster added in v0.4.1

func GetEntryPointFromCluster(cluster v1alpha1.Cluster, hostCluster *v1alpha1.Cluster, protocol string) (*EntryPoint, error)

func (*EntryPoint) GetURL added in v0.4.1

func (e *EntryPoint) GetURL() string

type StringSet added in v0.4.1

type StringSet struct {
	sets.Set[string]
}

func NewStringSet added in v0.4.1

func NewStringSet(strs ...string) StringSet

func (StringSet) Len added in v0.4.1

func (ss StringSet) Len() int

func (StringSet) MarshalJSON added in v0.4.1

func (ss StringSet) MarshalJSON() ([]byte, error)

func (StringSet) MarshalYAML added in v0.4.1

func (ss StringSet) MarshalYAML() (interface{}, error)

func (*StringSet) UnmarshalJSON added in v0.4.1

func (ss *StringSet) UnmarshalJSON(b []byte) error

func (*StringSet) UnmarshalYAML added in v0.4.1

func (ss *StringSet) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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