reconcile

package
v1.20.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package reconcile contains Reconcilers for the Syncer's controllers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsUnstructured

func AsUnstructured(o client.Object) (*unstructured.Unstructured, status.Error)

AsUnstructured attempts to convert a client.Object to an *unstructured.Unstructured using the global core.Scheme.

func AsUnstructuredSanitized

func AsUnstructuredSanitized(o client.Object) (*unstructured.Unstructured, status.Error)

AsUnstructuredSanitized converts o to an Unstructured and removes problematic fields: - metadata.creationTimestamp - status

These fields must not be set in the source, so we can safely drop them from the current live manifest, because we won't ever need to be reverted.

This allows the returned object to be used with Server-Side Apply without accidentally attempting to modify or take ownership of these fields.

This is required because the existing typed objects don't use pointers and thus can't be set to nil, and the Go JSON formatter ignores omitempty on non-pointer structs. So even when empty, the fields are still set during serialization, which would cause SSA to try to delete the existing value. For more details, see https://www.sohamkamani.com/golang/2018-07-19-golang-omitempty/

Types

type Applier

type Applier interface {
	Create(ctx context.Context, obj *unstructured.Unstructured) status.Error
	Update(ctx context.Context, intendedState, currentState *unstructured.Unstructured) status.Error
	// RemoveNomosMeta performs a PUT (rather than a PATCH) to ensure that labels and annotations are removed.
	RemoveNomosMeta(ctx context.Context, intent *unstructured.Unstructured, controller string) status.Error
	Delete(ctx context.Context, obj *unstructured.Unstructured) status.Error
	GetClient() client.Client
}

Applier updates a resource from its current state to its intended state using apply operations.

func NewApplierForMultiRepo

func NewApplierForMultiRepo(cfg *rest.Config, client *syncerclient.Client, applySetID string) (Applier, error)

NewApplierForMultiRepo returns a new clientApplier for callers with multi repo feature enabled.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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