Skip to content

Commit

Permalink
Merge pull request #3746 from spadgett/update-server-type-map
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Jul 17, 2015
2 parents 14ea304 + cfb27f9 commit fd9b930
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 22 deletions.
82 changes: 71 additions & 11 deletions assets/app/scripts/services/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,19 @@ angular.module('openshiftConsole')
}

objects.forEach(function(object) {
self.create(self._objectType(object.kind), null, object, context, opts).then(
var type = self._objectType(object.kind);
if (!type) {
failureResults.push({
data: {
message: "Unrecognized type: " + object.kind + "."
}
});
remaining--;
_checkDone();
return;
}

self.create(type, null, object, context, opts).then(
function (data) {
successResults.push(data);
remaining--;
Expand Down Expand Up @@ -814,33 +826,55 @@ angular.module('openshiftConsole')
// an introspection endpoint that would give us this mapping
// https://github.com/openshift/origin/issues/230
var SERVER_TYPE_MAP = {
builds: API_CFG.openshift,
buildconfigs: API_CFG.openshift,
builds: API_CFG.openshift,
clusternetworks: API_CFG.openshift,
clusterpolicies: API_CFG.openshift,
clusterpolicybindings: API_CFG.openshift,
clusterrolebindings: API_CFG.openshift,
clusterroles: API_CFG.openshift,
deploymentconfigrollbacks: API_CFG.openshift,
deploymentconfigs: API_CFG.openshift,
imagestreams: API_CFG.openshift,
hostsubnets: API_CFG.openshift,
identities: API_CFG.openshift,
images: API_CFG.openshift,
imagestreamimages: API_CFG.openshift,
imagestreammappings: API_CFG.openshift,
imagestreams: API_CFG.openshift,
imagestreamtags: API_CFG.openshift,
oauthaccesstokens: API_CFG.openshift,
oauthauthorizetokens: API_CFG.openshift,
oauthclients: API_CFG.openshift,
oauthclientauthorizations: API_CFG.openshift,
oauthclients: API_CFG.openshift,
policies: API_CFG.openshift,
policybindings: API_CFG.openshift,
processedtemplates: API_CFG.openshift,
projects: API_CFG.openshift,
projectrequests: API_CFG.openshift,
roles: API_CFG.openshift,
projects: API_CFG.openshift,
resourceaccessreviews: API_CFG.openshift,
rolebindings: API_CFG.openshift,
roles: API_CFG.openshift,
routes: API_CFG.openshift,
subjectaccessreviews: API_CFG.openshift,
templates: API_CFG.openshift,
useridentitymappings: API_CFG.openshift,
users: API_CFG.openshift,

bindings: API_CFG.k8s,
componentstatuses: API_CFG.k8s,
endpoints: API_CFG.k8s,
events: API_CFG.k8s,
limitranges: API_CFG.k8s,
nodes: API_CFG.k8s,
persistentvolumeclaims: API_CFG.k8s,
persistentvolumes: API_CFG.k8s,
pods: API_CFG.k8s,
podtemplates: API_CFG.k8s,
replicationcontrollers: API_CFG.k8s,
services: API_CFG.k8s,
resourcequotas: API_CFG.k8s,
limitranges: API_CFG.k8s
secrets: API_CFG.k8s,
serviceaccounts: API_CFG.k8s,
services: API_CFG.k8s
};

DataService.prototype._urlForType = function(type, id, context, isWebsocket, params) {
Expand Down Expand Up @@ -936,25 +970,51 @@ angular.module('openshiftConsole')
var OBJECT_KIND_MAP = {
Build: "builds",
BuildConfig: "buildconfigs",
ClusterNetwork: "clusternetworks",
ClusterPolicy: "clusterpolicies",
ClusterPolicyBinding: "clusterpolicybindings",
ClusterRole: "clusterroles",
ClusterRoleBinding: "clusterrolebindings",
DeploymentConfig: "deploymentconfigs",
DeploymentConfigRollback: "deploymentconfigrollbacks",
HostSubnet: "hostsubnets",
Identity: "identities",
Image: "images",
ImageStream: "imagestreams",
ImageStreamImage: "imagestreamimages",
ImageStreamMapping: "imagestreammappings",
OAuthAccessToken: "oauthaccesstokens",
OAuthAuthorizeToken: "oauthauthorizetokens",
OAuthClient: "oauthclients",
OAuthClientAuthorization: "oauthclientauthorizations",
Policy: "policies",
PolicyBinding: "policybindings",
Project: "projects",
ProjectRequest: "projectrequests",
ResourceAccessReview: "resourceaccessreviews",
Role: "roles",
RoleBinding: "rolebindings",
Route: "routes",
SubjectAccessReview: "subjectaccessreviews",
Template: "templates",
User: "users",

UserIdentityMapping: "useridentitymappings",

Binding: "bindings",
ComponentStatus: "componentstatuses",
Endpoints: "endpoints",
Event: "events",
LimitRange: "limitranges",
Node: "nodes",
PersistentVolume: "persistentvolumes",
PersistentVolumeClaim: "persistentvolumeclaims",
Pod: "pods",
PodTemplate: "podtemplates",
ReplicationController: "replicationcontrollers",
Service: "services",
ResourceQuota: "resourcequotas",
LimitRange: "limitranges"
Secret: "secrets",
Service: "services",
ServiceAccount: "serviceaccounts"
};

DataService.prototype._objectType = function(kind) {
Expand Down
75 changes: 64 additions & 11 deletions pkg/assets/bindata.go
Original file line number Diff line number Diff line change
Expand Up @@ -13725,11 +13725,16 @@ failure:h
}
var f = d.defer(), g = [], h = [], i = this, j = a.length;
return a.forEach(function(a) {
i.create(i._objectType(a.kind), null, a, b, c).then(function(a) {
var d = i._objectType(a.kind);
return d ? void i.create(d, null, a, b, c).then(function(a) {
g.push(a), j--, e();
}, function(a) {
h.push(a), j--, e();
});
}) :(h.push({
data:{
message:"Unrecognized type: " + a.kind + "."
}
}), j--, void e());
}), f.promise;
}, i.prototype.get = function(b, e, g, h) {
b = void 0 !== this._objectType(b) ? this._objectType(b) :m(b), h = h || {};
Expand Down Expand Up @@ -13935,32 +13940,54 @@ g.log("Rewatching for type/context", a, b), this._watchInFlight(a, b, !0), setTi
var o = "{protocol}://{+serverUrl}{+apiPrefix}/{apiVersion}/", p = o + "watch/{type}{?q*}", q = o + "{type}{?q*}", r = o + "{type}/{id}{?q*}", s = o + "{type}/{id}{/subresource*}{?q*}", t = o + "watch/namespaces/{namespace}/{type}{?q*}", u = o + "namespaces/{namespace}/{type}{?q*}", v = o + "namespaces/{namespace}/{type}/{id}{?q*}", w = o + "namespaces/{namespace}/{type}/{id}{/subresource*}{?q*}";
e.openshift.version = "v1beta3", e.k8s.version = "v1beta3";
var x = {
builds:e.openshift,
buildconfigs:e.openshift,
builds:e.openshift,
clusternetworks:e.openshift,
clusterpolicies:e.openshift,
clusterpolicybindings:e.openshift,
clusterrolebindings:e.openshift,
clusterroles:e.openshift,
deploymentconfigrollbacks:e.openshift,
deploymentconfigs:e.openshift,
imagestreams:e.openshift,
hostsubnets:e.openshift,
identities:e.openshift,
images:e.openshift,
imagestreamimages:e.openshift,
imagestreammappings:e.openshift,
imagestreams:e.openshift,
imagestreamtags:e.openshift,
oauthaccesstokens:e.openshift,
oauthauthorizetokens:e.openshift,
oauthclients:e.openshift,
oauthclientauthorizations:e.openshift,
oauthclients:e.openshift,
policies:e.openshift,
policybindings:e.openshift,
processedtemplates:e.openshift,
projects:e.openshift,
projectrequests:e.openshift,
roles:e.openshift,
projects:e.openshift,
resourceaccessreviews:e.openshift,
rolebindings:e.openshift,
roles:e.openshift,
routes:e.openshift,
subjectaccessreviews:e.openshift,
templates:e.openshift,
useridentitymappings:e.openshift,
users:e.openshift,
bindings:e.k8s,
componentstatuses:e.k8s,
endpoints:e.k8s,
events:e.k8s,
limitranges:e.k8s,
nodes:e.k8s,
persistentvolumeclaims:e.k8s,
persistentvolumes:e.k8s,
pods:e.k8s,
podtemplates:e.k8s,
replicationcontrollers:e.k8s,
services:e.k8s,
resourcequotas:e.k8s,
limitranges:e.k8s
secrets:e.k8s,
serviceaccounts:e.k8s,
services:e.k8s
};
i.prototype._urlForType = function(a, b, c, d, e) {
var f, h;
Expand Down Expand Up @@ -13993,24 +14020,50 @@ return null;
var y = {
Build:"builds",
BuildConfig:"buildconfigs",
ClusterNetwork:"clusternetworks",
ClusterPolicy:"clusterpolicies",
ClusterPolicyBinding:"clusterpolicybindings",
ClusterRole:"clusterroles",
ClusterRoleBinding:"clusterrolebindings",
DeploymentConfig:"deploymentconfigs",
DeploymentConfigRollback:"deploymentconfigrollbacks",
HostSubnet:"hostsubnets",
Identity:"identities",
Image:"images",
ImageStream:"imagestreams",
ImageStreamImage:"imagestreamimages",
ImageStreamMapping:"imagestreammappings",
OAuthAccessToken:"oauthaccesstokens",
OAuthAuthorizeToken:"oauthauthorizetokens",
OAuthClient:"oauthclients",
OAuthClientAuthorization:"oauthclientauthorizations",
Policy:"policies",
PolicyBinding:"policybindings",
Project:"projects",
ProjectRequest:"projectrequests",
ResourceAccessReview:"resourceaccessreviews",
Role:"roles",
RoleBinding:"rolebindings",
Route:"routes",
SubjectAccessReview:"subjectaccessreviews",
Template:"templates",
User:"users",
UserIdentityMapping:"useridentitymappings",
Binding:"bindings",
ComponentStatus:"componentstatuses",
Endpoints:"endpoints",
Event:"events",
LimitRange:"limitranges",
Node:"nodes",
PersistentVolume:"persistentvolumes",
PersistentVolumeClaim:"persistentvolumeclaims",
Pod:"pods",
PodTemplate:"podtemplates",
ReplicationController:"replicationcontrollers",
Service:"services",
ResourceQuota:"resourcequotas",
LimitRange:"limitranges"
Secret:"secrets",
Service:"services",
ServiceAccount:"serviceaccounts"
};
i.prototype._objectType = function(a) {
return y[a];
Expand Down

0 comments on commit fd9b930

Please sign in to comment.