Documentation
¶
Index ¶
- Constants
- func Add(mgr manager.Manager) error
- func ControllerRevisionName(prefix string, hash string) string
- func DeepHashObject(hasher hash.Hash, objectToWrite interface{})
- func GetControllerKey(sbs *agentsv1alpha1.SandboxSet) string
- func HashControllerRevision(revision *apps.ControllerRevision, probe *int32) string
- func NewControllerRevision(parent metav1.Object, parentKind schema.GroupVersionKind, ...) (*apps.ControllerRevision, error)
- type GroupedSandboxes
- type Reconciler
- type SandboxEventHandler
- func (e *SandboxEventHandler) Create(_ context.Context, evt event.TypedCreateEvent[client.Object], ...)
- func (e *SandboxEventHandler) Delete(_ context.Context, evt event.TypedDeleteEvent[client.Object], ...)
- func (e *SandboxEventHandler) Generic(context.Context, event.TypedGenericEvent[client.Object], ...)
- func (e *SandboxEventHandler) Update(ctx context.Context, evt event.TypedUpdateEvent[client.Object], ...)
Constants ¶
const ( EventSandboxCreated = "SandboxCreated" EventSandboxScaledDown = "SandboxScaledDown" EventFailedSandboxDeleted = "FailedSandboxDeleted" )
const ControllerRevisionHashLabel = "controller.kubernetes.io/hash"
ControllerRevisionHashLabel is the label used to indicate the hash value of a ControllerRevision's Data.
Variables ¶
This section is empty.
Functions ¶
func ControllerRevisionName ¶
ControllerRevisionName returns the Name for a ControllerRevision in the form prefix-hash. If the length of prefix is greater than 223 bytes, it is truncated to allow for a name that is no larger than 253 bytes.
func DeepHashObject ¶
DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.
func GetControllerKey ¶
func GetControllerKey(sbs *agentsv1alpha1.SandboxSet) string
GetControllerKey return key of CloneSet.
func HashControllerRevision ¶
func HashControllerRevision(revision *apps.ControllerRevision, probe *int32) string
HashControllerRevision hashes the contents of revision's Data using FNV hashing. If probe is not nil, the byte value of probe is added written to the hash as well. The returned hash will be a safe encoded string to avoid bad words.
func NewControllerRevision ¶
func NewControllerRevision(parent metav1.Object, parentKind schema.GroupVersionKind, templateLabels map[string]string, data runtime.RawExtension, revision int64, collisionCount *int32) (*apps.ControllerRevision, error)
NewControllerRevision returns a ControllerRevision with a ControllerRef pointing to parent and indicating that parent is of parentKind. The ControllerRevision has labels matching template labels, contains Data equal to data, and has a Revision equal to revision. The collisionCount is used when creating the name of the ControllerRevision so the name is likely unique. If the returned error is nil, the returned ControllerRevision is valid. If the returned error is not nil, the returned ControllerRevision is invalid for use.
Types ¶
type GroupedSandboxes ¶
type GroupedSandboxes struct {
Creating []*agentsv1alpha1.Sandbox // Sandboxes being created or initialized
Available []*agentsv1alpha1.Sandbox // Initialized but not yet claimed Sandboxes
Used []*agentsv1alpha1.Sandbox // Sandboxes claimed by client agents
Dead []*agentsv1alpha1.Sandbox // Sandboxes should be deleted
}
type Reconciler ¶
type Reconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
Codec runtime.Codec
}
Reconciler reconciles a Sandbox object
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type SandboxEventHandler ¶
type SandboxEventHandler struct{}
func (*SandboxEventHandler) Create ¶
func (e *SandboxEventHandler) Create(_ context.Context, evt event.TypedCreateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request])
func (*SandboxEventHandler) Delete ¶
func (e *SandboxEventHandler) Delete(_ context.Context, evt event.TypedDeleteEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request])
func (*SandboxEventHandler) Generic ¶
func (e *SandboxEventHandler) Generic(context.Context, event.TypedGenericEvent[client.Object], workqueue.TypedRateLimitingInterface[reconcile.Request])
func (*SandboxEventHandler) Update ¶
func (e *SandboxEventHandler) Update(ctx context.Context, evt event.TypedUpdateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request])