one icon indicating copy to clipboard operation
one copied to clipboard

oneflow CLI should only process flow-type documents

Open tinova opened this issue 2 years ago • 0 comments

Description

When executing a oneflow CLI operation that accepts a list of IDs, oneflow tries to process every ID regardless of the document type.

The problem is that every type of document is stored in the same document_pool table, so any service that uses documents (like oneflow) will share the ID progression. Meaning,

  • if a service is created and it returns an ID
  • the next document will have ID+1. A non service document could get this ID+1
  • the next service will then have ID+2

To Reproduce

  • Have several types of documents with sequential IDs. For example:
    • document 84 and 86, type 100 which corresponds to oneflow services
    • document 83 and 85, type 1337 (custom document)
  • Then issue a mass delete
root@provisionengine-one:~# oneflow delete 81..86
[DocumentInfo] Error getting document [83].
[DocumentInfo] Error getting document [85].

Expected behavior

oneflow delete should skip (don't show an error) any document that is not type 100. The same applies to oneflow-template delete, it should skip non type 101 documents.

For reference, when a onevm terminate is issued to a VM that is already terminated, nothing happens CLI wise.

root@provisionengine-one:~# onevm list
  ID USER     GROUP    NAME                                                                        STAT  CPU     MEM HOST                                                     TIME
 136 oneadmin oneadmin FaaS_0_(service_113)                                                        poff    1    128M localhost                                            0d 21h58
root@provisionengine-one:~# onevm delete-chart 1^C
root@provisionengine-one:~# onevm terminate 131
root@provisionengine-one:~#

Details

  • Affected Component: oneflow cli
  • Hypervisor: any
  • Version: any

Progress Status

  • [ ] Code committed
  • [ ] Testing - QA
  • [ ] Documentation (Release notes - resolved issues, compatibility, known issues)

tinova avatar Aug 30 '23 09:08 tinova