Documentation ¶
Index ¶
- Constants
- Variables
- func IsOwnedBy(owner metav1.Object, obj metav1.Object) bool
- func LookupGVK(gk schema.GroupKind) (schema.GroupVersionKind, error)
- func ObjectsEquals(o1, o2 client.Object) bool
- type CapsuleRequest
- type CapsuleRequestOption
- type Object
- type ObjectsEqual
- type OutputObject
- type Pipeline
- type ResourceState
- type Result
- type Step
Constants ¶
View Source
const (
LabelOwnedByCapsule = "rig.dev/owned-by-capsule"
)
Variables ¶
View Source
var ( AppsDeploymentGVK = appsv1.SchemeGroupVersion.WithKind("Deployment") CoreServiceGVK = corev1.SchemeGroupVersion.WithKind("Service") CMCertificateGVK = cmv1.SchemeGroupVersion.WithKind(cmv1.CertificateKind) NetIngressGVK = netv1.SchemeGroupVersion.WithKind("Ingress") AutoscalingvHorizontalPodAutoscalerGVK = autoscalingv2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler") BatchCronJobGVK = batchv1.SchemeGroupVersion.WithKind("CronJob") MonitoringServiceMonitorGVK = monitorv1.SchemeGroupVersion.WithKind(monitorv1.ServiceMonitorsKind) VPAVerticalPodAutoscalerGVK = vpav1.SchemeGroupVersion.WithKind("VerticalPodAutoscaler") CoreServiceAccount = corev1.SchemeGroupVersion.WithKind("ServiceAccount") )
Functions ¶
func ObjectsEquals ¶
Types ¶
type CapsuleRequest ¶
type CapsuleRequest interface { // Scheme returns the serialization scheme used by the rig operator. // It contains all the types used by a Capsule. Scheme() *runtime.Scheme // Reader is a Kubernetes reader with access to the cluster the rig operator is running in. Reader() client.Reader // Capsule returns a deepcopy of the capsule object being reconciled. Capsule() *v1alpha2.Capsule // GetExisting populates 'obj' with a copy of the corresponding object owned by the capsule currently present in the cluster. // If the name of 'obj' isn't set, it defaults to the Capsule name. GetExisting(obj client.Object) error // GetNew populates 'obj' with a copy of the corresponding object owned by the capsule about to be applied. // If the name of 'obj' isn't set, it defaults to the Capsule name. GetNew(obj client.Object) error // Set updates the object recorded to be applied. // If the name of 'obj' isn't set, it defaults to the Capsule name. Set(obj client.Object) error // Delete records the given object to be deleted. // The behaviour is such that that calling // req.Delete(obj) and then req.GetNew(obj) // returns a not-found error from GetNew. // If an object of the given type and name is present in the cluster, calling req.GetExisting(obj) succeds // as calls to Delete (or Set) will only be applied to the cluster at the very end. // If the name of 'obj' isn't set, it defaults to the Capsule name. Delete(obj client.Object) error // MarkUsedObject marks the object as used by the Capsule which will be present in the Capsule's Status MarkUsedObject(res v1alpha2.UsedResource) error }
CapsuleRequest contains a single reconcile request for a given capsule. It contains both the set of existing kubernetes objects owned by the capsule and the set of objects recorded to be applied after all steps in the pipeline has been executed (called 'new' objects). The set of existing objects cannot be modified (as the interface does not allow for writing to Kubernetes) but there are both read and write access to the set of new objects.
func NewCapsuleRequest ¶
func NewCapsuleRequest(p *Pipeline, capsule *v1alpha2.Capsule, opts ...CapsuleRequestOption) CapsuleRequest
type CapsuleRequestOption ¶
type CapsuleRequestOption interface {
// contains filtered or unexported methods
}
func WithAdditionalResources ¶ added in v1.7.4
func WithAdditionalResources(resources []*pipeline.Object) CapsuleRequestOption
func WithDryRun ¶
func WithDryRun() CapsuleRequestOption
func WithForce ¶
func WithForce() CapsuleRequestOption
type ObjectsEqual ¶
type OutputObject ¶
type OutputObject struct { ObjectKey objectKey Object client.Object State ResourceState }
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
func (*Pipeline) RunCapsule ¶
type ResourceState ¶
type ResourceState string
const ( ResourceStateDeleted ResourceState = "deleted" ResourceStateUpdated ResourceState = "updated" ResourceStateUnchanged ResourceState = "unchanged" ResourceStateCreated ResourceState = "created" ResourceStateFailed ResourceState = "failed" ResourceStateAlreadyExists ResourceState = "alreadyExists" ResourceStateChangePending ResourceState = "changePending" )
Click to show internal directories.
Click to hide internal directories.