Skip to content

Commit 05fe6d2

Browse files
committed
Make default collections configurable
1 parent 0af2262 commit 05fe6d2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

helm-chart/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ api:
4343
GEODINI_API: "https://geodini.k8s.labs.ds.io"
4444
STAC_CATALOG_NAME: "planetarycomputer"
4545
STAC_CATALOG_URL: "https://planetarycomputer.microsoft.com/api/stac/v1"
46+
DEFAULT_TARGET_COLLECTIONS: "['landsat-8-c2-l2', 'sentinel-2-l2a']"
4647

4748
# Sensitive environment variables stored as Kubernetes secrets
4849
secrets:

stac_search/agents/items_search.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from datetime import date
2+
import json
23
import logging
34
import os
45
from dataclasses import dataclass
@@ -21,6 +22,10 @@
2122
STAC_CATALOG_URL = os.getenv(
2223
"STAC_CATALOG_URL", "https://planetarycomputer.microsoft.com/api/stac/v1"
2324
)
25+
DEFAULT_TARGET_COLLECTIONS = json.loads(
26+
os.getenv("DEFAULT_TARGET_COLLECTIONS", '["landsat-8-c2-l2", "sentinel-2-l2a"]')
27+
)
28+
2429

2530
logger = logging.getLogger(__name__)
2631

@@ -277,10 +282,7 @@ async def item_search(ctx: Context) -> ItemSearchResult:
277282
# determine the collections to search
278283
target_collections = await search_collections(ctx.query) or []
279284
logger.info(f"Target collections: {pformat(target_collections)}")
280-
default_target_collections = [
281-
"landsat-8-c2-l2",
282-
"sentinel-2-l2a",
283-
]
285+
default_target_collections = DEFAULT_TARGET_COLLECTIONS
284286
if target_collections:
285287
explanation = "Considering the following collections:"
286288
for result in target_collections.collections:

0 commit comments

Comments
 (0)