Documentation
¶
Index ¶
- Constants
- func CleanStringForDNS(s string) string
- func ComputeBuildID(w *temporaliov1alpha1.TemporalWorkerDeployment) string
- func ComputeConnectionSpecHash(connection temporaliov1alpha1.TemporalConnectionSpec) string
- func ComputeVersionedDeploymentName(baseName, buildID string) string
- func ComputeWorkerDeploymentName(w *temporaliov1alpha1.TemporalWorkerDeployment) string
- func IsDeploymentHealthy(deployment *appsv1.Deployment) (bool, *metav1.Time)
- func NewDeploymentWithControllerRef(w *temporaliov1alpha1.TemporalWorkerDeployment, buildID string, ...) (*appsv1.Deployment, error)
- func NewDeploymentWithOwnerRef(typeMeta *metav1.TypeMeta, objectMeta *metav1.ObjectMeta, ...) *appsv1.Deployment
- func NewObjectRef(obj client.Object) *corev1.ObjectReference
- func TruncateString(s string, n int) string
- type DeploymentState
Constants ¶
const ( DeployOwnerKey = ".metadata.controller" // BuildIDLabel is the label that identifies the build ID for a deployment BuildIDLabel = "temporal.io/build-id" WorkerDeploymentNameSeparator = "/" ResourceNameSeparator = "-" MaxBuildIdLen = 63 ConnectionSpecHashAnnotation = "temporal.io/connection-spec-hash" )
Variables ¶
This section is empty.
Functions ¶
func CleanStringForDNS ¶ added in v1.0.0
func ComputeBuildID ¶
func ComputeBuildID(w *temporaliov1alpha1.TemporalWorkerDeployment) string
func ComputeConnectionSpecHash ¶ added in v0.1.5
func ComputeConnectionSpecHash(connection temporaliov1alpha1.TemporalConnectionSpec) string
TODO (Shivam): Change hash when secret name is updated as well.
func ComputeVersionedDeploymentName ¶
ComputeVersionedDeploymentName generates a name for a versioned deployment
func ComputeWorkerDeploymentName ¶
func ComputeWorkerDeploymentName(w *temporaliov1alpha1.TemporalWorkerDeployment) string
ComputeWorkerDeploymentName generates the base worker deployment name
func IsDeploymentHealthy ¶
func IsDeploymentHealthy(deployment *appsv1.Deployment) (bool, *metav1.Time)
IsDeploymentHealthy checks if a deployment is in the "Available" state
func NewDeploymentWithControllerRef ¶
func NewDeploymentWithControllerRef( w *temporaliov1alpha1.TemporalWorkerDeployment, buildID string, connection temporaliov1alpha1.TemporalConnectionSpec, reconcilerScheme *runtime.Scheme, ) (*appsv1.Deployment, error)
func NewDeploymentWithOwnerRef ¶
func NewDeploymentWithOwnerRef( typeMeta *metav1.TypeMeta, objectMeta *metav1.ObjectMeta, spec *temporaliov1alpha1.TemporalWorkerDeploymentSpec, workerDeploymentName string, buildID string, connection temporaliov1alpha1.TemporalConnectionSpec, ) *appsv1.Deployment
NewDeploymentWithOwnerRef creates a new deployment resource, including owner references
func NewObjectRef ¶
func NewObjectRef(obj client.Object) *corev1.ObjectReference
NewObjectRef creates a reference to a Kubernetes object
func TruncateString ¶ added in v1.0.0
TruncateString truncates string to the first n characters. Pass n = -1 to skip truncation.
Types ¶
type DeploymentState ¶
type DeploymentState struct {
// Map of buildID to deployment
Deployments map[string]*appsv1.Deployment
// Sorted deployments by creation time
DeploymentsByTime []*appsv1.Deployment
// Map of buildID to deployment references
DeploymentRefs map[string]*corev1.ObjectReference
}
DeploymentState represents the Kubernetes state of all deployments for a temporal worker deployment
func GetDeploymentState ¶
func GetDeploymentState( ctx context.Context, k8sClient client.Client, namespace string, ownerName string, workerDeploymentName string, ) (*DeploymentState, error)
GetDeploymentState queries Kubernetes to get the state of all deployments associated with a TemporalWorkerDeployment