[Cloud Provider] - Detecting when a user deletes a cloud configuration

42 views
Skip to first unread message

Robert Smith

unread,
May 1, 2020, 1:55:32 PM5/1/20
to Jenkins Developers
Please forgive me if this is an FAQ - my searches didn't turn up anything.

I'm working on a new Cloud Provider plugin, and for the life of me, I can't figure out how to trigger code based upon a user deleting a cloud config in the Jenkins UI. I don't see any likely methods in the classes associated with Cloud, nor do I see any kind of "GlobalConfigChangeListener". 

Any advice would be welcomed!

Cheers,

Robert

Jesse Glick

unread,
May 1, 2020, 4:00:55 PM5/1/20
to Jenkins Dev
On Fri, May 1, 2020 at 1:55 PM Robert Smith <rjmp...@gmail.com> wrote:
> I can't figure out how to trigger code based upon a user deleting a cloud config in the Jenkins UI.

I do not think you can. Nor would we want to add such a listener,
since an admin using `configuration-as-code` might for example just
delete a block of YAML and restart Jenkins. Reconsider why you think
you needed this to begin with.

Robert Smith

unread,
May 2, 2020, 2:22:48 PM5/2/20
to Jenkins Developers
My use case is pretty simple. If a user deletes an instance of my cloud provider in the UI, I want to do the needed cleanup - terminate any agents associated with that instance of the cloud provider, deregister it from our server, etc. I suppose that I can poll for the change on a timer, it just seems that it would be more efficient to be notified of the deletion.
Reply all
Reply to author
Forward
0 new messages