From 03b56434737dca18eadf93591ecf97e01b8c4bcb Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:09:16 +0000 Subject: [PATCH] feat: Add the possibility to update the default handler for the Global Resource Property Registry. (#5963) (#6323) * feat: Add possibility to re-set default handler for Global Resource Property Registry. * feat: Add not null check for defaultHandler param. (cherry picked from commit 183cacabbeba18854bb48660b9afd3524f1031fa) Co-authored-by: armory-abedonik <106548537+armory-abedonik@users.noreply.github.com> --- .../description/GlobalResourcePropertyRegistry.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/description/GlobalResourcePropertyRegistry.java b/clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/description/GlobalResourcePropertyRegistry.java index ffa87d9676c..14608219d4d 100644 --- a/clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/description/GlobalResourcePropertyRegistry.java +++ b/clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/description/GlobalResourcePropertyRegistry.java @@ -36,7 +36,7 @@ public class GlobalResourcePropertyRegistry implements ResourcePropertyRegistry private final ImmutableMap globalProperties; private ImmutableMap crdProperties = ImmutableMap.of(); - private final KubernetesResourceProperties defaultProperties; + private KubernetesResourceProperties defaultProperties; @Autowired public GlobalResourcePropertyRegistry( @@ -52,6 +52,12 @@ public GlobalResourcePropertyRegistry( new KubernetesResourceProperties(defaultHandler, defaultHandler.versioned()); } + public void setDefaultHandler( + @Nonnull KubernetesUnregisteredCustomResourceHandler defaultHandler) { + this.defaultProperties = + new KubernetesResourceProperties(defaultHandler, defaultHandler.versioned()); + } + public void updateCrdProperties(List handlers) { this.crdProperties = handlers.stream()