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

ETCDCTL_API=3 etcdctl lease grant <TTL> -w json does not return json #7783

Closed
ingvagabund opened this issue Apr 20, 2017 · 7 comments
Closed

Comments

@ingvagabund
Copy link
Contributor

When creating a lease with json as the output format, the output is not printed in json. Instead, it is printed as a simple format.

ETCDCTL_API=3 etcdctl --cert /etc/etcd/peer.crt --key /etc/etcd/peer.key --cacert /etc/etcd/ca.crt --endpoints https://172.16.186.106:2379 lease grant 10 -w json
2017-04-20 09:40:33.817507 I | warning: ignoring ServerName for user-provided CA for backwards compatibility is deprecated
lease 694d5b8b1830d1ae granted with TTL(10s)

Affected version: etcd-3.1.3

@ingvagabund
Copy link
Contributor Author

@ingvagabund
Copy link
Contributor Author

@heyitsanthony @gyuho

@ingvagabund
Copy link
Contributor Author

ingvagabund commented Apr 20, 2017

Maybe? Just shooting atm, did not try to compile it and run it.

if _, ok := display.(*simplePrinter); ok {
	fmt.Printf("lease %016x granted with TTL(%ds)\n", resp.ID, resp.TTL)
} else {
	display.Get(*resp)
}

@ingvagabund
Copy link
Contributor Author

src/github.com/coreos/etcd/etcdctl/ctlv3/command/lease_command.go:73: cannot use *resp (type clientv3.LeaseGrantResponse) as type clientv3.GetResponse in argument to display.Get

Ok, the LeaseGrantResponse needs to implemented the interface.

@gyuho
Copy link
Contributor

gyuho commented Apr 20, 2017

Yeah, @heyitsanthony do you remember why some lease RPCs are missing from printer interface?

@heyitsanthony
Copy link
Contributor

@gyuho lease commands weren't picked up during the printerization of the commands. They should be displayable as json since they map to RPCs.

@heyitsanthony heyitsanthony self-assigned this Apr 20, 2017
heyitsanthony pushed a commit to heyitsanthony/etcd that referenced this issue Apr 20, 2017
heyitsanthony pushed a commit to heyitsanthony/etcd that referenced this issue Apr 20, 2017
gyuho pushed a commit that referenced this issue Apr 20, 2017
@ingvagabund
Copy link
Contributor Author

Thanks guys

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

3 participants