Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hash ¶
func Hash(rr *ReconciliationRequest) ([]byte, error)
func HashStr ¶
func HashStr(rr *ReconciliationRequest) (string, error)
Types ¶
type Controller ¶ added in v2.28.0
type Controller interface {
// Owns returns true if the controller manages resources of the specified GroupVersionKind.
Owns(gvk schema.GroupVersionKind) bool
// GetClient returns a controller-runtime client used to interact with the Kubernetes API.
GetClient() client.Client
// GetDiscoveryClient returns a client-go discovery client used to discover API resources on the cluster.
GetDiscoveryClient() discovery.DiscoveryInterface
// GetDynamicClient returns a client-go dynamic client for working with unstructured resources.
GetDynamicClient() dynamic.Interface
}
Controller defines the core interface for a controller in the OpenDataHub Operator.
type ManifestInfo ¶
func (ManifestInfo) String ¶
func (mi ManifestInfo) String() string
type ReconciliationRequest ¶
type ReconciliationRequest struct {
Client client.Client
Controller Controller
Conditions *conditions.Manager
Instance common.PlatformObject
DSCI *dsciv1.DSCInitialization
Release common.Release
Manifests []ManifestInfo
//
// TODO: unify templates and resources.
//
// Unfortunately, the kustomize APIs do not yet support a FileSystem that is
// backed by golang's fs.Fs so it is not simple to have a single abstraction
// for both the manifests types.
//
// it would be nice to have a structure like:
//
// struct {
// FS fs.FS
// URI net.URL
// }
//
// where the URI could be something like:
// - kustomize:///path/to/overlay
// - template:///path/to/resource.tmpl.yaml
//
// and use the scheme as discriminator for the rendering engine
//
Templates []TemplateInfo
Resources []unstructured.Unstructured
// TODO: this has been added to reduce GC work and only run when
// resources have been generated. It should be removed and
// replaced with a better way of describing resources and
// their origin
Generated bool
}
func (*ReconciliationRequest) AddResources ¶
func (rr *ReconciliationRequest) AddResources(values ...client.Object) error
AddResources adds one or more resources to the ReconciliationRequest's Resources slice. Each provided client.Object is normalized by ensuring it has the appropriate GVK and is converted into an unstructured.Unstructured format before being appended to the list.
func (*ReconciliationRequest) ForEachResource ¶
func (rr *ReconciliationRequest) ForEachResource(fn func(*unstructured.Unstructured) (bool, error)) error
ForEachResource iterates over each resource in the ReconciliationRequest's Resources slice, invoking the provided function `fn` for each resource. The function `fn` takes a pointer to an unstructured.Unstructured object and returns a boolean and an error.
The iteration stops early if:
- `fn` returns an error.
- `fn` returns `true` as the first return value (`stop`).
func (*ReconciliationRequest) RemoveResources ¶
func (rr *ReconciliationRequest) RemoveResources(predicate func(*unstructured.Unstructured) bool) error
RemoveResources removes resources from the ReconciliationRequest's Resources slice based on a provided predicate function. The predicate determines whether a resource should be removed.
Parameters:
- predicate: A function that takes a pointer to an unstructured.Unstructured object and returns a boolean indicating whether the resource should be removed.
type ResourceObject ¶
type ResourceObject interface {
client.Object
common.WithStatus
}