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

[3.5] *: support custom content check online in v2store #19114

Closed
wants to merge 1 commit into from

Conversation

fuweid
Copy link
Member

@fuweid fuweid commented Dec 29, 2024

It's to use v2 API to list all keys in v2store. If there is any active key in v2store, etcdctl check v2store returns error. However, the last snapshot might still contain custom content. The end-user still needs to check that content offline by etcdutl check v2store.

Part of #18993

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

It's to use v2 API to list all keys in v2store. If there is any active
key in v2store, `etcdctl check v2store` returns error. However, the last
snapshot might still contain custom content. The end-user still needs to
check that content offline by `etcdutl check v2store`.

Part of etcd-io#18993

Signed-off-by: Wei Fu <[email protected]>
@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fuweid
Once this PR has been reviewed and has the lgtm label, please assign jmhbnz for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fuweid fuweid marked this pull request as ready for review December 29, 2024 03:19
@ahrtr
Copy link
Member

ahrtr commented Dec 29, 2024

Users should be able to use the existing etcdctl v2 command ETCDCTL_API=2 ./bin/etcdctl ls directly,

command.NewLsCommand(),

Firstly start etcd with v2 enabled,

$ ./bin/etcd  --enable-v2

Then run commands below,

$ ETCDCTL_API=2 ./bin/etcdctl ls
//Nothing returned

$ ETCDCTL_API=2 ./bin/etcdctl set k1 v1
v1

$ ETCDCTL_API=2 ./bin/etcdctl ls
/k1

$ ETCDCTL_API=2 ./bin/etcdctl set k2 v2
v2

$ ETCDCTL_API=2 ./bin/etcdctl ls
/k2
/k1

If v2 isn't enabled at all,

$ ETCDCTL_API=2 ./bin/etcdctl ls
Error:  client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint

Similarly, users can run ETCDCTL_API=2 ./bin/etcdctl user list and ETCDCTL_API=2 ./bin/etcdctl role list to get the user and role list,

$ ETCDCTL_API=2 ./bin/etcdctl user add  u1:p1
User u1 created

$ ETCDCTL_API=2 ./bin/etcdctl user add  u2:p2
User u2 created

$ ETCDCTL_API=2 ./bin/etcdctl user add  u3:p3
User u3 created

$ ETCDCTL_API=2 ./bin/etcdctl user list
u1
u2
u3
$ ETCDCTL_API=2 ./bin/etcdctl role add r1
Role r1 created

$ ETCDCTL_API=2 ./bin/etcdctl role list
r1
root

@fuweid
Copy link
Member Author

fuweid commented Dec 30, 2024

Users should be able to use the existing etcdctl v2 command ETCDCTL_API=2 ./bin/etcdctl ls directly,

Yes. The v2 api is that only way to check v2store online. Let me close it. Thanks for the comment @ahrtr

@fuweid fuweid closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants