Skip to content

Commit 45c9967

Browse files
committed
Merge remote-tracking branch 'origin/fix/main-ci-jwt-worker-cache' into jjamroga/atenet-configurable-resource-names-and-chart
2 parents 133474d + f271d67 commit 45c9967

4 files changed

Lines changed: 33 additions & 8 deletions

File tree

cmd/ateapi/internal/controlapi/functional_test.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ type testContext struct {
237237
k8sClient kubernetes.Interface
238238
substrateClient versioned.Interface
239239
persistence *ateredis.Persistence
240+
workerCache *workercache.Cache
240241
fakeAtelet *FakeAteletServer
241242
cleanup func()
242243
actorTemplateLister listersv1alpha1.ActorTemplateLister
@@ -369,6 +370,7 @@ func setupTest(t *testing.T, ns string) *testContext {
369370
k8sClient: k8sClient,
370371
substrateClient: substrateClient,
371372
persistence: persistence,
373+
workerCache: wc,
372374
fakeAtelet: fakeAtelet,
373375
cleanup: cleanup,
374376
actorTemplateLister: actorTemplateLister,
@@ -583,13 +585,13 @@ func createWorkerPod(t *testing.T, tc *testContext, ns string, name string, node
583585
t.Fatalf("failed to update worker pod status: %v", err)
584586
}
585587

586-
// Wait for worker to be registered via API
588+
// Wait for worker to be visible to the scheduler.
587589
err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
588-
resp, err := tc.client.ListWorkers(ctx, &ateapipb.ListWorkersRequest{})
590+
workers, err := tc.workerCache.Workers()
589591
if err != nil {
590-
return false, nil // Retry on API error
592+
return false, nil
591593
}
592-
for _, w := range resp.GetWorkers() {
594+
for _, w := range workers {
593595
if w.GetWorkerNamespace() == ns && w.GetWorkerPod() == name {
594596
return true, nil
595597
}
@@ -608,13 +610,13 @@ func deleteWorkerPod(t *testing.T, tc *testContext, ns string, name string) {
608610
t.Fatalf("failed to delete worker pod %s: %v", name, err)
609611
}
610612

611-
// Wait for worker to be removed from API
613+
// Wait for worker to be removed from the scheduler.
612614
err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
613-
resp, err := tc.client.ListWorkers(ctx, &ateapipb.ListWorkersRequest{})
615+
workers, err := tc.workerCache.Workers()
614616
if err != nil {
615-
return false, nil // Retry on API error
617+
return false, nil
616618
}
617-
for _, w := range resp.GetWorkers() {
619+
for _, w := range workers {
618620
if w.GetWorkerNamespace() == ns && w.GetWorkerPod() == name {
619621
return false, nil // Still there
620622
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: v1
16+
kind: ServiceAccount
17+
metadata:
18+
name: ate-client
19+
namespace: ate-system
20+
labels:
21+
apps: ate-client

manifests/ate-install/jwt/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
1616
kind: Kustomization
1717

1818
resources:
19+
- ../ate-client.yaml
1920
- ../ate-api-server.yaml
2021
- ../ate-controller.yaml
2122
- ../atelet.yaml

manifests/ate-install/kind-jwt/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
1616
kind: Kustomization
1717

1818
resources:
19+
- ../ate-client.yaml
1920
- ../kind
2021

2122
patches:

0 commit comments

Comments
 (0)