Hide unstructured.Unstructured behind interface.

This commit is contained in:
jregan
2018-10-06 10:44:34 -07:00
committed by Jeffrey Regan
parent 9c8302b2d2
commit 0f5a39f328
35 changed files with 527 additions and 419 deletions

View File

@@ -17,6 +17,8 @@ limitations under the License.
// Package ifc holds miscellaneous interfaces used by kustomize.
package ifc
import "sigs.k8s.io/kustomize/pkg/gvk"
// Decoder unmarshalls byte input into an object.
type Decoder interface {
// SetInput accepts new input.
@@ -48,3 +50,22 @@ type Loader interface {
type Hash interface {
Hash(m map[string]interface{}) (string, error)
}
// Kunstructured allows manipulation of k8s objects
// that do not have Golang structs.
type Kunstructured interface {
Map() map[string]interface{}
SetMap(map[string]interface{})
Copy() Kunstructured
GetFieldValue(string) (string, error)
MarshalJSON() ([]byte, error)
UnmarshalJSON([]byte) error
GetGvk() gvk.Gvk
GetKind() string
GetName() string
SetName(string)
GetLabels() map[string]string
SetLabels(map[string]string)
GetAnnotations() map[string]string
SetAnnotations(map[string]string)
}