Documentation
¶
Index ¶
- Constants
- func ApplyResource(ctx context.Context, cli client.Client, obj client.Object, ...) error
- func ConvertToTypedList(uns []*unstructured.Unstructured, schema *runtime.Scheme) []client.Object
- func ConvertToTypedObject(uns *unstructured.Unstructured, schema *runtime.Scheme) client.Object
- func CorrectNamespaces[T client.Object](cli client.Client, defaultNamespace string, list []T)
- func CorrectNamespacesForRefrences(cli client.Client, defaultns string, list []ManagedResource)
- func EqualMapValues(a, b map[string]interface{}) bool
- func IsCRD(obj client.Object) bool
- func IsSkipedOn(obj client.Object, key string) bool
- func NamespacedScopeOf(cli client.Client, obj runtime.Object) (apimeta.RESTScopeName, error)
- func NamespacedScopeOfGVK(cli client.Client, gvk schema.GroupVersionKind) (apimeta.RESTScopeName, error)
- func ReadObjectsFromFile[T runtime.Object](path string) ([]T, error)
- func SplitYAML(data []byte) ([]*unstructured.Unstructured, error)
- func SplitYAMLFilterd[T runtime.Object](raw io.Reader) ([]T, error)
- type Apply
- type ApplyOptions
- type DiffResult
- type ManagedResource
- type SyncOptions
Constants ¶
View Source
const ReadCache = 4096
Variables ¶
This section is empty.
Functions ¶
func ApplyResource ¶
func ApplyResource(ctx context.Context, cli client.Client, obj client.Object, options ApplyOptions) error
func ConvertToTypedList ¶ added in v1.23.8
func ConvertToTypedList(uns []*unstructured.Unstructured, schema *runtime.Scheme) []client.Object
func ConvertToTypedObject ¶ added in v1.23.8
func ConvertToTypedObject(uns *unstructured.Unstructured, schema *runtime.Scheme) client.Object
func CorrectNamespaces ¶
func CorrectNamespaces[T client.Object](cli client.Client, defaultNamespace string, list []T)
func CorrectNamespacesForRefrences ¶
func CorrectNamespacesForRefrences(cli client.Client, defaultns string, list []ManagedResource)
func EqualMapValues ¶
func EqualMapValues(a, b map[string]interface{}) bool
func IsSkipedOn ¶
func IsSkipedOn(obj client.Object, key string) bool
func NamespacedScopeOf ¶
func NamespacedScopeOf(cli client.Client, obj runtime.Object) (apimeta.RESTScopeName, error)
func NamespacedScopeOfGVK ¶
func NamespacedScopeOfGVK(cli client.Client, gvk schema.GroupVersionKind) (apimeta.RESTScopeName, error)
func ReadObjectsFromFile ¶
func ReadObjectsFromFile[T runtime.Object](path string) ([]T, error)
func SplitYAMLFilterd ¶
func SplitYAMLFilterd[T runtime.Object](raw io.Reader) ([]T, error)
SplitYAMLFilterd reurns objects has type of `t`
Types ¶
type Apply ¶
type Apply struct {
Client client.Client
}
type ApplyOptions ¶
type ApplyOptions struct {
ServerSideApply bool
FieldOwner string
}
type DiffResult ¶
type DiffResult struct {
Creats []*unstructured.Unstructured
Applys []*unstructured.Unstructured
Removes []*unstructured.Unstructured
}
func DiffWithDefaultNamespace ¶
func DiffWithDefaultNamespace(
cli client.Client,
defaultnamespace string,
managed []ManagedResource,
resources []*unstructured.Unstructured,
) DiffResult
type ManagedResource ¶ added in v1.23.8
type ManagedResource struct {
APIVersion string `json:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
}
func GetReference ¶ added in v1.23.8
func GetReference(obj client.Object) ManagedResource
func (*ManagedResource) GetObjectKind ¶ added in v1.23.8
func (obj *ManagedResource) GetObjectKind() schema.ObjectKind
func (*ManagedResource) GroupVersionKind ¶ added in v1.23.8
func (obj *ManagedResource) GroupVersionKind() schema.GroupVersionKind
func (*ManagedResource) SetGroupVersionKind ¶ added in v1.23.8
func (obj *ManagedResource) SetGroupVersionKind(gvk schema.GroupVersionKind)
IsAnAPIObject allows clients to preemptively get a reference to an API object and pass it to places that intend only to get a reference to that object. This simplifies the event recording interface.
type SyncOptions ¶
type SyncOptions struct {
ServerSideApply bool
CreateNamespace bool
CleanCRD bool
}
func NewDefaultSyncOptions ¶
func NewDefaultSyncOptions() *SyncOptions
Click to show internal directories.
Click to hide internal directories.