Skip to content

Commit

Permalink
fix: cluster command was not migrated to cloud 2.0 (#1555)
Browse files Browse the repository at this point in the history
### Motivation
When migrating to cloud 2.0 we had to remove the queue from parsers and
replace it with CommandInput. The parser of network nodes was left out.
So we have to do it now.

### Modification
Replace Queue<String> with CommandInput in network cluster node parser.

### Result
The parser works correctly.
  • Loading branch information
0utplay authored Dec 16, 2024
1 parent 7fc8691 commit f0cc995
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Queue;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.NonNull;
Expand All @@ -62,7 +61,6 @@
import org.incendo.cloud.annotations.Permission;
import org.incendo.cloud.annotations.parser.Parser;
import org.incendo.cloud.annotations.suggestion.Suggestions;
import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.context.CommandInput;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
Expand Down Expand Up @@ -136,11 +134,8 @@ public ClusterCommand(
}

@Parser(suggestions = "networkClusterNode")
public @NonNull NetworkClusterNode defaultNetworkClusterNodeParser(
@NonNull CommandContext<?> $,
@NonNull Queue<String> input
) {
var nodeId = input.remove();
public @NonNull NetworkClusterNode defaultNetworkClusterNodeParser(@NonNull CommandInput input) {
var nodeId = input.readString();
var clusterNode = this.clusterNodeProvider.node(nodeId);
if (clusterNode == null) {
throw new ArgumentNotAvailableException(I18n.trans("command-cluster-node-not-found"));
Expand Down

0 comments on commit f0cc995

Please sign in to comment.