func NewCannotChangeStorageClassEvent(apiObject APIObject, memberID, role, subReason string) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = fmt.Sprintf("%s Member StorageClass Cannot Change", strings.Title(role))
	event.Message = fmt.Sprintf("Member %s with role %s should use a different StorageClass, but is cannot because: %s", memberID, role, subReason)
	return event
}
NewCannotChangeStorageClassEvent creates an event indicating that an item would need to use a different StorageClass,
but this is not possible for the given reason.
package k8sutil
import (
	"fmt"
	"strings"
	driver "github.com/arangodb/go-driver"
	upgraderules "github.com/arangodb/go-upgrade-rules"
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
)
type Event struct {
	InvolvedObject runtime.Object
	Type           string
	Reason         string
	Message        string
}
type APIObject interface {
	runtime.Object
	metav1.Object
	AsOwner() metav1.OwnerReference
}
func NewMemberAddEvent(memberName, role string, apiObject APIObject) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = fmt.Sprintf("New %s Added", strings.Title(role))
	event.Message = fmt.Sprintf("New %s %s added to deployment", role, memberName)
	return event
}
func NewMemberRemoveEvent(memberName, role string, apiObject APIObject) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = fmt.Sprintf("%s Removed", strings.Title(role))
	event.Message = fmt.Sprintf("Existing %s %s removed from the deployment", role, memberName)
	return event
}
func NewPodCreatedEvent(podName, role string, apiObject APIObject) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = fmt.Sprintf("Pod Of %s Created", strings.Title(role))
	event.Message = fmt.Sprintf("Pod %s of member %s is created", podName, role)
	return event
}
func NewPodGoneEvent(podName, role string, apiObject APIObject) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = fmt.Sprintf("Pod Of %s Gone", strings.Title(role))
	event.Message = fmt.Sprintf("Pod %s of member %s is gone", podName, role)
	return event
}
func NewImmutableFieldEvent(fieldName string, apiObject APIObject) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = "Immutable Field Change"
	event.Message = fmt.Sprintf("Changing field %s is not possible. It has been reset to its original value.", fieldName)
	return event
}
func NewPodsSchedulingFailureEvent(unscheduledPodNames []string, apiObject APIObject) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = "Pods Scheduling Failure"
	event.Message = fmt.Sprintf("One or more pods are not scheduled in time. Pods: %v", unscheduledPodNames)
	return event
}
func NewPodsSchedulingResolvedEvent(apiObject APIObject) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = "Pods Scheduling Resolved"
	event.Message = "All pods have been scheduled"
	return event
}
func NewSecretsChangedEvent(changedSecretNames []string, apiObject APIObject) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = "Secrets changed"
	event.Message = fmt.Sprintf("Found %d changed secrets. You must revert them before the operator can continue. Secrets: %v", len(changedSecretNames), changedSecretNames)
	return event
}
func NewSecretsRestoredEvent(apiObject APIObject) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = "Secrets restored"
	event.Message = "All secrets have been restored to their original value"
	return event
}
func NewAccessPackageCreatedEvent(apiObject APIObject, apSecretName string) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = "Access package created"
	event.Message = fmt.Sprintf("An access package named %s has been created", apSecretName)
	return event
}
func NewAccessPackageDeletedEvent(apiObject APIObject, apSecretName string) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = "Access package deleted"
	event.Message = fmt.Sprintf("An access package named %s has been deleted", apSecretName)
	return event
}
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
}
func NewPlanTimeoutEvent(apiObject APIObject, itemType, memberID, role string) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = "Reconciliation Plan Timeout"
	event.Message = fmt.Sprintf("An plan item of type %s or member %s with role %s did not finish in time", itemType, memberID, role)
	return event
}
func NewPlanAbortedEvent(apiObject APIObject, itemType, memberID, role string) *Event {
	event := newDeploymentEvent(apiObject)
	event.Type = v1.EventTypeNormal
	event.Reason = "Reconciliation Plan Aborted"
	event.Message = fmt.Sprintf("An plan item of type %s or member %s with role %s wants to abort the plan", itemType, memberID, role)
	return event
}