Similar to https://github.com/elastic/elasticsearch/issues/82807 Kibana upgrades can never succeed if a cluster already exceeded the maximum open shards.

It would reduce the downtime and help our users safely upgrade if we emitted a critical warning from the deprecations info API for this condition. At the moment it will only help users upgrading from 7.x to 8.x but we hope to enable the upgrade assistant during minor upgrades too https://github.com/elastic/kibana/issues/117220
x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java
NodeDeprecationChecks::checkScriptContextCacheExpirationSetting,
                NodeDeprecationChecks::checkEnforceDefaultTierPreferenceSetting,
                NodeDeprecationChecks::checkLifecyleStepMasterTimeoutSetting,
                NodeDeprecationChecks::checkEqlEnabledSetting,
                NodeDeprecationChecks::checkNodeAttrData
            );
    static List<Function<IndexMetadata, DeprecationIssue>> INDEX_SETTINGS_CHECKS = List.of(
        IndexDeprecationChecks::oldIndicesCheck,
        IndexDeprecationChecks::translogRetentionSettingCheck,
        IndexDeprecationChecks::checkIndexDataPath,
        IndexDeprecationChecks::storeTypeSettingCheck,
        IndexDeprecationChecks::frozenIndexSettingCheck
    );
    /**
     * helper utility function to reduce repeat of running a specific {@link List} of checks.
     *
     * @param checks The functional checks to execute using the mapper function
     * @param mapper The function that executes the lambda check with the appropriate arguments
     * @param <T> The signature of the check (BiFunction, Function, including the appropriate arguments)
     * @return The list of {@link DeprecationIssue} that were found in the cluster
     */
    static <T> List<DeprecationIssue> filterChecks(List<T> checks, Function<T, DeprecationIssue> mapper) {
        return checks.stream().map(mapper).filter(Objects::nonNull).collect(Collectors.toList());
    }
    @FunctionalInterface
    public interface NodeDeprecationCheck<A, B, C, D, R> {
        R apply(A first, B second, C third, D fourth);
    }
}