|
31 | 31 | import java.util.HashMap; |
32 | 32 | import java.util.List; |
33 | 33 | import java.util.Map; |
| 34 | +import java.util.stream.Collectors; |
34 | 35 |
|
35 | 36 | public class KubectlRollout<ApiType extends KubernetesObject> { |
36 | 37 |
|
@@ -140,7 +141,14 @@ private void deploymentViewHistory(V1Deployment deployment, AppsV1Api api) throw |
140 | 141 | // get details of a specific revision |
141 | 142 | V1PodTemplateSpec template = historyInfo.get(revision); |
142 | 143 | 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 | + + "]"); |
144 | 152 | } |
145 | 153 | this.template = template; |
146 | 154 | return; |
@@ -204,7 +212,14 @@ private void parseHistory(List<V1ControllerRevision> historyList, PodTemplatePar |
204 | 212 | if (revision > 0) { |
205 | 213 | V1ControllerRevision history = historyInfo.get(revision); |
206 | 214 | 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 | + + "]"); |
208 | 223 | } |
209 | 224 | template = parser.parse(history); |
210 | 225 | return; |
|
0 commit comments