request - provide `deleted, changed, noop` values in JSON output
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
When I'm calling kapp from ansible I need an easy way to determine if the resources have actually changed.
Currently I call `kapp` with `--json` and then after validating that the return code is `0` I do the following which is not ideal:
```
parsed = json.loads(out)
# attempt to process if changes happened, this involves some ugly text parsing
if kapp_command == "delete":
# check in parse lines to verify it wasn't already deleted
if "App '%s' (namespace: %s) does not exist" % (
module.params['name'], module.params['namespace']
) not in parsed['Lines']:
result['changed'] = True
if kapp_command == "deploy":
# scan output for changes
for line in parsed['Lines']:
if re.match("applying \d+ changes", line):
result['changed'] = True
```
I would love the `json` output to include something like:
```
{"summary": { "changed": 1, "noop": "5", "deleted": "3" } }
```
so I can more easily parse the results.
Contributor guide
Assessment
This issue has not been assessed yet.