Commit 55b55e51 by Jessica Forrester Committed by GitHub

Merge pull request #113 from jwforres/optional-propagation-policy

Allow propagationPolicy to be set to null to turn off garabage collection completely
parents 63e8c4a3 4891647e
...@@ -1220,10 +1220,16 @@ angular.module('openshiftCommonServices') ...@@ -1220,10 +1220,16 @@ angular.module('openshiftCommonServices')
var data, headers = {}; var data, headers = {};
var data = { var data = {
kind: "DeleteOptions", kind: "DeleteOptions",
apiVersion: "v1", apiVersion: "v1"
// Default to "Foreground" (cascading) if no propagationPolicy was given.
propagationPolicy: opts.propagationPolicy || "Foreground"
}; };
if (_.has(opts, 'propagationPolicy')) {
// Use a has check so that explicitly setting propagationPolicy to null passes through and doesn't fallback to default behavior
data.propagationPolicy = opts.propagationPolicy;
}
else {
// Default to "Foreground" (cascading) if no propagationPolicy was given.
data.propagationPolicy = 'Foreground';
}
var headers = { var headers = {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}; };
......
...@@ -2944,10 +2944,16 @@ angular.module('openshiftCommonServices') ...@@ -2944,10 +2944,16 @@ angular.module('openshiftCommonServices')
var data, headers = {}; var data, headers = {};
var data = { var data = {
kind: "DeleteOptions", kind: "DeleteOptions",
apiVersion: "v1", apiVersion: "v1"
// Default to "Foreground" (cascading) if no propagationPolicy was given.
propagationPolicy: opts.propagationPolicy || "Foreground"
}; };
if (_.has(opts, 'propagationPolicy')) {
// Use a has check so that explicitly setting propagationPolicy to null passes through and doesn't fallback to default behavior
data.propagationPolicy = opts.propagationPolicy;
}
else {
// Default to "Foreground" (cascading) if no propagationPolicy was given.
data.propagationPolicy = 'Foreground';
}
var headers = { var headers = {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}; };
......
...@@ -1207,9 +1207,10 @@ return callback && deferred.promise.then(callback), this._isCached(key) ? deferr ...@@ -1207,9 +1207,10 @@ return callback && deferred.promise.then(callback), this._isCached(key) ? deferr
resource = APIService.toResourceGroupVersion(resource), opts = opts || {}; resource = APIService.toResourceGroupVersion(resource), opts = opts || {};
var data, deferred = $q.defer(), self = this, headers = {}, data = { var data, deferred = $q.defer(), self = this, headers = {}, data = {
kind:"DeleteOptions", kind:"DeleteOptions",
apiVersion:"v1", apiVersion:"v1"
propagationPolicy:opts.propagationPolicy || "Foreground" };
}, headers = { _.has(opts, "propagationPolicy") ? data.propagationPolicy = opts.propagationPolicy :data.propagationPolicy = "Foreground";
var headers = {
"Content-Type":"application/json" "Content-Type":"application/json"
}; };
return _.has(opts, "gracePeriodSeconds") && (data.gracePeriodSeconds = opts.gracePeriodSeconds), this._getNamespace(resource, context, opts).then(function(ns) { return _.has(opts, "gracePeriodSeconds") && (data.gracePeriodSeconds = opts.gracePeriodSeconds), this._getNamespace(resource, context, opts).then(function(ns) {
......
...@@ -149,10 +149,16 @@ angular.module('openshiftCommonServices') ...@@ -149,10 +149,16 @@ angular.module('openshiftCommonServices')
var data, headers = {}; var data, headers = {};
var data = { var data = {
kind: "DeleteOptions", kind: "DeleteOptions",
apiVersion: "v1", apiVersion: "v1"
// Default to "Foreground" (cascading) if no propagationPolicy was given.
propagationPolicy: opts.propagationPolicy || "Foreground"
}; };
if (_.has(opts, 'propagationPolicy')) {
// Use a has check so that explicitly setting propagationPolicy to null passes through and doesn't fallback to default behavior
data.propagationPolicy = opts.propagationPolicy;
}
else {
// Default to "Foreground" (cascading) if no propagationPolicy was given.
data.propagationPolicy = 'Foreground';
}
var headers = { var headers = {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}; };
......
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