-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Preserve custom etcd prefix compatibility for etcd3 #42506
Conversation
iirc @hongchaodeng made that change. |
@timothysc Feel free to assign to you |
/lgtm |
Also need upgrade tests with custom prefixes that normalize differently ( |
This is already invalid path. Starting apiserver like this should reject it directly. |
I do not know if we do any validation to the |
rebased and added unit tests |
/approve This is a very serious issue that could cause data loss for an upgrading cluster if the administrator had custom prefixes and wasn't paying attention. /lgtm |
@smarterclayton: you can't LGTM a PR unless you are an assignee. In response to this comment:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Actually, quick question. What if an admin had previously configured a prefix of |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED The following people have approved this PR: hongchaodeng, liggitt, smarterclayton Needs approval from an approver in each of these OWNERS Files:
We suggest the following people: |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
etcd2 used path.join on the prefix and would have normalized it away ( we don't use path join in the keyfuncs. |
Ok, thanks lgtm as well. |
opened cherry-pick for 1.5.x |
@liggitt: The following test(s) failed:
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 42506, 42585, 42596, 42584) |
Both of them use etcd2: func (h *etcdHelper) prefixEtcdKey(key string) string {
if strings.HasPrefix(key, h.pathPrefix) {
return key
}
return path.Join(h.pathPrefix, key)
} etcd3: func keyWithPrefix(prefix, key string) string {
if strings.HasPrefix(key, prefix) {
return key
}
return path.Join(prefix, key)
} |
those don't exist any more (b6e3296), but yes, the etcd prefix and the key are joined that way. I was referring to the actual key functions in the registries |
…k-of-#42506-upstream-release-1.5 Automatic merge from submit-queue Automated cherry pick of kubernetes#42506 Cherry pick of kubernetes#42506 on release-1.5. kubernetes#42506: Preserve custom etcd prefix compatibility for etcd3 ```release-note restored normalization of custom `--etcd-prefix` when `--storage-backend` is set to etcd3 ```
Fixes #42505