From 78cf196bc0cccea9b16c4103d1852ae1da6870fa Mon Sep 17 00:00:00 2001 From: Kevin Williams Date: Mon, 16 Nov 2026 21:14:29 +0000 Subject: [PATCH] feat(search): Index organizations and projects There was no ResourceIndexPolicy for resourcemanager Organization or Project, so the search service never indexed them and staff-portal search could never return an organization or project. --- .../search.miloapis.com/kustomization.yaml | 2 ++ .../organization-resourceindexpolicy.yaml | 21 ++++++++++++++++++ .../project-resourceindexpolicy.yaml | 22 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 config/services/search.miloapis.com/organization-resourceindexpolicy.yaml create mode 100644 config/services/search.miloapis.com/project-resourceindexpolicy.yaml diff --git a/config/services/search.miloapis.com/kustomization.yaml b/config/services/search.miloapis.com/kustomization.yaml index 0c316f0..ab3ca2b 100644 --- a/config/services/search.miloapis.com/kustomization.yaml +++ b/config/services/search.miloapis.com/kustomization.yaml @@ -9,6 +9,8 @@ resources: - httpproxy-resourceindexpolicy.yaml - exportpolicy-resourceindexpolicy.yaml - workload-resourceindexpolicy.yaml + - organization-resourceindexpolicy.yaml + - project-resourceindexpolicy.yaml # Use explicit sorting options so we can guarantee order in which resources are # applied. diff --git a/config/services/search.miloapis.com/organization-resourceindexpolicy.yaml b/config/services/search.miloapis.com/organization-resourceindexpolicy.yaml new file mode 100644 index 0000000..f3efcb6 --- /dev/null +++ b/config/services/search.miloapis.com/organization-resourceindexpolicy.yaml @@ -0,0 +1,21 @@ +apiVersion: search.miloapis.com/v1alpha1 +kind: ResourceIndexPolicy +metadata: + name: organization-resource-index-policy +spec: + conditions: + - expression: has(metadata.name) + name: has-name + fields: + - path: .metadata.name + searchable: true + - path: .metadata.annotations["kubernetes.io/display-name"] + searchable: true + - path: .metadata.annotations["kubernetes.io/description"] + searchable: true + - path: .spec.type + searchable: false + targetResource: + group: resourcemanager.miloapis.com + kind: Organization + version: v1alpha1 diff --git a/config/services/search.miloapis.com/project-resourceindexpolicy.yaml b/config/services/search.miloapis.com/project-resourceindexpolicy.yaml new file mode 100644 index 0000000..7628363 --- /dev/null +++ b/config/services/search.miloapis.com/project-resourceindexpolicy.yaml @@ -0,0 +1,22 @@ +apiVersion: search.miloapis.com/v1alpha1 +kind: ResourceIndexPolicy +metadata: + name: project-resource-index-policy +spec: + conditions: + - expression: has(metadata.name) + name: has-name + fields: + - path: .metadata.name + searchable: true + - path: .metadata.annotations["kubernetes.io/display-name"] + searchable: true + - path: .metadata.annotations["kubernetes.io/description"] + searchable: true + # The owning organization, so searching an org name also finds its projects. + - path: .spec.ownerRef.name + searchable: true + targetResource: + group: resourcemanager.miloapis.com + kind: Project + version: v1alpha1