Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
d1985e9
test(substrate): reproduce one tenant reading another's Substrate inv…
danielle-mustillo Oct 19, 2026
3633769
fix(substrate): scope actors and templates to the watched namespaces
danielle-mustillo Oct 19, 2026
edb3a0d
test(substrate): cover multi-namespace scope, unlabelled workers and …
danielle-mustillo Oct 19, 2026
ddc943b
fix(substrate): ask ate-api per watched atespace and hide unlabelled …
danielle-mustillo Oct 19, 2026
14eee7c
test(substrate): cover worker pools and a namespace watched twice
danielle-mustillo Oct 19, 2026
4707142
fix(substrate): count a namespace watched twice once
danielle-mustillo Oct 19, 2026
21afb4c
docs(api): say an empty atespace means the watched namespaces
danielle-mustillo Oct 19, 2026
11974a7
refactor(substrate): dedupe watched namespaces with slices.Compact
danielle-mustillo Oct 19, 2026
343f89d
test(substrate): actor page tokens must name only watched atespaces
danielle-mustillo Oct 19, 2026
58d2e87
fix(substrate): page actors through watched atespaces only
danielle-mustillo Oct 19, 2026
3db7861
test(substrate): worker page tokens and errors must name only watched…
danielle-mustillo Oct 19, 2026
b6407a3
fix(substrate): page workers by name and hide ate-api worker errors
danielle-mustillo Oct 19, 2026
b29e097
docs(substrate): describe paging for controllers that watch some name…
danielle-mustillo Oct 19, 2026
9e24460
docs(substrate): trim paging comments and correct empty-page wording
danielle-mustillo Oct 19, 2026
963bfea
test(substrate): expose row keys in fake page tokens and probe forged…
danielle-mustillo Oct 19, 2026
a5d74ef
fix(substrate): validate worker page tokens
danielle-mustillo Oct 19, 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
19 changes: 13 additions & 6 deletions go/api/gen/kagent/api/v1/system.pb.go

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

44 changes: 18 additions & 26 deletions go/core/internal/service/system/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewService(
) *Service {
return &Service{
kubeClient: kubeClient,
observedNamespaces: slices.Clone(observedNamespaces),
observedNamespaces: slices.Compact(slices.Sorted(slices.Values(observedNamespaces))),
authorizer: authorizer,
ateClient: ateClient,
}
Expand Down Expand Up @@ -148,16 +148,6 @@ func namespacesFromNames(names []string) []Namespace {
return result
}

func (s *Service) substrateNamespaces(requested string) []string {
if requested != "" {
return []string{requested}
}
if len(s.observedNamespaces) > 0 {
return slices.Clone(s.observedNamespaces)
}
return []string{""}
}

func (s *Service) listWorkerPools(ctx context.Context, namespace string) ([]atev1alpha1.WorkerPool, error) {
var options []client.ListOption
if namespace != "" {
Expand All @@ -173,22 +163,24 @@ func (s *Service) listWorkerPools(ctx context.Context, namespace string) ([]atev
}

// substrateActorTemplates drains upstream pagination for the configuration-sized list.
func (s *Service) substrateActorTemplates(ctx context.Context, atespace string) ([]*ateapipb.ActorTemplate, error) {
templatesFromAPI, err := s.ateClient.ListActorTemplates(ctx, atespace)
if err != nil {
return nil, err
}
templates := make([]*ateapipb.ActorTemplate, 0, len(templatesFromAPI))
for _, template := range templatesFromAPI {
if template == nil {
continue
func (s *Service) substrateActorTemplates(ctx context.Context, scope substrateScope) ([]*ateapipb.ActorTemplate, error) {
templates := []*ateapipb.ActorTemplate{}
for _, atespace := range scope.listNamespaces() {
templatesFromAPI, err := s.ateClient.ListActorTemplates(ctx, atespace)
if err != nil {
return nil, err
}
for _, template := range templatesFromAPI {
if template == nil {
continue
}
// Only expose inventory fields: containers can contain resolved credentials.
templates = append(templates, &ateapipb.ActorTemplate{
Metadata: template.GetMetadata(),
Status: template.GetStatus(),
WorkerSelector: template.GetWorkerSelector(),
})
}
// Only expose inventory fields: containers can contain resolved credentials.
templates = append(templates, &ateapipb.ActorTemplate{
Metadata: template.GetMetadata(),
Status: template.GetStatus(),
WorkerSelector: template.GetWorkerSelector(),
})
}

slices.SortStableFunc(templates, func(left, right *ateapipb.ActorTemplate) int {
Expand Down
Loading
Loading