Skip to content

Commit

Permalink
fix crd resource etcd key path (#1729)
Browse files Browse the repository at this point in the history
Co-authored-by: 捕影 <[email protected]>
  • Loading branch information
qsfang and 捕影 authored Oct 11, 2023
1 parent 08ae1c7 commit fbd5058
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/yurthub/storage/etcd/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"k8s.io/apimachinery/pkg/api/validation/path"
"k8s.io/apimachinery/pkg/runtime/schema"

hubmeta "github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/meta"
"github.com/openyurtio/openyurt/pkg/yurthub/storage"
)

Expand Down Expand Up @@ -72,6 +73,12 @@ func (s *etcdStorage) KeyFunc(info storage.KeyBuildInfo) (storage.Key, error) {

path := filepath.Join(s.prefix, resource, info.Namespace, info.Name)

gvr := schema.GroupVersionResource{Group: info.Group, Version: info.Version, Resource: info.Resources}
if isSchema := hubmeta.IsSchemeResource(gvr); !isSchema {
group := info.Group
path = filepath.Join(s.prefix, group, resource, info.Namespace, info.Name)
}

return storageKey{
comp: info.Component,
path: path,
Expand Down

0 comments on commit fbd5058

Please sign in to comment.