Skip to content

Commit

Permalink
bugfix: ReplaceComponentList should not delete resources of other gvr (
Browse files Browse the repository at this point in the history
…#1153)

* bugfix: ReplaceComponentList should not delete resources of other gvr

Signed-off-by: Congrool <[email protected]>
  • Loading branch information
Congrool committed Jan 18, 2023
1 parent 735b40a commit e84c4f6
Show file tree
Hide file tree
Showing 7 changed files with 679 additions and 282 deletions.
16 changes: 16 additions & 0 deletions pkg/yurthub/poolcoordinator/resources/resources.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2023 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package resources

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2023 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package resources

import "k8s.io/apimachinery/pkg/runtime/schema"
Expand Down
6 changes: 6 additions & 0 deletions pkg/yurthub/storage/etcd/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var SpecialDefaultResourcePrefixes = map[schema.GroupResource]string{
type storageKey struct {
comp string
path string
gvr schema.GroupVersionResource
}

func (k storageKey) Key() string {
Expand Down Expand Up @@ -74,5 +75,10 @@ func (s *etcdStorage) KeyFunc(info storage.KeyBuildInfo) (storage.Key, error) {
return storageKey{
comp: info.Component,
path: path,
gvr: schema.GroupVersionResource{
Group: info.Group,
Version: info.Version,
Resource: info.Resources,
},
}, nil
}
Loading

0 comments on commit e84c4f6

Please sign in to comment.