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