func (o *Operator) onAddArangoDeployment(obj interface{}) {
	o.Dependencies.LivenessProbe.Lock()
	defer o.Dependencies.LivenessProbe.Unlock()
	apiObject := obj.(*api.ArangoDeployment)
	o.log.Debug().
		Str("name", apiObject.GetObjectMeta().GetName()).
		Msg("ArangoDeployment added")
	o.syncArangoDeployment(apiObject)
}
onAddArangoDeployment deployment addition callback
package operator
import (
	deploymentType "github.com/arangodb/kube-arangodb/pkg/apis/deployment"
	"github.com/arangodb/kube-arangodb/pkg/logging"
	"github.com/arangodb/kube-arangodb/pkg/util/errors"
	kwatch "k8s.io/apimachinery/pkg/watch"
	"k8s.io/client-go/tools/cache"
	api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
	"github.com/arangodb/kube-arangodb/pkg/deployment"
	"github.com/arangodb/kube-arangodb/pkg/metrics"
	"github.com/arangodb/kube-arangodb/pkg/util/k8sutil"
)
var (
	deploymentsCreated  = metrics.MustRegisterCounter("controller", "deployments_created", "Number of deployments that have been created")
	deploymentsDeleted  = metrics.MustRegisterCounter("controller", "deployments_deleted", "Number of deployments that have been deleted")
	deploymentsFailed   = metrics.MustRegisterCounter("controller", "deployments_failed", "Number of deployments that have failed")
	deploymentsModified = metrics.MustRegisterCounter("controller", "deployments_modified", "Number of deployment modifications")
	deploymentsCurrent  = metrics.MustRegisterGauge("controller", "deployments", "Number of deployments currently being managed")
)
func (o *Operator) runDeployments(stop <-chan struct{}) {
	rw := k8sutil.NewResourceWatcher(
		o.log,
		o.Dependencies.CRCli.DatabaseV1().RESTClient(),
		deploymentType.ArangoDeploymentResourcePlural,
		o.Config.Namespace,
		&api.ArangoDeployment{},
		cache.ResourceEventHandlerFuncs{
			AddFunc:    o.onAddArangoDeployment,
			UpdateFunc: o.onUpdateArangoDeployment,
			DeleteFunc: o.onDeleteArangoDeployment,
		})
	o.Dependencies.DeploymentProbe.SetReady()
	rw.Run(stop)
}