Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIConverter ¶
type APIConverter[t RootObject] interface { // GetExpectedGVKs returns the list of GroupVersionKinds for resources expected to be created by this converter. GetExpectedGVKs() []schema.GroupVersionKind // Translate performs the conversion or translation logic for the root object, returning an error if the process fails. Translate() error // GetRootObject returns the current root object of type t. GetRootObject() t // GetOutputStore returns a slice of unstructured.Unstructured objects representing the current state of the store, using the provided context. GetOutputStore(ctx context.Context) []unstructured.Unstructured // Reduce returns a slice of utils.ReduceFunc functions that can be applied to the given unstructured.Unstructured object to get a list of duplicates to be removed. Reduce(obj unstructured.Unstructured) []utils.ReduceFunc // ListExistingObjects lists all existing unstructured.Unstructured objects of the destination API kind, using the provided context, and returns them along with any error encountered. ListExistingObjects(ctx context.Context) ([]unstructured.Unstructured, error) UpdateSharedRouteStatus([]unstructured.Unstructured) error }
APIConverter defines an interface for converting and managing Kubernetes API objects of a generic type t that satisfies the RootObject constraint.
func NewConverter ¶
func NewConverter[t RootObject](obj t, cl client.Client, sharedStatusMap *route.SharedRouteStatusMap) (APIConverter[t], error)
NewConverter is a factory function that creates and returns an APIConverter instance based on the type of the provided root object. It supports different types of root objects and returns an error if the type is unsupported.
type RootObject ¶
RootObject is an interface that represents all resource types that can be loaded as root by the APIConverter.
type RootObjectPtr ¶
type RootObjectPtr[T RootObject] interface { *T client.Object }
RootObjectPtr is a generic interface that represents a pointer to a type T, where T implements the RootObject interface. It also requires that the type implements the client.Object interface, enabling Kubernetes client operations.