Skip to content

Commit

Permalink
Fix to pass tests
Browse files Browse the repository at this point in the history
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
  • Loading branch information
Warashi committed Dec 27, 2024
1 parent bcfd121 commit 2e7b2f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pkg/app/pipedv1/plugin/kubernetes/provider/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ func FindRemoveResources(manifests, namespacedLiveResources, clusterScopedLiveRe
}
for _, r := range clusterScopedLiveResources {
// We don't care about the namespace of the cluster-scoped resources.
k := r.Key().normalize().withoutNamespace()
if _, ok := normalizedKeys[k]; !ok {
removeKeys = append(removeKeys, k)
if _, ok := normalizedKeys[r.Key().normalize().withoutNamespace()]; !ok {
removeKeys = append(removeKeys, r.Key())
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/app/pipedv1/plugin/kubernetes/provider/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ metadata:
`,
expectedRemoveKeys: []ResourceKey{
{
groupKind: schema.GroupKind{Group: "", Kind: "secret"},
groupKind: schema.GroupKind{Group: "", Kind: "Secret"},
namespace: "default",
name: "old-secret",
},
{
groupKind: schema.GroupKind{Group: "", Kind: "namespace"},
groupKind: schema.GroupKind{Group: "", Kind: "Namespace"},
namespace: "",
name: "test-namespace",
},
Expand Down

0 comments on commit 2e7b2f5

Please sign in to comment.