mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Addresses slice case with notNamespaceable objects
This commit is contained in:
@@ -117,7 +117,7 @@ func (o *nameReferenceTransformer) getNewNameFunc(
|
|||||||
for _, res := range referralCandidates.Resources() {
|
for _, res := range referralCandidates.Resources() {
|
||||||
id := res.OrgId()
|
id := res.OrgId()
|
||||||
if id.IsSelected(&target) && res.GetOriginalName() == oldName {
|
if id.IsSelected(&target) && res.GetOriginalName() == oldName {
|
||||||
matches := referralCandidates.GetMatchingResourcesByOriginalId(id.GvknEquals)
|
matches := referralCandidates.GetMatchingResourcesByOriginalId(id.Equals)
|
||||||
// If there's more than one match, there's no way
|
// If there's more than one match, there's no way
|
||||||
// to know which one to pick, so emit error.
|
// to know which one to pick, so emit error.
|
||||||
if len(matches) > 1 {
|
if len(matches) > 1 {
|
||||||
@@ -149,7 +149,7 @@ func (o *nameReferenceTransformer) getNewNameFunc(
|
|||||||
indexes := indexOf(res.GetOriginalName(), names)
|
indexes := indexOf(res.GetOriginalName(), names)
|
||||||
id := res.OrgId()
|
id := res.OrgId()
|
||||||
if id.IsSelected(&target) && len(indexes) > 0 {
|
if id.IsSelected(&target) && len(indexes) > 0 {
|
||||||
matches := referralCandidates.GetMatchingResourcesByOriginalId(id.GvknEquals)
|
matches := referralCandidates.GetMatchingResourcesByOriginalId(id.Equals)
|
||||||
if len(matches) > 1 {
|
if len(matches) > 1 {
|
||||||
return nil, fmt.Errorf(
|
return nil, fmt.Errorf(
|
||||||
"slice case - multiple matches for %s:\n %v",
|
"slice case - multiple matches for %s:\n %v",
|
||||||
|
|||||||
Reference in New Issue
Block a user