util

package
v0.0.0-...-b5a8d59 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSelectiveInfoInResourceNode

func AddSelectiveInfoInResourceNode(resourceNode *bean.ResourceNode, gvk schema.GroupVersionKind, obj map[string]interface{})

func BuildAppHealthStatus

func BuildAppHealthStatus(nodes []*bean.ResourceNode) *bean.HealthStatusCode

app health is worst of the nodes health or if app status is healthy then check for hibernation status

func ComputePodHash

func ComputePodHash(template *coreV1.PodTemplateSpec, collisionCount *int32) string

func ConvertToV1Deployment

func ConvertToV1Deployment(nodeObj map[string]interface{}) (*v1beta1.Deployment, error)

func ConvertToV1ReplicaSet

func ConvertToV1ReplicaSet(nodeObj map[string]interface{}) (*v1beta1.ReplicaSet, error)

func DeepHashObject

func DeepHashObject(hasher hash.Hash, objectToWrite interface{})

DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.

func ExtractAllDockerImages

func ExtractAllDockerImages(manifests []unstructured.Unstructured) ([]string, error)

func GetAppId

func GetAppId(clusterId int32, release *release.Release) string

GetAppId returns AppID by logic cluster_id|namespace|release_name

func GetAppStatusOnBasisOfHealthyNonHealthy

func GetAppStatusOnBasisOfHealthyNonHealthy(healthStatusArray []*bean.HealthStatus) *bean.HealthStatusCode

func GetHookMetadata

func GetHookMetadata(manifest *unstructured.Unstructured) (bool, string)

func GetMessageFromReleaseStatus

func GetMessageFromReleaseStatus(releaseStatus release.Status) string

func GetPorts

func GetPorts(manifest *unstructured.Unstructured, gvk schema.GroupVersionKind) []int64

func GetReplicaSetPodHash

func GetReplicaSetPodHash(replicasetObj *v1beta1.ReplicaSet, collisionCount *int32) string

func GetRolloutPodHash

func GetRolloutPodHash(rollout map[string]interface{}) string

func GetRolloutPodTemplateHash

func GetRolloutPodTemplateHash(replicasetNode *bean.ResourceNode) string

func GetUpdateRevisionForStatefulSet

func GetUpdateRevisionForStatefulSet(obj map[string]interface{}) string

func IsMapSubset

func IsMapSubset(mapSet interface{}, mapSubset interface{}) bool

func IsReleaseNotFoundError

func IsReleaseNotFoundError(err error) bool

Types

type ExtraNodeInfo

type ExtraNodeInfo struct {
	// UpdateRevision is only used for StatefulSets, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
	UpdateRevision         string
	ResourceNetworkingInfo *bean.ResourceNetworkingInfo
	RolloutCurrentPodHash  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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