mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
[Feature] Add Plan Changed Events (#585)
This commit is contained in:
parent
6c98ba26c4
commit
d562b93d2b
3 changed files with 26 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
- Add runtime TLS rotation for ArangoDB EE 3.7+
|
||||
- Add Kustomize support
|
||||
- Improve Helm 3 support
|
||||
- Allow to customize ID Pod selectors
|
||||
|
||||
## [1.0.3](https://github.com/arangodb/kube-arangodb/tree/1.0.3) (2020-05-25)
|
||||
- Prevent deletion of not known PVC's
|
||||
|
|
|
@ -73,7 +73,15 @@ func (d *Reconciler) CreatePlan(ctx context.Context, cachedStatus inspector.Insp
|
|||
// Nothing to do
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// Send events
|
||||
for id := len(status.Plan); id < len(newPlan); id++ {
|
||||
action := newPlan[id]
|
||||
d.context.CreateEvent(k8sutil.NewPlanAppendEvent(apiObject, action.Type.String(), action.Group.AsRole(), action.MemberID, action.Reason))
|
||||
}
|
||||
|
||||
status.Plan = newPlan
|
||||
|
||||
if err := d.context.UpdateStatus(status, lastVersion); err != nil {
|
||||
return maskAny(err), false
|
||||
}
|
||||
|
|
|
@ -153,6 +153,23 @@ func NewAccessPackageDeletedEvent(apiObject APIObject, apSecretName string) *Eve
|
|||
return event
|
||||
}
|
||||
|
||||
// NewPlanTimeoutEvent creates an event indicating that an item on a reconciliation plan has been added
|
||||
func NewPlanAppendEvent(apiObject APIObject, itemType, memberID, role, reason string) *Event {
|
||||
event := newDeploymentEvent(apiObject)
|
||||
event.Type = v1.EventTypeNormal
|
||||
event.Reason = "Plan Action added"
|
||||
msg := fmt.Sprintf("An plan item of type %s", itemType)
|
||||
if role != "" {
|
||||
msg = fmt.Sprintf("%s for member %s with role %s", msg, memberID, role)
|
||||
}
|
||||
msg = fmt.Sprintf("%s has beed added", msg)
|
||||
if reason != "" {
|
||||
msg = fmt.Sprintf("%s with reason: %s", msg, reason)
|
||||
}
|
||||
event.Message = msg
|
||||
return event
|
||||
}
|
||||
|
||||
// NewPlanTimeoutEvent creates an event indicating that an item on a reconciliation plan did not
|
||||
// finish before its deadline.
|
||||
func NewPlanTimeoutEvent(apiObject APIObject, itemType, memberID, role string) *Event {
|
||||
|
|
Loading…
Reference in a new issue