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

Cannot update or delete a target if it is in a bad state #37

Closed
quintessence opened this issue Jan 14, 2016 · 7 comments
Closed

Cannot update or delete a target if it is in a bad state #37

quintessence opened this issue Jan 14, 2016 · 7 comments

Comments

@quintessence
Copy link
Contributor

If two fields of a target are inadvertently switched:

$ shield show target 67c24213-31b7-495d-a6b5-d2131e5ffc03
UUID:         67c24213-31b7-495d-a6b5-d2131e5ffc03
Name:         sandbox-bosh
Summary:      Sandbox BOSH Database

Plugin:       postgres
Endpoint:     a.b.c.d:pppp
SHIELD Agent: {"pg_user": "vcap","pg_password": "c1oudc0w","pg_host": "localhost","pg_port": "5524","pg_bindir": "/var/vcap/packages/postgres-9.4.2/bin","pg_dump_args": ""}

Then the target cannot be edited or deleted. The shield CLI output will indicate that the edit or deletion is successful, but using show target or ls targets shows the target still present and unedited.

This issue may also apply to stores as well, for a similar reason.

@quintessence
Copy link
Contributor Author

This may be a use case for shield edit <store | target | schedule | policy> UUID --raw to pass raw JSON using an editor.

@jhunt
Copy link
Contributor

jhunt commented Jan 14, 2016

Agree. Can we put in another issue for --raw support?

Are you thinking of keeping the $EDITOR support from bkp, or just supporting reading from stdin?

@quintessence
Copy link
Contributor Author

I was thinking that using $EDITOR from bkp would be most straightforward, unless you have a better idea handy :)

@jhunt
Copy link
Contributor

jhunt commented Jan 14, 2016

Ah, I missed the "using an editor" part.

For scripting / automation (i.e. concourse jobs), I see the use case going like so:

cat | shield create job --raw <<EOF
{
  "the": "json",
  "definition": ["goes", "here"]
}
EOF

Which doesn't require an editor. Might be easier to implement.

@quintessence
Copy link
Contributor Author

That's a good point - I think that solution might make more sense.

@jhunt
Copy link
Contributor

jhunt commented Jan 15, 2016

I cannot repro this issue, but I did just push #43 to help in the diagnostics.

@quintessence
Copy link
Contributor Author

Issue appears to be resolved with latest commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants