mirror of https://github.com/k3s-io/k3s
Merge pull request #51511 from huangjiuyuan/fix-func-comment
Automatic merge from submit-queue (batch tested with PRs 51298, 51510, 51511) modifying the comment of BeforeDelete function to improve readability **What this PR does / why we need it**: modifying the comment of `BeforeDelete` function in `staging/src/k8s.io/apiserver/pkg/registry/rest/delete.go` to improve readability. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: `NONE`pull/6/head
commit
ce55939465
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue