Skip to content

Commit

Permalink
feat: Add the possibility to update the default handler for the Globa…
Browse files Browse the repository at this point in the history
…l 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 183caca)

Co-authored-by: armory-abedonik <[email protected]>
  • Loading branch information
mergify[bot] and armory-abedonik authored Dec 19, 2024
1 parent 06fa412 commit 03b5643
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class GlobalResourcePropertyRegistry implements ResourcePropertyRegistry
private final ImmutableMap<KubernetesKind, KubernetesResourceProperties> globalProperties;
private ImmutableMap<KubernetesKind, KubernetesResourceProperties> crdProperties =
ImmutableMap.of();
private final KubernetesResourceProperties defaultProperties;
private KubernetesResourceProperties defaultProperties;

@Autowired
public GlobalResourcePropertyRegistry(
Expand All @@ -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<KubernetesHandler> handlers) {
this.crdProperties =
handlers.stream()
Expand Down

0 comments on commit 03b5643

Please sign in to comment.