Skip to content

Commit

Permalink
fix crd resource etcd key path
Browse files Browse the repository at this point in the history
  • Loading branch information
捕影 committed Oct 10, 2023
1 parent d89a805 commit 54e05ea
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 @@ -18,6 +18,7 @@ package etcd

import (
"errors"
hubmeta "github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/meta"

Check failure on line 21 in pkg/yurthub/storage/etcd/key.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gci`-ed with --skip-generated -s standard,default (gci)
"path/filepath"

Check failure on line 23 in pkg/yurthub/storage/etcd/key.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `goimports`-ed (goimports)
"k8s.io/apimachinery/pkg/api/validation/path"
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 54e05ea

Please sign in to comment.