Skip to content

Commit 4d379f1

Browse files
committed
Fix AgentHarness CI failures
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
1 parent 9664936 commit 4d379f1

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
- name: Install agent-sandbox
8282
run: |
8383
kubectl apply -f "https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${AGENT_SANDBOX_VERSION}/manifest.yaml"
84-
kubectl wait --for=condition=Established crd/sandboxes.agents.x-k8s.io --timeout=90s
84+
timeout 90s bash -c 'until [ "$(kubectl get crd sandboxes.agents.x-k8s.io -o jsonpath="{.status.conditions[?(@.type==\"Established\")].status}" 2>/dev/null)" = "True" ]; do sleep 1; done'
8585
kubectl rollout status deployment/agent-sandbox-controller -n agent-sandbox-system --timeout=120s
8686
kubectl wait --for=condition=Ready pod -l app=agent-sandbox-controller -n agent-sandbox-system --timeout=120s
8787

go/core/pkg/sandboxbackend/substrate/lifecycle_actortemplate.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package substrate
33
import (
44
"context"
55
"fmt"
6+
"maps"
67
"strings"
78

89
atev1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1"
@@ -94,12 +95,8 @@ func mergeLabels(existing, desired map[string]string) map[string]string {
9495
return nil
9596
}
9697
merged := make(map[string]string, len(existing)+len(desired))
97-
for k, v := range existing {
98-
merged[k] = v
99-
}
100-
for k, v := range desired {
101-
merged[k] = v
102-
}
98+
maps.Copy(merged, existing)
99+
maps.Copy(merged, desired)
103100
return merged
104101
}
105102

go/core/pkg/sandboxbackend/substrate/lifecycle_delete_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package substrate
22

33
import (
44
"context"
5+
"slices"
56
"testing"
67

78
atev1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1"
@@ -24,10 +25,8 @@ type recordingActorClient struct {
2425
}
2526

2627
func (r *recordingActorClient) GetActor(_ context.Context, in *ateapipb.GetActorRequest, _ ...grpc.CallOption) (*ateapipb.GetActorResponse, error) {
27-
for _, deleted := range r.deleted {
28-
if deleted == in.GetActorId() {
29-
return nil, status.Error(codes.NotFound, "actor deleted")
30-
}
28+
if slices.Contains(r.deleted, in.GetActorId()) {
29+
return nil, status.Error(codes.NotFound, "actor deleted")
3130
}
3231
return &ateapipb.GetActorResponse{
3332
Actor: &ateapipb.Actor{

0 commit comments

Comments
 (0)