Skip to content

Commit ce38023

Browse files
committed
address comments
1 parent ee68d71 commit ce38023

5 files changed

Lines changed: 12 additions & 101 deletions

File tree

config/rbac/role.yaml

Lines changed: 0 additions & 66 deletions
This file was deleted.

config/webhook/manifests.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

internal/controller/clientpool/clientpool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
type ClientPoolKey struct {
2525
HostPort string
2626
Namespace string
27-
MutualTLSSecret string // Include secret name in key to invalidate cache when the secret name itself changes
27+
MutualTLSSecret string // Include secret name in key to invalidate cache when the secret name changes
2828
}
2929

3030
type ClientInfo struct {

internal/controller/worker_controller.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,19 @@ func (r *TemporalWorkerDeploymentReconciler) findTWDsUsingConnection(ctx context
226226
var requests []reconcile.Request
227227

228228
// Find all TWDs in same namespace that reference this TC
229-
var workers temporaliov1alpha1.TemporalWorkerDeploymentList
230-
if err := r.List(ctx, &workers, client.InNamespace(tc.GetNamespace())); err != nil {
229+
var twds temporaliov1alpha1.TemporalWorkerDeploymentList
230+
if err := r.List(ctx, &twds, client.InNamespace(tc.GetNamespace())); err != nil {
231231
return requests
232232
}
233233

234234
// Filter to ones using this connection
235-
for _, worker := range workers.Items {
236-
if worker.Spec.WorkerOptions.TemporalConnection == tc.GetName() {
237-
// Add the TWD object as a reconcile request
235+
for _, twd := range twds.Items {
236+
if twd.Spec.WorkerOptions.TemporalConnection == tc.GetName() {
237+
// Enqueue a reconcile request for this TWD
238238
requests = append(requests, reconcile.Request{
239239
NamespacedName: types.NamespacedName{
240-
Name: worker.Name,
241-
Namespace: worker.Namespace,
240+
Name: twd.Name,
241+
Namespace: twd.Namespace,
242242
},
243243
})
244244
}

internal/planner/planner.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ func GeneratePlan(
8888
return plan, nil
8989
}
9090

91-
// checkAndUpdateDeploymentConnectionSpec checks if a deployment needs to be updated. This is true if the connection spec it's using is outdated.
91+
// checkAndUpdateDeploymentConnectionSpec determines whether the Deployment for the given versionID is
92+
// out-of-date with respect to the provided TemporalConnectionSpec. If an update is required, it mutates
93+
// the existing Deployment in-place and returns a pointer to that Deployment. If no update is needed or
94+
// the Deployment does not exist, it returns nil.
9295
func checkAndUpdateDeploymentConnectionSpec(
9396
versionID string,
9497
k8sState *k8s.DeploymentState,

0 commit comments

Comments
 (0)