During desired nodes updates the system validates that the provided node settings are valid in order to avoid boot looping issues. If one of the node settings depends on a secure setting, the validation fails even when the secure setting is present and correct.
server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/desirednodes/TransportDesiredNodesActionsIT.java
latestDesiredNodes.nodes().stream().map(DesiredNodeWithStatus::desiredNode).toList(),
            containsInAnyOrder(updateDesiredNodesRequest.getNodes().toArray())
        );
    }
    private UpdateDesiredNodesRequest randomUpdateDesiredNodesRequest() {
        return randomUpdateDesiredNodesRequest(Settings.EMPTY);
    }
    private UpdateDesiredNodesRequest randomUpdateDesiredNodesRequest(Settings settings) {
        return randomUpdateDesiredNodesRequest(Version.CURRENT, settings);
    }
    private UpdateDesiredNodesRequest randomUpdateDesiredNodesRequest(Version version, Settings settings) {
        return new UpdateDesiredNodesRequest(
            UUIDs.randomBase64UUID(),
            randomIntBetween(2, 20),
            randomList(2, 10, () -> randomDesiredNode(version, settings)),
            false
        );
    }
    private UpdateDesiredNodesRequest randomDryRunUpdateDesiredNodesRequest(Version version, Settings settings) {
        return new UpdateDesiredNodesRequest(
            UUIDs.randomBase64UUID(),
            randomIntBetween(2, 20),
            randomList(2, 10, () -> randomDesiredNode(version, settings)),
            true
        );
    }
    private void deleteDesiredNodes() {
        final DeleteDesiredNodesAction.Request request = new DeleteDesiredNodesAction.Request();
        client().execute(DeleteDesiredNodesAction.INSTANCE, request).actionGet();
    }