Sensuctl create, dry run ? or validate?

(sensu-go 6.2)
I’ve been automating the sensu publishing for alerts, prune is tricky. But it looks fine.

I want to fail the config build in Jenkins automatically, but I don’t see a -dry-run in create as in prune

is there a way to do sensuctl validation without actually making changes ?


:wave: Howdy! When I was at Sensu, I opened up this request: --dry-run flag for sensuctl create · Issue #3475 · sensu/sensu-go · GitHub. I’d recommend giving it a :+1: so that the team can prioritize the request.


I’ve commented into the github issue,
There’s probably a need to look at an inverse to prune that has the same level of flaggable controls.
It would be nice for example to be able to do a recursive create-like operation that was limited to specific resource types and label selection like prune does. It’s probably gonna need to be a new command to make sure create stays backwards compatible and works as expected.

Good to know… I just tough in a solution. create everything in a throwaway namespace, and then delete
My question then if which one has priority sensuctl --namespace xx or namescpace in the yaml ?

namespace in the yaml takes priority.
Here’s the document reference:

I was going to suggest the throwaway namespace as well. Once your yaml files are namespace-free, you can switch between namespaces pretty easily.

thinking more on this…
We might be able to prototype this as an installable sensuctl command asset.