code: func ValidNamespace(ctx context.Context, resource metav1.Object) bool {
  	ns, ok := genericapirequest.NamespaceFrom(ctx)
  	if len(resource.GetNamespace()) == 0 {
  		resource.SetNamespace(ns)
  	}
  	return ns == resource.GetNamespace() && ok
  }
docs: // ValidNamespace returns false if the namespace on the context differs from
  // the resource.  If the resource has no namespace, it is set to the value in
  // the context.