code: public static String getName(HasMetadata entity) {
      if (entity != null) {
        return getName(entity.getMetadata());
      } else {
        return null;
      }
    }
docs: Returns name of the resource from it's Metadata
  
  @param entity Kubernetes resource
  @return returns name of resource