From 4ce3b6cf4f8486e4335d05d7f573ad1859c14ce8 Mon Sep 17 00:00:00 2001 From: huangjiuyuan Date: Tue, 29 Aug 2017 17:03:06 +0800 Subject: [PATCH] modifying the comment of BeforeDelete function to improve readibility --- .../k8s.io/apiserver/pkg/registry/rest/delete.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/registry/rest/delete.go b/staging/src/k8s.io/apiserver/pkg/registry/rest/delete.go index 80e08fb192..d7782a279f 100644 --- a/staging/src/k8s.io/apiserver/pkg/registry/rest/delete.go +++ b/staging/src/k8s.io/apiserver/pkg/registry/rest/delete.go @@ -59,12 +59,15 @@ type RESTGracefulDeleteStrategy interface { CheckGracefulDelete(ctx genericapirequest.Context, obj runtime.Object, options *metav1.DeleteOptions) bool } -// BeforeDelete tests whether the object can be gracefully deleted. If graceful is set the object -// should be gracefully deleted, if gracefulPending is set the object has already been gracefully deleted -// (and the provided grace period is longer than the time to deletion), and an error is returned if the -// condition cannot be checked or the gracePeriodSeconds is invalid. The options argument may be updated with -// default values if graceful is true. Second place where we set deletionTimestamp is pkg/registry/generic/registry/store.go -// this function is responsible for setting deletionTimestamp during gracefulDeletion, other one for cascading deletions. +// BeforeDelete tests whether the object can be gracefully deleted. +// If graceful is set, the object should be gracefully deleted. If gracefulPending +// is set, the object has already been gracefully deleted (and the provided grace +// period is longer than the time to deletion). An error is returned if the +// condition cannot be checked or the gracePeriodSeconds is invalid. The options +// argument may be updated with default values if graceful is true. Second place +// where we set deletionTimestamp is pkg/registry/generic/registry/store.go. +// This function is responsible for setting deletionTimestamp during gracefulDeletion, +// other one for cascading deletions. func BeforeDelete(strategy RESTDeleteStrategy, ctx genericapirequest.Context, obj runtime.Object, options *metav1.DeleteOptions) (graceful, gracefulPending bool, err error) { objectMeta, gvk, kerr := objectMetaAndKind(strategy, obj) if kerr != nil {