Merge pull request #4344 from natasha41575/ResIdStr

improve gvk and resid strings for error messages
This commit is contained in:
Kubernetes Prow Robot
2021-12-22 12:27:03 -08:00
committed by GitHub
14 changed files with 85 additions and 155 deletions

View File

@@ -172,7 +172,7 @@ func getReplacement(nodes []*yaml.RNode, r *types.Replacement) (*yaml.RNode, err
return nil, err
}
if rn.IsNilOrEmpty() {
return nil, fmt.Errorf("fieldPath `%s` is missing for replacement source %s", r.Source.FieldPath, r.Source)
return nil, fmt.Errorf("fieldPath `%s` is missing for replacement source %s", r.Source.FieldPath, r.Source.ResId)
}
return getRefinedValue(r.Source.Options, rn)

View File

@@ -269,7 +269,7 @@ spec:
- select:
kind: Deployment
`,
expectedErr: "multiple matches for selector ~G_~V_Deployment|~X|~N",
expectedErr: "multiple matches for selector Deployment.[noVer].[noGrp]/[noName].[noNs]",
},
"replacement has no source": {
input: `apiVersion: v1
@@ -1586,7 +1586,7 @@ data:
options:
create: true
`,
expectedErr: "fieldPath `data.httpPort` is missing for replacement source ~G_~V_ConfigMap|~X|ports-from:data.httpPort",
expectedErr: "fieldPath `data.httpPort` is missing for replacement source ConfigMap.[noVer].[noGrp]/ports-from.[noNs]",
},
"annotationSelector": {
input: `apiVersion: v1