Skip to content

Commit

Permalink
BZ 1332787 Cannot create resources defined in List through From File …
Browse files Browse the repository at this point in the history
…option on create page
  • Loading branch information
jhadvig committed May 4, 2016
1 parent d6879a6 commit 6e49e05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assets/app/scripts/directives/fromFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ angular.module("openshiftConsole")
};
return false;
}
if (!item.metadata.name) {
// Validate if resource has 'name' field in its 'metadata', but it's not a List
if (!item.metadata.name && !item.kind.endsWith("List")) {
$scope.error = {
message: "Resource name is missing in metadata field."
};
Expand Down
2 changes: 1 addition & 1 deletion pkg/assets/bindata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6364,7 +6364,7 @@ scope:!1,
templateUrl:"views/directives/from-file.html",
controller:[ "$scope", function(k) {
function l(a) {
return a.kind ? a.metadata ? a.metadata.name ? a.metadata.namespace && a.metadata.namespace !== k.projectName ? (k.error = {
return a.kind ? a.metadata ? a.metadata.name || a.kind.endsWith("List") ? a.metadata.namespace && a.metadata.namespace !== k.projectName ? (k.error = {
message:a.kind + " " + a.metadata.name + " can't be created in project " + a.metadata.namespace + ". Can't create resource in different projects."
}, !1) :!0 :(k.error = {
message:"Resource name is missing in metadata field."
Expand Down

0 comments on commit 6e49e05

Please sign in to comment.