ceph / chacra

A binary/file REST API to aid in multi-distro|arch|release management
9 stars 18 forks source link

controllers/repos: add DELETE support #279

Closed tchaikov closed 4 years ago

tchaikov commented 4 years ago

Signed-off-by: Kefu Chai kchai@redhat.com

tchaikov commented 4 years ago

for support on the client side, see https://github.com/ceph/chacractl/pull/46

tchaikov commented 4 years ago

i want to remove some repos not used anymore, like

i created them for building master on xenial, but they are not used anymore

djgalloway commented 4 years ago

I have no idea if this will work but it can't really hurt anything to merge, and push, right? (Famous last words)

djgalloway commented 4 years ago

Also, is there logic in there to also remove the entries from the database?

tchaikov commented 4 years ago

Also, is there logic in there to also remove the entries from the database?

i think so, see

self.repo_obj.delete()
if self.project.repos.count() == 0:
  self.project.delete()

where the entities in database are removed using sqlalchemy ORM.

djgalloway commented 4 years ago

Okay, cool. chacractl needs to be modified too, right?

tchaikov commented 4 years ago

Okay, cool. chacractl needs to be modified too, right?

https://github.com/ceph/chacra/pull/279#issuecomment-657176767

djgalloway commented 4 years ago

Okay, cool. chacractl needs to be modified too, right?

#279 (comment)

djgalloway commented 4 years ago

I can't get this to work. I cut a new release of chacractl with the DELETE changes in it and pip installed it locally.

I also redeployed chacra.ceph.com so it has this code running.

dgalloway@p50 ceph (nautilus)$ chacractl repo delete ceph/nautilus/516042b3befb0776d94ccca10f565d06609a7615/ubuntu/bionic
[urllib3.connectionpool][DEBUG ] Starting new HTTPS connection (1): chacra.ceph.com
/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py:860: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
[urllib3.connectionpool][DEBUG ] https://chacra.ceph.com:443 "HEAD /repos/ceph/nautilus/516042b3befb0776d94ccca10f565d06609a7615/ubuntu/bionic/delete HTTP/1.1" 404 0
[chacractl.api.repos][WARNIN] repo already deleted
[chacractl.api.repos][WARNIN] SKIP https://chacra.ceph.com/repos/ceph/nautilus/516042b3befb0776d94ccca10f565d06609a7615/ubuntu/bionic/delete

But

dgalloway@p50 ceph (nautilus)$ curl -s -I https://chacra.ceph.com/repos/ceph/nautilus/516042b3befb0776d94ccca10f565d06609a7615/ubuntu/bionic/
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 20 Aug 2020 17:44:09 GMT
Content-Type: application/json
Content-Length: 867
Connection: keep-alive
Strict-Transport-Security: max-age=31536000
tchaikov commented 4 years ago

@djgalloway will take a look tmr.

tchaikov commented 3 years ago

@djgalloway fixed at https://github.com/ceph/chacractl/pull/47 and #280