file

package
v0.0.0-...-7929486 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
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) Clear

func (s *KubeSource) Clear()

Clear the contents of this source

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) Patch

func (s *KubeSource) Patch(orig config.Config, patchFn config.PatchFunc) (string, error)

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)

Directories

Path Synopsis
util

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL