mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 09:49:13 +00:00
Merge pull request #77 from uthark/golint
Fix go lint error and add golint checks to a pre-commit hook
This commit is contained in:
@@ -66,11 +66,13 @@ func (r *Resource) Id() ResId {
|
||||
return NewResId(r.GroupVersionKind(), r.GetName())
|
||||
}
|
||||
|
||||
// Merge performs merge with other resource.
|
||||
func (r *Resource) Merge(other *Resource) {
|
||||
r.Replace(other)
|
||||
mergeConfigmap(r.Object, other.Object, r.Object)
|
||||
}
|
||||
|
||||
// Replace performs replace with other resource.
|
||||
func (r *Resource) Replace(other *Resource) {
|
||||
r.SetLabels(mergeStringMaps(other.GetLabels(), r.GetLabels()))
|
||||
r.SetAnnotations(mergeStringMaps(other.GetAnnotations(), r.GetAnnotations()))
|
||||
@@ -101,6 +103,7 @@ func mergeStringMaps(maps ...map[string]string) map[string]string {
|
||||
return result
|
||||
}
|
||||
|
||||
// GetFieldValue returns value at the given fieldpath.
|
||||
func (r *Resource) GetFieldValue(fieldPath string) (string, error) {
|
||||
return getFieldValue(r.UnstructuredContent(), strings.Split(fieldPath, "."))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user