Commit 9ec26d68 by Sam Padgett Committed by GitHub

Merge pull request #197 from spadgett/fix-rc-rs-label-selector

Fix label selector for ApplicationsService
parents ffaac140 8f48a964
......@@ -574,12 +574,12 @@ service("ApplicationsService", function($q, DataService) {
// deployment config. Note: This will not return replication controllers that
// have been orphaned by `oc delete dc/foo --cascade=false`.
var listStandaloneReplicationControllers = function(context) {
return DataService.list('replicationcontrollers', context, {
return DataService.list('replicationcontrollers', context, null, {
http: {
params: {
// If the replica set has a `openshift.io/deployment-config-name`
// label, it's managed by a deployment config.
labelSelector: "!openshift.io/deployment-config-name"
labelSelector: "!openshift.io/deployment-config.name"
}
}
});
......@@ -589,7 +589,7 @@ service("ApplicationsService", function($q, DataService) {
// Note: This will not return replica sets that have been orphaned by
// `oc delete deployment/foo --cascade=false`.
var listStandaloneReplicaSets = function(context) {
return DataService.list({group: 'extensions', resource: 'replicasets'}, context, {
return DataService.list({group: 'extensions', resource: 'replicasets'}, context, null, {
http: {
params: {
// If the replica set has a `pod-template-hash` label, it's managed
......@@ -2347,6 +2347,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
DataService.prototype._startListOp = function(resource, context, opts) {
opts = opts || {};
var params = _.get(opts, 'http.params') || {};
var key = this._uniqueKey(resource, null, context, opts);
// mark the operation as in progress
this._listInFlight(key, true);
......@@ -2363,7 +2364,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
method: 'GET',
auth: {},
headers: headers,
url: self._urlForResource(resource, null, context, false, {namespace: project.metadata.name})
url: self._urlForResource(resource, null, context, false, _.assign({}, params, {namespace: project.metadata.name}))
}, opts.http || {}))
.success(function(data, status, headerFunc, config, statusText) {
self._listOpComplete(key, resource, context, opts, data);
......@@ -2387,7 +2388,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
method: 'GET',
auth: {},
headers: headers,
url: this._urlForResource(resource, null, context),
url: this._urlForResource(resource, null, context, false, params),
}).success(function(data, status, headerFunc, config, statusText) {
self._listOpComplete(key, resource, context, opts, data);
}).error(function(data, status, headers, config) {
......
......@@ -2526,12 +2526,12 @@ service("ApplicationsService", ["$q", "DataService", function($q, DataService) {
// deployment config. Note: This will not return replication controllers that
// have been orphaned by `oc delete dc/foo --cascade=false`.
var listStandaloneReplicationControllers = function(context) {
return DataService.list('replicationcontrollers', context, {
return DataService.list('replicationcontrollers', context, null, {
http: {
params: {
// If the replica set has a `openshift.io/deployment-config-name`
// label, it's managed by a deployment config.
labelSelector: "!openshift.io/deployment-config-name"
labelSelector: "!openshift.io/deployment-config.name"
}
}
});
......@@ -2541,7 +2541,7 @@ service("ApplicationsService", ["$q", "DataService", function($q, DataService) {
// Note: This will not return replica sets that have been orphaned by
// `oc delete deployment/foo --cascade=false`.
var listStandaloneReplicaSets = function(context) {
return DataService.list({group: 'extensions', resource: 'replicasets'}, context, {
return DataService.list({group: 'extensions', resource: 'replicasets'}, context, null, {
http: {
params: {
// If the replica set has a `pod-template-hash` label, it's managed
......@@ -4299,6 +4299,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
DataService.prototype._startListOp = function(resource, context, opts) {
opts = opts || {};
var params = _.get(opts, 'http.params') || {};
var key = this._uniqueKey(resource, null, context, opts);
// mark the operation as in progress
this._listInFlight(key, true);
......@@ -4315,7 +4316,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
method: 'GET',
auth: {},
headers: headers,
url: self._urlForResource(resource, null, context, false, {namespace: project.metadata.name})
url: self._urlForResource(resource, null, context, false, _.assign({}, params, {namespace: project.metadata.name}))
}, opts.http || {}))
.success(function(data, status, headerFunc, config, statusText) {
self._listOpComplete(key, resource, context, opts, data);
......@@ -4339,7 +4340,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
method: 'GET',
auth: {},
headers: headers,
url: this._urlForResource(resource, null, context),
url: this._urlForResource(resource, null, context, false, params),
}).success(function(data, status, headerFunc, config, statusText) {
self._listOpComplete(key, resource, context, opts, data);
}).error(function(data, status, headers, config) {
......
......@@ -1069,10 +1069,10 @@ getPreferredVersion:getPreferredVersion
};
} ]), angular.module("openshiftCommonServices").service("ApplicationsService", [ "$q", "DataService", function($q, DataService) {
var listStandaloneReplicationControllers = function(context) {
return DataService.list("replicationcontrollers", context, {
return DataService.list("replicationcontrollers", context, null, {
http:{
params:{
labelSelector:"!openshift.io/deployment-config-name"
labelSelector:"!openshift.io/deployment-config.name"
}
}
});
......@@ -1080,7 +1080,7 @@ labelSelector:"!openshift.io/deployment-config-name"
return DataService.list({
group:"extensions",
resource:"replicasets"
}, context, {
}, context, null, {
http:{
params:{
labelSelector:"!pod-template-hash"
......@@ -1817,7 +1817,7 @@ namespace:ns
return _.get(opts, "partialObjectMetadataList") ? url + "#" + ACCEPT_PARTIAL_OBJECT_METADATA_LIST :url;
}, DataService.prototype._startListOp = function(resource, context, opts) {
opts = opts || {};
var key = this._uniqueKey(resource, null, context, opts);
var params = _.get(opts, "http.params") || {}, key = this._uniqueKey(resource, null, context, opts);
this._listInFlight(key, !0);
var headers = {};
opts.partialObjectMetadataList && (headers.Accept = ACCEPT_PARTIAL_OBJECT_METADATA_LIST);
......@@ -1827,9 +1827,9 @@ $http(angular.extend({
method:"GET",
auth:{},
headers:headers,
url:self._urlForResource(resource, null, context, !1, {
url:self._urlForResource(resource, null, context, !1, _.assign({}, params, {
namespace:project.metadata.name
})
}))
}, opts.http || {})).success(function(data, status, headerFunc, config, statusText) {
self._listOpComplete(key, resource, context, opts, data);
}).error(function(data, status, headers, config) {
......@@ -1841,7 +1841,7 @@ delete self._listDeferredMap[key], deferred.reject(data, status, headers, config
method:"GET",
auth:{},
headers:headers,
url:this._urlForResource(resource, null, context)
url:this._urlForResource(resource, null, context, !1, params)
}).success(function(data, status, headerFunc, config, statusText) {
self._listOpComplete(key, resource, context, opts, data);
}).error(function(data, status, headers, config) {
......
......@@ -7,12 +7,12 @@ service("ApplicationsService", function($q, DataService) {
// deployment config. Note: This will not return replication controllers that
// have been orphaned by `oc delete dc/foo --cascade=false`.
var listStandaloneReplicationControllers = function(context) {
return DataService.list('replicationcontrollers', context, {
return DataService.list('replicationcontrollers', context, null, {
http: {
params: {
// If the replica set has a `openshift.io/deployment-config-name`
// label, it's managed by a deployment config.
labelSelector: "!openshift.io/deployment-config-name"
labelSelector: "!openshift.io/deployment-config.name"
}
}
});
......@@ -22,7 +22,7 @@ service("ApplicationsService", function($q, DataService) {
// Note: This will not return replica sets that have been orphaned by
// `oc delete deployment/foo --cascade=false`.
var listStandaloneReplicaSets = function(context) {
return DataService.list({group: 'extensions', resource: 'replicasets'}, context, {
return DataService.list({group: 'extensions', resource: 'replicasets'}, context, null, {
http: {
params: {
// If the replica set has a `pod-template-hash` label, it's managed
......
......@@ -985,6 +985,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
DataService.prototype._startListOp = function(resource, context, opts) {
opts = opts || {};
var params = _.get(opts, 'http.params') || {};
var key = this._uniqueKey(resource, null, context, opts);
// mark the operation as in progress
this._listInFlight(key, true);
......@@ -1001,7 +1002,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
method: 'GET',
auth: {},
headers: headers,
url: self._urlForResource(resource, null, context, false, {namespace: project.metadata.name})
url: self._urlForResource(resource, null, context, false, _.assign({}, params, {namespace: project.metadata.name}))
}, opts.http || {}))
.success(function(data, status, headerFunc, config, statusText) {
self._listOpComplete(key, resource, context, opts, data);
......@@ -1025,7 +1026,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
method: 'GET',
auth: {},
headers: headers,
url: this._urlForResource(resource, null, context),
url: this._urlForResource(resource, null, context, false, params),
}).success(function(data, status, headerFunc, config, statusText) {
self._listOpComplete(key, resource, context, opts, data);
}).error(function(data, status, headers, config) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment