Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
15d7b9a
First attempt at adding events to worker controller
thearcticwatch Feb 20, 2026
4495d80
Adding events to worker controller
thearcticwatch Feb 21, 2026
6c8e4f8
fix the breaking tests
thearcticwatch Feb 21, 2026
5900793
Fix golangci-lint errors: RBAC comment spacing and deprecated Requeue…
thearcticwatch Feb 21, 2026
e65c9d1
Refactor executePlan to reduce cognitive complexity
thearcticwatch Feb 21, 2026
df3448a
addressing the comments
thearcticwatch Feb 26, 2026
0b76e06
additional refactoring and addressing comments
thearcticwatch Feb 27, 2026
06882a8
Merge branch 'main' into add_events
thearcticwatch Feb 27, 2026
6e92e3a
standardize event/condition reason constants and split by API stability
carlydf Mar 3, 2026
9c1d7f5
rename VersionRegistrationFailed event reason to VersionPromotionFailed
carlydf Mar 3, 2026
11d382a
add functional tests for events and conditions, enumerate remaining t…
carlydf Mar 4, 2026
371a02f
only write to status once per reconcile loop
carlydf Mar 4, 2026
65c8236
print percentage correctly when it's an integer in [0,100]
carlydf Mar 4, 2026
ddef655
move all unhealthy connection tests into one function, explain why Re…
carlydf Mar 4, 2026
5fb51d2
unit test failure events that are hard to test end to end
carlydf Mar 5, 2026
a8ac8fa
refactor unit tests, do AuthSecretInvalid event when auth secret is n…
carlydf Mar 5, 2026
9a0c6a0
refactor to emit AuthSecretInvalid in more cases, only emit TemporalC…
carlydf Mar 5, 2026
5593873
fix lint
carlydf Mar 5, 2026
76069f1
fix lint fmt.Errorf -> errors.New when unformatted
carlydf Mar 6, 2026
dbff0f7
make planner nil-safe when DrainedSince is nil
carlydf Mar 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ skaffold.env
certs

.DS_Store
cover.out

.claude
.config
config
48 changes: 46 additions & 2 deletions api/v1alpha1/worker_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,49 @@ type TemporalWorkerDeploymentSpec struct {
WorkerOptions WorkerOptions `json:"workerOptions"`
}

// Condition type constants for TemporalWorkerDeployment.
const (
// ConditionTemporalConnectionHealthy indicates whether the referenced TemporalConnection
// resource exists and is properly configured.
ConditionTemporalConnectionHealthy = "TemporalConnectionHealthy"

// ConditionRolloutComplete indicates whether the target version has been successfully
// registered as the current version, completing the rollout.
ConditionRolloutComplete = "RolloutComplete"
)

// Condition reason constants for TemporalWorkerDeployment.
//
// These strings appear in status.conditions[].reason and are part of the CRD's
// status API. Operators, monitoring rules, and scripts may depend on them.
// They should be treated as stable within an API version and renamed only with
// a corresponding version bump.
const (
// ReasonTemporalConnectionNotFound is set on ConditionTemporalConnectionHealthy
// when the referenced TemporalConnection resource cannot be found.
ReasonTemporalConnectionNotFound = "TemporalConnectionNotFound"

// ReasonAuthSecretInvalid is set on ConditionTemporalConnectionHealthy when
// the auth secret referenced by the TemporalConnection cannot be resolved.
ReasonAuthSecretInvalid = "AuthSecretInvalid"

// ReasonTemporalClientCreationFailed is set on ConditionTemporalConnectionHealthy
// when a Temporal SDK client cannot be created for the connection.
ReasonTemporalClientCreationFailed = "TemporalClientCreationFailed"

// ReasonTemporalStateFetchFailed is set on ConditionTemporalConnectionHealthy
// when the controller cannot query the current worker deployment state from Temporal.
ReasonTemporalStateFetchFailed = "TemporalStateFetchFailed"

// ReasonTemporalConnectionHealthy is set on ConditionTemporalConnectionHealthy
// when the connection is reachable and the auth secret is resolved.
ReasonTemporalConnectionHealthy = "TemporalConnectionHealthy"

// ReasonRolloutComplete is set on ConditionRolloutComplete when the target
// version has been successfully registered as the current version.
ReasonRolloutComplete = "RolloutComplete"
)

// VersionStatus indicates the status of a version.
// +enum
type VersionStatus string
Expand Down Expand Up @@ -155,8 +198,9 @@ type TemporalWorkerDeploymentStatus struct {
// +kubebuilder:validation:Minimum=0
VersionCount int32 `json:"versionCount,omitempty"`

// TODO(jlegrone): Add additional status fields following Kubernetes API conventions
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// Conditions represent the latest available observations of the TemporalWorkerDeployment's current state.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

// WorkflowExecutionStatus describes the current state of a workflow.
Expand Down
45 changes: 44 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func main() {
}))),
mgr.GetClient(),
),
Recorder: mgr.GetEventRecorderFor("temporal-worker-controller"),
MaxDeploymentVersionsIneligibleForDeletion: controller.GetControllerMaxDeploymentVersionsIneligibleForDeletion(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "TemporalWorkerDeployment")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3950,13 +3950,13 @@ spec:
required:
- name
type: object
temporalNamespace:
minLength: 1
type: string
unsafeCustomBuildID:
maxLength: 63
pattern: ^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$
type: string
temporalNamespace:
minLength: 1
type: string
required:
- connectionRef
- temporalNamespace
Expand All @@ -3969,6 +3969,42 @@ spec:
type: object
status:
properties:
conditions:
items:
properties:
lastTransitionTime:
format: date-time
type: string
message:
maxLength: 32768
type: string
observedGeneration:
format: int64
minimum: 0
type: integer
reason:
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
enum:
- "True"
- "False"
- Unknown
type: string
type:
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
currentVersion:
properties:
buildID:
Expand Down
3 changes: 2 additions & 1 deletion internal/controller/clientpool/clientpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ func (cp *ClientPool) fetchClientUsingMTLSSecret(secret corev1.Secret, opts NewC
}

if _, err := c.CheckHealth(context.Background(), &sdkclient.CheckHealthRequest{}); err != nil {
panic(err)
c.Close()
return nil, fmt.Errorf("temporal server health check failed: %w", err)
}

cp.mux.Lock()
Expand Down
Loading
Loading