-
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
Remove storage versions flag #67678
Remove storage versions flag #67678
Conversation
/sig api-machinery |
0e39962
to
5a84234
Compare
/cc @enj |
staging/src/k8s.io/apiserver/pkg/server/storage/resource_encoding_config.go
Show resolved
Hide resolved
@@ -112,7 100,7 @@ func (o *DefaultResourceEncodingConfig) InMemoryEncodingFor(resource schema.Grou | |||
|
|||
resourceOverride, resourceExists := groupEncoding.InternalResourceEncodings[resource.Resource] | |||
if !resourceExists { | |||
return groupEncoding.DefaultInternalEncoding, nil | |||
return schema.GroupVersion{Group: resource.Group, Version: runtime.APIVersionInternal}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this changed?
@@ -94,7 81,8 @@ func (o *DefaultResourceEncodingConfig) StorageEncodingFor(resource schema.Group | |||
|
|||
resourceOverride, resourceExists := groupEncoding.ExternalResourceEncodings[resource.Resource] | |||
if !resourceExists { | |||
return groupEncoding.DefaultExternalEncoding, nil | |||
// return the most preferred external version for the group | |||
return o.scheme.PrioritizedVersionsForGroup(resource.Group)[0], nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, didn't expect this
/cc @deads2k |
the etcd_storage integration test would be the most interesting test to ensure still works after this I also expected the flag to be announced/released as deprecated prior to removing it |
I'll try to finish this PR and remove the "WIP" today, please do not review the details yet. I'll take another look at the etcd_storage integration test. |
if the first step is to mark the flag deprecated, then wait for the deprecation period, it seems like the first PR wouldn't be able to remove all of this yet. |
/retest |
Can we keep the flag, but make it non-functional, and mark it as deprecated? It shouldn't break regular users, unless someone reads etcd directly. If we keep this flag functioning for two more releases, storage migration won't be safe unless users follow instructions to disable this flag. |
Tests are passing, especially the |
/retest |
Rebased. @liggitt PTAL, thanks. |
was this not successful? |
It was successful enough, kubernetes-sigs/kube-storage-version-migrator#16 :) |
excellent, thanks |
/approve cancel actually, I'm not sure this got reviewed. will queue it up, glad it can progress for 1.14 |
No, it wasn't reviewed thoroughly. I'll squash after it's reviewed. |
9279333
to
b041fdb
Compare
@liggitt PTAL. Thanks. |
b041fdb
to
b07003f
Compare
@caesarxuchao: The following test failed, say
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. |
The storage version now is solely decided by the scheme.PrioritizedVersionsForGroup(). For cohabitating resources, the storage version will be that of the overriding group as returned by storageFactory.getStorageGroupResource().
is either decided by the schema's version priority, or by the per resource override. This fixes a bug where the "batch" group is encoded in v1beta1, which was hidden when --storage-versions is a valid flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one comment on the variable names. looks reasonable otherwise. leaning heavily on the etcd storage path test (no change needed there is a really good sign)
DefaultInternalEncoding schema.GroupVersion | ||
InternalResourceEncodings map[string]schema.GroupVersion | ||
type OverridingResourceEncoding struct { | ||
ExternalResourceEncodings schema.GroupVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ExternalResourceEncoding
InternalResourceEncodings map[string]schema.GroupVersion | ||
type OverridingResourceEncoding struct { | ||
ExternalResourceEncodings schema.GroupVersion | ||
InternalResourceEncodings schema.GroupVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: InternalResourceEncoding
…up override at all
b07003f
to
4ea0708
Compare
Fixed the nits. PTAL. Thanks. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: caesarxuchao, liggitt The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This pull follows up #68080. The
--storage-versions
flag of kube-apiserver is removed.