From 14dccc38f7552a81393ed6c694b6a302447f0ed2 Mon Sep 17 00:00:00 2001 From: Juan Pardo Date: Fri, 26 Jan 2024 12:46:48 +0100 Subject: [PATCH] Fixed Grand Central Prometheus annotation --- crate/operator/grand_central.py | 2 +- tests/test_create.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crate/operator/grand_central.py b/crate/operator/grand_central.py index 27e9435d..07c9c336 100644 --- a/crate/operator/grand_central.py +++ b/crate/operator/grand_central.py @@ -125,7 +125,6 @@ def get_grand_central_deployment( metadata=V1ObjectMeta( name=f"{GRAND_CENTRAL_RESOURCE_PREFIX}-{name}", labels=labels, - annotations=annotations, owner_references=owner_references, ), spec=V1DeploymentSpec( @@ -137,6 +136,7 @@ def get_grand_central_deployment( ), template=V1PodTemplateSpec( metadata=V1ObjectMeta( + annotations=annotations, labels=labels, name=f"{GRAND_CENTRAL_RESOURCE_PREFIX}-{name}", ), diff --git a/tests/test_create.py b/tests/test_create.py index a52772f1..9e53eb0c 100644 --- a/tests/test_create.py +++ b/tests/test_create.py @@ -1267,8 +1267,10 @@ async def test_create_with_grand_central_backend_enabled( ) # Test Prometheus - assert deploy.metadata.annotations["prometheus.io/scrape"] == "true" - assert deploy.metadata.annotations["prometheus.io/port"] == str( + assert ( + deploy.spec.template.metadata.annotations["prometheus.io/scrape"] == "true" + ) + assert deploy.spec.template.metadata.annotations["prometheus.io/port"] == str( GRAND_CENTRAL_PROMETHEUS_PORT ) app_prometheus_port = next(