Skip to content

Commit

Permalink
Merge pull request #2840 from benjaminapetersen/trello/api-groups/fro…
Browse files Browse the repository at this point in the history
…mFile/mismatch

Automatic merge from submit-queue.

Fix potential apiVersion mismatch in directives/fromFile

Unrelated to `preferredVersion`, but this seems to be the correct way to make this request.
  • Loading branch information
openshift-merge-robot committed Mar 2, 2018
2 parents 61f4a6a + e4b020f commit fb518ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/scripts/directives/fromFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ angular.module("openshiftConsole")
var resource;
if (!_.isEmpty($scope.createResources)) {
resource = _.head($scope.createResources);
DataService.create(APIService.kindToResource(resource.kind), null, resource, {namespace: $scope.input.selectedProject.metadata.name}).then(
DataService.create(APIService.objectToResourceGroupVersion(resource), null, resource, {namespace: $scope.input.selectedProject.metadata.name}).then(
// create resource success
function() {
if (!$scope.isDialog) {
Expand All @@ -387,7 +387,7 @@ angular.module("openshiftConsole")
});
} else {
resource = _.head($scope.updateResources);
DataService.update(APIService.kindToResource(resource.kind), resource.metadata.name, resource, {namespace: $scope.input.selectedProject.metadata.name}).then(
DataService.update(APIService.objectToResourceGroupVersion(resource), resource.metadata.name, resource, {namespace: $scope.input.selectedProject.metadata.name}).then(
// update resource success
function() {
if (!$scope.isDialog) {
Expand Down
4 changes: 2 additions & 2 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9714,7 +9714,7 @@ message: a.invalidObjectKindOrVersion(e)
}
function C() {
var t;
_.isEmpty(p.createResources) ? (t = _.head(p.updateResources), i.update(a.kindToResource(t.kind), t.metadata.name, t, {
_.isEmpty(p.createResources) ? (t = _.head(p.updateResources), i.update(a.objectToResourceGroupVersion(t), t.metadata.name, t, {
namespace: p.input.selectedProject.metadata.name
}).then(function() {
if (!p.isDialog) {
Expand All @@ -9732,7 +9732,7 @@ type: "error",
message: "Unable to update the " + k(t.kind) + " '" + t.metadata.name + "'.",
details: e("getErrorDetails")(n)
});
})) : (t = _.head(p.createResources), i.create(a.kindToResource(t.kind), null, t, {
})) : (t = _.head(p.createResources), i.create(a.objectToResourceGroupVersion(t), null, t, {
namespace: p.input.selectedProject.metadata.name
}).then(function() {
if (!p.isDialog) {
Expand Down

0 comments on commit fb518ae

Please sign in to comment.