Skip to content

Commit

Permalink
Merge pull request #323 from spadgett/3.9-v1beta1-partial-objects
Browse files Browse the repository at this point in the history
[enterprise-3.9] Fall back to JSON when PartialObjectMetadataList unavailable
  • Loading branch information
spadgett committed Apr 10, 2018
2 parents 71f3866 + 7dc69d0 commit 4e7a60b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
10 changes: 2 additions & 8 deletions dist/origin-web-common-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -1406,14 +1406,8 @@ angular.module('openshiftCommonServices')
angular.module('openshiftCommonServices')
.factory('DataService', function($cacheFactory, $http, $ws, $rootScope, $q, API_CFG, APIService, Logger, $timeout, base64, base64util) {

// Accept PartialObjectMetadataList. Unfortunately we can't use the Accept
// header to fallback to JSON due to an API server content negotiation bug.
// https://github.com/kubernetes/kubernetes/issues/50519
//
// This is a potential version skew issue for when the web console runs in
// a pod where we potentially need to support different server versions.
// https://trello.com/c/9oaUh8xP
var ACCEPT_PARTIAL_OBJECT_METADATA_LIST = 'application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io';
// This will request just a list of the object metadata, falling back to application/json if needed.
var ACCEPT_PARTIAL_OBJECT_METADATA_LIST = 'application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io,application/json';

function Data(array) {
this._data = {};
Expand Down
10 changes: 2 additions & 8 deletions dist/origin-web-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3473,14 +3473,8 @@ angular.module('openshiftCommonServices')
angular.module('openshiftCommonServices')
.factory('DataService', ["$cacheFactory", "$http", "$ws", "$rootScope", "$q", "API_CFG", "APIService", "Logger", "$timeout", "base64", "base64util", function($cacheFactory, $http, $ws, $rootScope, $q, API_CFG, APIService, Logger, $timeout, base64, base64util) {

// Accept PartialObjectMetadataList. Unfortunately we can't use the Accept
// header to fallback to JSON due to an API server content negotiation bug.
// https://github.com/kubernetes/kubernetes/issues/50519
//
// This is a potential version skew issue for when the web console runs in
// a pod where we potentially need to support different server versions.
// https://trello.com/c/9oaUh8xP
var ACCEPT_PARTIAL_OBJECT_METADATA_LIST = 'application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io';
// This will request just a list of the object metadata, falling back to application/json if needed.
var ACCEPT_PARTIAL_OBJECT_METADATA_LIST = 'application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io,application/json';

function Data(array) {
this._data = {};
Expand Down
4 changes: 2 additions & 2 deletions dist/origin-web-common.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -1971,13 +1971,13 @@ f.prototype._uniqueKey = function(e, t, n, r) {
var o, i = n && n.namespace || _.get(n, "project.metadata.name") || n.projectName, a = _.get(r, "http.params"), s = this._urlForResource(e, t, n, null, angular.extend({}, {}, {
namespace: i
}));
return o = s ? s.toString() : e || "<unknown>", o += w(a || {}), _.get(r, "partialObjectMetadataList") ? o + "#application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io" : o;
return o = s ? s.toString() : e || "<unknown>", o += w(a || {}), _.get(r, "partialObjectMetadataList") ? o + "#application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io,application/json" : o;
}, f.prototype._startListOp = function(e, n, r) {
r = r || {};
var o = _.get(r, "http.params") || {}, i = this._uniqueKey(e, null, n, r);
this._listInFlight(i, !0);
var a = {};
r.partialObjectMetadataList && (a.Accept = "application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io");
r.partialObjectMetadataList && (a.Accept = "application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io,application/json");
var s, c = this;
if (n.projectPromise && !e.equals("projects")) n.projectPromise.done(function(l) {
if (!(s = c._urlForResource(e, null, n, !1, _.assign({}, o, {
Expand Down
10 changes: 2 additions & 8 deletions src/services/dataService.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@
angular.module('openshiftCommonServices')
.factory('DataService', function($cacheFactory, $http, $ws, $rootScope, $q, API_CFG, APIService, Logger, $timeout, base64, base64util) {

// Accept PartialObjectMetadataList. Unfortunately we can't use the Accept
// header to fallback to JSON due to an API server content negotiation bug.
// https://github.com/kubernetes/kubernetes/issues/50519
//
// This is a potential version skew issue for when the web console runs in
// a pod where we potentially need to support different server versions.
// https://trello.com/c/9oaUh8xP
var ACCEPT_PARTIAL_OBJECT_METADATA_LIST = 'application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io';
// This will request just a list of the object metadata, falling back to application/json if needed.
var ACCEPT_PARTIAL_OBJECT_METADATA_LIST = 'application/json;as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io,application/json';

function Data(array) {
this._data = {};
Expand Down

0 comments on commit 4e7a60b

Please sign in to comment.