Skip to content
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

nitro-cli terminate-enclave --all outputs malformed JSON object if it terminates multiple enclaves #483

Open
kwantam opened this issue Apr 7, 2023 · 3 comments · May be fixed by #486
Open
Labels
bug Something isn't working

Comments

@kwantam
Copy link

kwantam commented Apr 7, 2023

The output from nitro-cli terminate-enclave --all when multiple enclaves get killed is:

{
  "EnclaveName": "some_enclave",
  "EnclaveID": "i-EnclaveId1",
  "Terminated": true
}
{
  "EnclaveName": "other_enclave",
  "EnclaveID": "i-EnclaveId2",
  "Terminated": true
}

It would be handy if this were instead

[
    {
      "EnclaveName": "some_enclave",
      "EnclaveID": "i-EnclaveId1",
      "Terminated": true
    },
    {
      "EnclaveName": "other_enclave",
      "EnclaveID": "i-EnclaveId2",
      "Terminated": true
    }
]

(Relatedly, the output when no enclaves are killed is the empty string, whereas it would be handy for it to be the empty JSON array [].)

It would be great if the output were always a valid JSON array; this would help with automated processing of results, say, with jq.

@petreeftime petreeftime added the bug Something isn't working label Apr 7, 2023
@petreeftime petreeftime linked a pull request Apr 10, 2023 that will close this issue
@petreeftime
Copy link
Contributor

Looking at a fix in #486, but I'm considering making the output an array for nitro-cli terminate-enclave --enclave-id ... and nitro-cli terminate-enclave --enclave-name ... to make the output consistent.

@petreeftime
Copy link
Contributor

However, this is an output change, so it will require a minor version bump at least, to make sure it doesn't break workflows.

@kwantam
Copy link
Author

kwantam commented Apr 11, 2023

Agreed on both points; always returning an array seems great, modulo backwards incompatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants