Skip to content

Commit 728b0f3

Browse files
Merge pull request #2843 from benjaminapetersen/trello/api-groups/controller/pod/objectToResourceGroupVersion
Automatic merge from submit-queue. Update pod controller to use objectToResourceGroupVersion when creating the debug pod Pretty sure this is more future proof.
2 parents f48bf3f + 9d94d74 commit 728b0f3

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

app/scripts/controllers/pod.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,7 @@ angular.module('openshiftConsole')
381381
return;
382382
}
383383

384-
// Create the debug pod.
385-
DataService.create($scope.podsVersion, null, debugPod, context).then(
384+
DataService.create(APIService.objectToResourceGroupVersion(debugPod), null, debugPod, context).then(
386385
function(pod) {
387386
var container = _.find($scope.pod.spec.containers, { name: containerName });
388387
$scope.debugPod = pod;

dist/scripts/scripts.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -4897,9 +4897,9 @@ r.imageStreams = e.by("metadata.name"), l.buildDockerRefMapForImageStreams(r.ima
48974897
})), h.push(s.watch(v, a, function(e) {
48984898
r.builds = e.by("metadata.name"), u.log("builds (subscribe)", r.builds);
48994899
}));
4900-
var i, d = function() {
4900+
var d, m = function() {
49014901
var t = r.debugPod;
4902-
i && (s.unwatch(i), i = null), $(window).off("beforeunload.debugPod"), t && (s.delete(r.podsVersion, t.metadata.name, a, {
4902+
d && (s.unwatch(d), d = null), $(window).off("beforeunload.debugPod"), t && (s.delete(r.podsVersion, t.metadata.name, a, {
49034903
gracePeriodSeconds: 0
49044904
}).then(_.noop, function(n) {
49054905
r.alerts["debug-container-error"] = {
@@ -4908,36 +4908,36 @@ message: "Could not delete pod " + t.metadata.name,
49084908
details: e("getErrorDetails")(n)
49094909
};
49104910
}), r.debugPod = null);
4911-
}, m = function() {
4911+
}, f = function() {
49124912
$(".terminal:visible").focus();
49134913
};
49144914
r.hasFullscreen = c.hasFullscreen(!0), r.fullscreenTerminal = function() {
4915-
c.requestFullscreen("#container-terminal-wrapper"), setTimeout(m);
4915+
c.requestFullscreen("#container-terminal-wrapper"), setTimeout(f);
49164916
}, r.exitFullscreen = function() {
49174917
c.exitFullscreen();
49184918
}, r.debugTerminal = function(t) {
49194919
var n = p.generateDebugPod(r.pod, t);
4920-
n ? s.create(r.podsVersion, null, n, a).then(function(e) {
4921-
var c = _.find(r.pod.spec.containers, {
4920+
n ? s.create(i.objectToResourceGroupVersion(n), null, n, a).then(function(e) {
4921+
var i = _.find(r.pod.spec.containers, {
49224922
name: t
49234923
});
49244924
r.debugPod = e, $(window).on("beforeunload.debugPod", function() {
49254925
return "Are you sure you want to leave with the debug terminal open? The debug pod will not be deleted unless you close the dialog.";
4926-
}), i = s.watchObject(r.podsVersion, n.metadata.name, a, function(e) {
4926+
}), d = s.watchObject(r.podsVersion, n.metadata.name, a, function(e) {
49274927
r.debugPod = e;
49284928
}), o.open({
49294929
templateUrl: "views/modals/debug-terminal.html",
49304930
controller: "DebugTerminalModalController",
49314931
scope: r,
49324932
resolve: {
49334933
container: function() {
4934-
return c;
4934+
return i;
49354935
},
49364936
image: function() {
4937-
return _.get(r, [ "imagesByDockerReference", c.image ]);
4937+
return _.get(r, [ "imagesByDockerReference", i.image ]);
49384938
}
49394939
}
4940-
}).result.then(d);
4940+
}).result.then(m);
49414941
}, function(n) {
49424942
r.alerts["debug-container-error"] = {
49434943
type: "error",
@@ -4954,7 +4954,7 @@ return e && e.forEach(function(e) {
49544954
e.state && e.state.running && t++;
49554955
}), t;
49564956
}, r.$on("$destroy", function() {
4957-
s.unwatchAll(h), d(), k();
4957+
s.unwatchAll(h), m(), k();
49584958
});
49594959
}));
49604960
} ]), angular.module("openshiftConsole").controller("OverviewController", [ "$scope", "$filter", "$q", "$location", "$routeParams", "AlertMessageService", "APIService", "AppsService", "BindingService", "BuildsService", "CatalogService", "Constants", "DataService", "DeploymentsService", "HomePagePreferenceService", "HPAService", "HTMLService", "ImageStreamResolver", "KeywordService", "LabelFilter", "Logger", "MetricsService", "Navigate", "OwnerReferencesService", "PodsService", "ProjectsService", "PromiseUtils", "ResourceAlertsService", "RoutesService", "ServiceInstancesService", OverviewController ]), angular.module("openshiftConsole").controller("QuotaController", [ "$filter", "$routeParams", "$scope", "APIService", "DataService", "Logger", "ProjectsService", function(e, t, n, r, a, o, i) {

0 commit comments

Comments
 (0)