utils/acquire.go
func Read(vm *jsonnet.VM, path string) ([]runtime.Object, error) {
	ext := filepath.Ext(path)
	if ext == ".json" {
		f, err := os.Open(path)
		if err != nil {
			return nil, err
		}
		defer f.Close()
		return jsonReader(f)
	} else if ext == ".yaml" {
		f, err := os.Open(path)
		if err != nil {
			return nil, err
		}
		defer f.Close()
		return yamlReader(f)
	} else if ext == ".jsonnet" {
		return jsonnetReader(vm, path)
	}

	return nil, fmt.Errorf("Unknown file extension: %s", path)
}
func Read(vm *jsonnet.VM, path string) ([]runtime.Object, error) {
	ext := filepath.Ext(path)
	if ext == ".json" {
		f, err := os.Open(path)
		if err != nil {
			return nil, err
		}
		defer f.Close()
		return jsonReader(f)
	} else if ext == ".yaml" {
		f, err := os.Open(path)
		if err != nil {
			return nil, err
		}
		defer f.Close()
		return yamlReader(f)
	} else if ext == ".jsonnet" {
		return jsonnetReader(vm, path)
	}

	return nil, fmt.Errorf("Unknown file extension: %s", path)
}
func Read ( vm * jsonnet . VM , path string ) ( [ ] runtime . Object , error ) { ext := filepath . Ext ( path ) if ext == " " { f , err := os . Open ( path ) if err != nil { return nil , err } defer f . Close ( ) return jsonReader ( f ) } else if ext == " " { f , err := os . Open ( path ) if err != nil { return nil , err } defer f . Close ( ) return yamlReader ( f ) } else if ext == " " { return jsonnetReader ( vm , path ) } return nil , fmt . Errorf ( " " , path ) }
// Read fetches and decodes K8s objects by path.
// TODO: Replace this with something supporting more sophisticated
// content negotiation.
Read fetches and decodes K8s objects by path . TODO : Replace this with something supporting more sophisticated content negotiation .