Documentation
¶
Overview ¶
Package resourcereader contains functions for reading, parsing and ordering kubernetes manifests from files or stdin. to use stdin as input use the "-" character as path.
Index ¶
Constants ¶
const StdinPath = "-"
StdinPath is the string expected for reading resources from reader instead of a local path
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder interface {
// ResourceReader return a Reader implementation based on the reader and path passed as arguments
ResourceReader(reader io.Reader, path string) (Reader, error)
}
Builder defines the interface for creating the correct Reader and cofigure it
func NewResourceReaderBuilder ¶
func NewResourceReaderBuilder(f util.ClientFactory) Builder
NewResourceReaderBuilder returns an instance of Builder.
type EnforcedNamespaceError ¶
type EnforcedNamespaceError struct {
EnforcedNamespace string
NamespaceFound string
ResourceGVK schema.GroupVersionKind
}
EnforcedNamespaceError is used if a resource is found with a different namespace then EnforcedNamespace
func (EnforcedNamespaceError) Error ¶
func (e EnforcedNamespaceError) Error() string
Error implements the error interface
type FilepathReader ¶
type FilepathReader struct {
ReaderConfigs
Path string
}
func (*FilepathReader) Read ¶
func (r *FilepathReader) Read() ([]*unstructured.Unstructured, error)
Read implement the Reader interface
type Reader ¶
type Reader interface {
// Read reads data from the Reader and parse them in Resource objects.
Read() ([]*unstructured.Unstructured, error)
}
Reader defines the interface for reading a set of data in Resource objects.
type ReaderConfigs ¶
type ReaderConfigs struct {
Mapper meta.RESTMapper
Namespace string
EnforceNamespace bool
}
ReaderConfigs common configurations between different Readers
type StreamReader ¶
type StreamReader struct {
ReaderConfigs
Reader io.Reader
}
StreamReader a StreamReader is a concrete implementation of Reader that will parse data from a given io.Reader
func (*StreamReader) Read ¶
func (r *StreamReader) Read() ([]*unstructured.Unstructured, error)
Read implement the Reader interface