Skip to content

Commit 296d53a

Browse files
committed
chore: rollout exception message
1 parent f413347 commit 296d53a

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

extended/src/main/java/io/kubernetes/client/extended/kubectl/KubectlRollout.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.HashMap;
3232
import java.util.List;
3333
import java.util.Map;
34+
import java.util.stream.Collectors;
3435

3536
public class KubectlRollout<ApiType extends KubernetesObject> {
3637

@@ -140,7 +141,14 @@ private void deploymentViewHistory(V1Deployment deployment, AppsV1Api api) throw
140141
// get details of a specific revision
141142
V1PodTemplateSpec template = historyInfo.get(revision);
142143
if (template == null) {
143-
throw new ApiException("unable to find the specified revision " + revision);
144+
throw new ApiException(
145+
"unable to find the specified revision "
146+
+ revision
147+
+ ", supported revisions: ["
148+
+ historyInfo.keySet().stream()
149+
.map(Object::toString)
150+
.collect(Collectors.joining(","))
151+
+ "]");
144152
}
145153
this.template = template;
146154
return;
@@ -204,7 +212,14 @@ private void parseHistory(List<V1ControllerRevision> historyList, PodTemplatePar
204212
if (revision > 0) {
205213
V1ControllerRevision history = historyInfo.get(revision);
206214
if (history == null) {
207-
throw new ApiException("unable to find the specified revision " + revision);
215+
throw new ApiException(
216+
"unable to find the specified revision "
217+
+ revision
218+
+ ", supported revisions: ["
219+
+ historyInfo.keySet().stream()
220+
.map(Object::toString)
221+
.collect(Collectors.joining(","))
222+
+ "]");
208223
}
209224
template = parser.parse(history);
210225
return;

0 commit comments

Comments
 (0)