func()

in operator/apis/operator/v1alpha1/storage_webhook.go [50:66]


func (r *Storage) Default(_ context.Context, o runtime.Object) error {
	storage, ok := o.(*Storage)
	if !ok {
		return apierrors.NewBadRequest("object is not a Storage")
	}

	storagelog.Info("default", "name", storage.Name)
	if storage.Spec.ConnectType == "internal" {
		if storage.Spec.Image == "" {
			storage.Spec.Image = "docker.elastic.co/elasticsearch/elasticsearch:7.5.1"
		}
		if storage.Spec.Instances == 0 {
			storage.Spec.Instances = 3
		}
	}
	return nil
}