Skip to content

feat: JSON output #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2020
Merged

feat: JSON output #226

merged 1 commit into from
Jul 21, 2020

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented Jul 20, 2020

This adds the JSON output on top of #221, which can be enabled by passing --output json. Internally it works exactly the same as the template output format with the default template.

********************

        Release was not present in Helm.  Diff will show entire contents as new.

********************
[{
  "api": "v1",
  "kind": "Secret",
  "namespace": "default",
  "name": "mysql-1567775891",
  "change": "ADD"
},{
  "api": "v1",
  "kind": "ConfigMap",
  "namespace": "default",
  "name": "mysql-1567775891-test",
  "change": "ADD"
},{
  "api": "v1",
  "kind": "PersistentVolumeClaim",
  "namespace": "default",
  "name": "mysql-1567775891",
  "change": "ADD"
},{
  "api": "v1",
  "kind": "Service",
  "namespace": "default",
  "name": "mysql-1567775891",
  "change": "ADD"
},{
  "api": "apps",
  "kind": "Deployment",
  "namespace": "default",
  "name": "mysql-1567775891",
  "change": "ADD"
}]

Also note that I've modified the default template a bit so that it looks more like helm's output. See helm list -o json for example.

Ref #221 (review)

@mumoshu
Copy link
Collaborator Author

mumoshu commented Jul 20, 2020

@semoac Would you be okay with the update on the default template?

@semoac
Copy link
Contributor

semoac commented Jul 20, 2020

@semoac Would you be okay with the update on the default template?

Yes! Thank you!

This adds the JSON output on top of #221, which can be enabled by passing `--output json`. Internally it works exactly the same as the `template` output format with the default template.

```
********************

        Release was not present in Helm.  Diff will show entire contents as new.

********************
[{
  "api": "v1",
  "kind": "Secret",
  "namespace": "default",
  "name": "mysql-1567775891",
  "change": "ADD"
},{
  "api": "v1",
  "kind": "ConfigMap",
  "namespace": "default",
  "name": "mysql-1567775891-test",
  "change": "ADD"
},{
  "api": "v1",
  "kind": "PersistentVolumeClaim",
  "namespace": "default",
  "name": "mysql-1567775891",
  "change": "ADD"
},{
  "api": "v1",
  "kind": "Service",
  "namespace": "default",
  "name": "mysql-1567775891",
  "change": "ADD"
},{
  "api": "apps",
  "kind": "Deployment",
  "namespace": "default",
  "name": "mysql-1567775891",
  "change": "ADD"
}]
```

Ref #221 (review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants