Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions pkg/deployment/reconcile/plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
17 changes: 17 additions & 0 deletions pkg/util/k8sutil/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down