Documentation
¶
Index ¶
- Constants
- func CleanAndTruncateString(s string, n int) string
- func ComputeBuildID(w *temporaliov1alpha1.TemporalWorkerDeployment) string
- func ComputeVersionID(w *temporaliov1alpha1.TemporalWorkerDeployment) 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 SplitVersionID(versionID string) (deploymentName, buildID string, err error)
- type DeploymentState
Constants ¶
const ( DeployOwnerKey = ".metadata.controller" // BuildIDLabel is the label that identifies the build ID for a deployment BuildIDLabel = "temporal.io/build-id" DeploymentNameSeparator = "/" // TODO(carlydf): change this to "." once the server accepts `.` in deployment names VersionIDSeparator = "." // TODO(carlydf): change this to ":" K8sResourceNameSeparator = "-" MaxBuildIdLen = 63 )
Variables ¶
This section is empty.
Functions ¶
func CleanAndTruncateString ¶
CleanAndTruncateString truncates string to the first n characters, and then replaces characters that can't be in a kubernetes resource name with a `-` character which can be. Pass n = -1 to skip truncation.
func ComputeBuildID ¶
func ComputeBuildID(w *temporaliov1alpha1.TemporalWorkerDeployment) string
func ComputeVersionID ¶
func ComputeVersionID(w *temporaliov1alpha1.TemporalWorkerDeployment) string
ComputeVersionID generates a version ID from the worker deployment spec
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 SplitVersionID ¶
SplitVersionID splits a version ID into its components
Types ¶
type DeploymentState ¶
type DeploymentState struct {
// Map of versionID to deployment
Deployments map[string]*appsv1.Deployment
// Sorted deployments by creation time
DeploymentsByTime []*appsv1.Deployment
// Map of 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