sensu-go icon indicating copy to clipboard operation
sensu-go copied to clipboard

--dry-run flag for sensuctl create

Open asachs01 opened this issue 4 years ago • 6 comments

Adding this here. General idea would be to have a flag that would do a dry run and lint a file that is being applied. More better info to follow

asachs01 avatar Dec 17 '19 03:12 asachs01

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 25 '20 17:08 stale[bot]

further activity

majormoses avatar Aug 25 '20 18:08 majormoses

This issue has been mentioned on Sensu Community. There might be relevant details there:

https://discourse.sensu.io/t/sensuctl-create-dry-run-or-validate/2399/2

sensu-discourse avatar Jan 21 '21 19:01 sensu-discourse

There's a meta feature lurking here, There needs to be a command that is the inverse of prune with the same set of controls via command flags not just --dry-run for Ci/CD automation. Not sure if it should be create, but maybe a new command that is meant to work when paired with prune with the same operational constraints.

Here's the flag list re-interpreted for a create-like command to match prune flagged behavior --dry-run: reports which resources would be created/updated --label-selector: -> only updates/creates resources that match the label selector --users: -> only updates resources that match the created_by user in the list and ensures logged in user is in the list for resources to be created. --cluster-wide: must pass this to create/update cluster-wide resources. --omit: Ignore these resource types explicitly.

jspaleta avatar Jan 21 '21 20:01 jspaleta

@asachs01 Is this issue for linting or actually doing a "dry run"? If just linting, the UI should be more specific, e.g. --lint-only --file foo.yml. I expect a real "dry run" to indicate what resource will be created OR modified (and those that won't be), this requires fairly significant store and API work.

portertech avatar Sep 26 '22 16:09 portertech

I think actually doing a real dry run is the real goal here @portertech

asachs01 avatar Sep 26 '22 16:09 asachs01