void reconcileStatus(String name) {
        client.fetch(Theme.class, name).ifPresent(theme -> {
            final Theme.ThemeStatus status =
                defaultIfNull(theme.getStatus(), new Theme.ThemeStatus());
            final Theme.ThemeStatus oldStatus = JsonUtils.deepCopy(status);
            theme.setStatus(status);

            var themePath = themeRoot.get().resolve(name);
            status.setLocation(themePath.toAbsolutePath().toString());

            status.setPhase(Theme.ThemePhase.READY);
            Condition.ConditionBuilder conditionBuilder = Condition.builder()
                .type(Theme.ThemePhase.READY.name())
                .status(ConditionStatus.TRUE)
                .reason(Theme.ThemePhase.READY.name())
                .message(StringUtils.EMPTY)
                .lastTransitionTime(Instant.now());

            // Check if this theme version is match requires param.
            String normalVersion = systemVersionSupplier.get().getNormalVersion();
            String requires = theme.getSpec().getRequires();
            if (!VersionUtils.satisfiesRequires(normalVersion, requires)) {
                status.setPhase(Theme.ThemePhase.FAILED);
                conditionBuilder
                    .type(Theme.ThemePhase.FAILED.name())
                    .status(ConditionStatus.FALSE)
                    .reason("UnsatisfiedRequiresVersion")
                    .message(String.format(
                        "Theme requires a minimum system version of [%s], and you have [%s].",
                        requires, normalVersion));
            }
            Theme.nullSafeConditionList(theme).addAndEvictFIFO(conditionBuilder.build());

            if (!Objects.equals(oldStatus, status)) {
                client.update(theme);
            }
        });
    }
@Test
    void reconcileStatus() {
        when(systemVersionSupplier.get()).thenReturn(Version.valueOf("2.3.0"));
        Path testWorkDir = tempDirectory.resolve("reconcile-delete");
        when(themeRoot.get()).thenReturn(testWorkDir);

        final ThemeReconciler themeReconciler =
            new ThemeReconciler(extensionClient, themeRoot, systemVersionSupplier);
        Theme theme = fakeTheme();
        theme.setStatus(null);
        theme.getSpec().setRequires(">2.3.0");
        when(extensionClient.fetch(eq(Theme.class), eq("fake-theme")))
            .thenReturn(Optional.of(theme));
        themeReconciler.reconcileStatus("fake-theme");
        ArgumentCaptor<Theme> themeUpdateCaptor = ArgumentCaptor.forClass(Theme.class);
        verify(extensionClient).update(themeUpdateCaptor.capture());
        Theme value = themeUpdateCaptor.getValue();
        assertThat(value.getStatus()).isNotNull();
        assertThat(value.getStatus().getConditions().peekFirst().getType())
            .isEqualTo(Theme.ThemePhase.FAILED.name());
        assertThat(value.getStatus().getPhase())
            .isEqualTo(Theme.ThemePhase.FAILED);

        theme.getSpec().setRequires(">=2.3.0");
        when(extensionClient.fetch(eq(Theme.class), eq("fake-theme")))
            .thenReturn(Optional.of(theme));
        themeReconciler.reconcileStatus("fake-theme");
        verify(extensionClient, times(2)).update(themeUpdateCaptor.capture());
        assertThat(themeUpdateCaptor.getValue().getStatus().getPhase())
            .isEqualTo(Theme.ThemePhase.READY);
    }