Skip to content

Commit cf9c610

Browse files
author
OpenShift Bot
authored
Merge pull request #2165 from benjaminapetersen/bpetersen/trello/api-groups/create-config-map-fix
Merged by openshift-bot
2 parents 1e91555 + 3b3117b commit cf9c610

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

app/scripts/controllers/createConfigMap.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ angular.module('openshiftConsole')
3232
}
3333
];
3434

35-
var configMapsVersion = APIService.getPreferredVersion('configmaps');
36-
3735
var hideErrorNotifications = function() {
3836
NotificationsService.hideNotification("create-config-map-error");
3937
};
@@ -67,7 +65,8 @@ angular.module('openshiftConsole')
6765
if ($scope.createConfigMapForm.$valid) {
6866
hideErrorNotifications();
6967
$scope.disableInputs = true;
70-
DataService.create(configMapsVersion, null, $scope.configMap, context)
68+
var createConfigMapVersion = APIService.objectToResourceGroupVersion($scope.configMap);
69+
DataService.create(createConfigMapVersion, null, $scope.configMap, context)
7170
.then(function() { // Success
7271
NotificationsService.addNotification({
7372
type: "success",

dist/scripts/scripts.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -6378,14 +6378,14 @@ link: "project/" + n.projectName + "/browse/config-maps"
63786378
}, {
63796379
title: "Create Config Map"
63806380
} ];
6381-
var u = r.getPreferredVersion("configmaps"), d = function() {
6381+
var u = function() {
63826382
c.hideNotification("create-config-map-error");
63836383
};
6384-
n.$on("$destroy", d);
6385-
var p = function() {
6384+
n.$on("$destroy", u);
6385+
var d = function() {
63866386
a.history.back();
63876387
};
6388-
n.cancel = p, l.get(t.project).then(_.spread(function(a, r) {
6388+
n.cancel = d, l.get(t.project).then(_.spread(function(a, l) {
63896389
n.project = a, o.canI("configmaps", "create", t.project) ? (n.configMap = {
63906390
apiVersion: "v1",
63916391
kind: "ConfigMap",
@@ -6394,19 +6394,23 @@ namespace: t.project
63946394
},
63956395
data: {}
63966396
}, n.createConfigMap = function() {
6397-
n.createConfigMapForm.$valid && (d(), n.disableInputs = !0, i.create(u, null, n.configMap, r).then(function() {
6397+
if (n.createConfigMapForm.$valid) {
6398+
u(), n.disableInputs = !0;
6399+
var t = r.objectToResourceGroupVersion(n.configMap);
6400+
i.create(t, null, n.configMap, l).then(function() {
63986401
c.addNotification({
63996402
type: "success",
64006403
message: "Config map " + n.configMap.metadata.name + " successfully created."
6401-
}), p();
6404+
}), d();
64026405
}, function(t) {
64036406
n.disableInputs = !1, c.addNotification({
64046407
id: "create-config-map-error",
64056408
type: "error",
64066409
message: "An error occurred creating the config map.",
64076410
details: e("getErrorDetails")(t)
64086411
});
6409-
}));
6412+
});
6413+
}
64106414
}) : s.toErrorPage("You do not have authority to create config maps in project " + t.project + ".", "access_denied");
64116415
}));
64126416
} ]), angular.module("openshiftConsole").controller("RoutesController", [ "$routeParams", "$scope", "DataService", "$filter", "LabelFilter", "ProjectsService", function(e, t, n, a, r, o) {

0 commit comments

Comments
 (0)