support hostIP in downward API

This commit is contained in:
andrewsykim
2017-03-08 03:08:09 -05:00
parent b4c71b1f26
commit 91c027d6cc
7 changed files with 37 additions and 9 deletions

View File

@@ -41,11 +41,6 @@ func FormatMap(m map[string]string) (fmtStr string) {
// ExtractFieldPathAsString extracts the field from the given object
// and returns it as a string. The object must be a pointer to an
// API type.
//
// Currently, this API is limited to supporting the fieldpaths:
//
// 1. metadata.name - The name of an API object
// 2. metadata.namespace - The namespace of an API object
func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error) {
accessor, err := meta.Accessor(obj)
if err != nil {