Documentation ¶
Index ¶
- Constants
- func BuildFieldPathMap(yamlNode *yamlv3.Node, startLineNum int, curPath string, ...)
- func ToConfig(object metav1.Object, schema sresource.Schema, source resource.Reference, ...) (*config.Config, error)
- func TranslateObject(obj *unstructured.Unstructured, domainSuffix string, schema sresource.Schema) *config.Config
- type KubeSource
- func (s *KubeSource) ApplyContent(name, yamlText string) error
- func (s *KubeSource) Clear()
- func (s *KubeSource) ContentNames() map[string]struct{}
- func (s *KubeSource) Create(config config.Config) (revision string, err error)
- func (s *KubeSource) Delete(typ config.GroupVersionKind, name, namespace string, resourceVersion *string) error
- func (s *KubeSource) Get(typ config.GroupVersionKind, name, namespace string) *config.Config
- func (s *KubeSource) HasSynced() bool
- func (s *KubeSource) List(typ config.GroupVersionKind, namespace string) []config.Config
- func (s *KubeSource) Patch(orig config.Config, patchFn config.PatchFunc) (string, error)
- func (s *KubeSource) RegisterEventHandler(kind config.GroupVersionKind, handler model.EventHandler)
- func (s *KubeSource) RemoveContent(name string)
- func (s *KubeSource) Run(stop <-chan struct{})
- func (s *KubeSource) Schemas() collection.Schemas
- func (s *KubeSource) SetDefaultNamespace(defaultNs resource.Namespace)
- func (s *KubeSource) SetNamespacesFilter(namespacesFilter func(obj interface{}) bool)
- func (s *KubeSource) Update(config config.Config) (newRevision string, err error)
- func (s *KubeSource) UpdateStatus(config config.Config) (newRevision string, err error)
Constants ¶
const ( FieldMapKey = "istiofilefieldmap" ReferenceKey = "istiosource" )
Variables ¶
This section is empty.
Functions ¶
func BuildFieldPathMap ¶
func BuildFieldPathMap(yamlNode *yamlv3.Node, startLineNum int, curPath string, fieldPathMap map[string]int)
BuildFieldPathMap builds the flat map for each field of the YAML resource
func ToConfig ¶
func ToConfig(object metav1.Object, schema sresource.Schema, source resource.Reference, fieldMap map[string]int) (*config.Config, error)
ToConfig converts the given object and proto to a config.Config
func TranslateObject ¶
func TranslateObject(obj *unstructured.Unstructured, domainSuffix string, schema sresource.Schema) *config.Config
Types ¶
type KubeSource ¶
type KubeSource struct {
// contains filtered or unexported fields
}
KubeSource is an in-memory source implementation that can handle K8s style resources.
func NewKubeSource ¶
func NewKubeSource(schemas collection.Schemas) *KubeSource
NewKubeSource returns a new in-memory Source that works with Kubernetes resources.
func (*KubeSource) ApplyContent ¶
func (s *KubeSource) ApplyContent(name, yamlText string) error
ApplyContent applies the given yamltext to this source. The content is tracked with the given name. If ApplyContent gets called multiple times with the same name, the contents applied by the previous incarnation will be overwritten or removed, depending on the new content. Returns an error if any were encountered, but that still may represent a partial success
func (*KubeSource) ContentNames ¶
func (s *KubeSource) ContentNames() map[string]struct{}
ContentNames returns the names known to this source.
func (*KubeSource) Create ¶
func (s *KubeSource) Create(config config.Config) (revision string, err error)
func (*KubeSource) Delete ¶
func (s *KubeSource) Delete(typ config.GroupVersionKind, name, namespace string, resourceVersion *string) error
func (*KubeSource) Get ¶
func (s *KubeSource) Get(typ config.GroupVersionKind, name, namespace string) *config.Config
func (*KubeSource) HasSynced ¶
func (s *KubeSource) HasSynced() bool
func (*KubeSource) List ¶
func (s *KubeSource) List(typ config.GroupVersionKind, namespace string) []config.Config
func (*KubeSource) RegisterEventHandler ¶
func (s *KubeSource) RegisterEventHandler(kind config.GroupVersionKind, handler model.EventHandler)
func (*KubeSource) RemoveContent ¶
func (s *KubeSource) RemoveContent(name string)
RemoveContent removes the content for the given name
func (*KubeSource) Run ¶
func (s *KubeSource) Run(stop <-chan struct{})
func (*KubeSource) Schemas ¶
func (s *KubeSource) Schemas() collection.Schemas
func (*KubeSource) SetDefaultNamespace ¶
func (s *KubeSource) SetDefaultNamespace(defaultNs resource.Namespace)
SetDefaultNamespace enables injecting a default namespace for resources where none is already specified
func (*KubeSource) SetNamespacesFilter ¶
func (s *KubeSource) SetNamespacesFilter(namespacesFilter func(obj interface{}) bool)
SetNamespacesFilter enables filtering the namespaces this controller watches.
func (*KubeSource) Update ¶
func (s *KubeSource) Update(config config.Config) (newRevision string, err error)
func (*KubeSource) UpdateStatus ¶
func (s *KubeSource) UpdateStatus(config config.Config) (newRevision string, err error)