Kubernetes Operator for Tangled Spindles

bug fixes around logs. update my tangled core version

evan.jarrett.net 7f48e70d ac6286c1

verified
+17 -20
-1
.tangled/workflows/workflow-amd64.yaml
··· 15 15 - name: verify build artifacts 16 16 command: | 17 17 ls -lh bin/ 18 - file bin/manager
-1
.tangled/workflows/workflow-arm64.yaml
··· 15 15 - name: verify build artifacts 16 16 command: | 17 17 ls -lh bin/ 18 - file bin/manager
+1 -1
config/manager/kustomization.yaml
··· 8 8 images: 9 9 - name: controller 10 10 newName: atcr.io/evan.jarrett.net/loom 11 - newTag: v0.0.9 11 + newTag: latest
+1 -1
go.mod
··· 197 197 ) 198 198 199 199 // Use our custom version of tangled until its upstreamed 200 - replace tangled.org/core => tangled.org/evan.jarrett.net/core v0.0.0-20251108052645-99c60f368227 200 + replace tangled.org/core => tangled.org/evan.jarrett.net/core v1.9.1-alpha.0.20251109064205-7149c5d466a4
+2 -2
go.sum
··· 687 687 sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= 688 688 sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= 689 689 sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= 690 - tangled.org/evan.jarrett.net/core v0.0.0-20251108052645-99c60f368227 h1:WMfpaMasshb9XXti7CvOV1Lj6uE0eRgYOKhHdjaLwuI= 691 - tangled.org/evan.jarrett.net/core v0.0.0-20251108052645-99c60f368227/go.mod h1:CUO6beA36K/Cwt0u2yrO5CG+L7+LzAc6zi6WudwO7qs= 690 + tangled.org/evan.jarrett.net/core v1.9.1-alpha.0.20251109064205-7149c5d466a4 h1:R6RmsktI5UbV5ydlNk7X2coWKw7xUTvGfJ+yghNTZXg= 691 + tangled.org/evan.jarrett.net/core v1.9.1-alpha.0.20251109064205-7149c5d466a4/go.mod h1:CUO6beA36K/Cwt0u2yrO5CG+L7+LzAc6zi6WudwO7qs=
+10
internal/controller/spindleset_controller.go
··· 165 165 func (r *SpindleSetReconciler) updateStatus(ctx context.Context, spindleSet *loomv1alpha1.SpindleSet) error { 166 166 logger := log.FromContext(ctx) 167 167 168 + // Re-fetch the SpindleSet to get the latest version before updating status 169 + // This avoids optimistic concurrency conflicts when the object was modified 170 + // by another reconciliation loop (e.g., triggered by Job creation/updates) 171 + latestSpindleSet := &loomv1alpha1.SpindleSet{} 172 + if err := r.Get(ctx, client.ObjectKeyFromObject(spindleSet), latestSpindleSet); err != nil { 173 + return fmt.Errorf("failed to fetch latest SpindleSet: %w", err) 174 + } 175 + // Use the latest version for all subsequent operations 176 + spindleSet = latestSpindleSet 177 + 168 178 // List all Jobs owned by this SpindleSet 169 179 jobList := &batchv1.JobList{} 170 180 if err := r.List(ctx, jobList, client.InNamespace(spindleSet.Namespace), client.MatchingLabels{
+3 -14
internal/engine/kubernetes_engine.go
··· 445 445 continue 446 446 } 447 447 448 - step := workflow.Steps[event.StepID] 449 - 450 448 switch event.Kind { 451 449 case "control": 452 - // Step start/end events 453 - var status models.StepStatus 454 - if event.Event == "start" { 455 - status = models.StepStatusStart 456 - } else if event.Event == "end" { 457 - status = models.StepStatusEnd 458 - } else { 459 - continue // Unknown control event 460 - } 461 - 462 - controlWriter := wfLogger.ControlWriter(event.StepID, step, status) 463 - controlWriter.Write([]byte{}) 450 + // Control events (start/end) are already written by the spindle engine in engine.go 451 + // We don't need to write them again here to avoid duplicates 452 + continue 464 453 465 454 case "data": 466 455 // Log output from step