add support for exec plugins

This commit is contained in:
Jingfang Liu
2019-04-12 15:41:41 -07:00
parent 28cb6daec7
commit f6e01cfda7
11 changed files with 263 additions and 108 deletions

View File

@@ -19,7 +19,7 @@ package kunstruct
import (
"encoding/json"
"fmt"
"sigs.k8s.io/kustomize/pkg/types"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -88,7 +88,7 @@ func (fs *UnstructAdapter) GetFieldValue(path string) (string, error) {
if found || err != nil {
return s, err
}
return "", fmt.Errorf("no field named '%s'", path)
return "", types.NoFieldError{Field: path}
}
// GetStringSlice returns value at the given fieldpath.
@@ -102,5 +102,5 @@ func (fs *UnstructAdapter) GetStringSlice(path string) ([]string, error) {
if found || err != nil {
return s, err
}
return []string{}, fmt.Errorf("no field named '%s'", path)
return []string{}, types.NoFieldError{Field: path}
}