hash

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TemplateHashKey is a key for storing PodTemplateSpec's hash value in labels.
	// It will be used to check whether pod's PodTemplateSpec has changed, if yes,
	// we need recreate or do in-place update for the pod according to the value of UniqHash.
	TemplateHashKey = "tapp_template_hash_key"
	// UniqHashKey is a key for storing hash value of PodTemplateSpec(without container images) in labels.
	// It will will be used to check whether pod's PodTemplateSpec hash changed and only container images
	// changed, if yes, we will do in place update for the pod.
	UniqHashKey = "tapp_uniq_hash_key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TappHashInterface

type TappHashInterface interface {
	// SetTemplateHash sets PodTemplateSpec's hash value into template's labels,
	// returns true if needs set and is set, otherwise false
	SetTemplateHash(template *corev1.PodTemplateSpec) bool
	// GetTemplateHash returns PodTemplateSpec's hash value, the values is stored in labels.
	GetTemplateHash(labels map[string]string) string
	// SetUniqHash sets hash value of PodTemplateSpec(without container images) into template's labels,
	// returns true if needs set and is set, otherwise false
	SetUniqHash(template *corev1.PodTemplateSpec) bool
	// GetUniqHash returns hash value of PodTemplateSpec(without container images), the values is stored in labels.
	GetUniqHash(labels map[string]string) string
	// HashLabels returns labels key that stores TemplateHash and UniqHash
	HashLabels() []string
}

TappHashInterface is used for generate and verify hash for tapp.

func NewTappHash

func NewTappHash() TappHashInterface

Jump to

Keyboard shortcuts

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