percona / pmm

Percona Monitoring and Management: an open source database monitoring, observability and management tool
https://www.percona.com/software/database-tools/percona-monitoring-and-management
GNU Affero General Public License v3.0
607 stars 123 forks source link

[feature] add --force (or similar) to 'pmm-admin add' #3117

Open brevilo opened 1 month ago

brevilo commented 1 month ago

Description

More often than not tools like PMM get deployed non-interactively nowadays, using tools like Saltstack. These typically use state descriptions for the configurations they manage. It would be helpful if pmm-admin would be designed in such a way, that its commands can be used repeatedly (idempotent) to ensure a desired config state is effective. For instance, calling pmm-admin add isn't idempotent as it fails when the service to be added already exists.

Suggested solution

One way to implement this would be to add a --force option that doesn't fail if the service exists but, if anything, updates its config. That is, unless a real error occurs. That should of course still return a non-zero value and some useful message on stderr.

Additional context

Have a look at pmm-admin config which has a --force option to simply allow repeated calls and returns a 0, unless a real error occurs.

Ideally all config-changing commands would allow such use.

Code of Conduct

BupycHuk commented 1 month ago

Hi @brevilo, idea looks good to us. We will add it to our Jira to track it.

brevilo commented 2 weeks ago

Thanks. This feature is crucial for us since it blocks rolling out PMM for a larger test. Please add a cross-reference as soon as you have it (couldn't find it yet), so I can track its progress 👍