Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Add event on registry client reference error #191

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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

### Added

- [PR #191](https://github.com/Orange-OpenSource/nifikop/pull/191) - **[Operator/NiFiDataflow]** Add event on registry client reference error.

### Changed

- [PR #188](https://github.com/Orange-OpenSource/nifikop/pull/188) - **[Operator/NiFiCluster]** Support all pod status as terminating if the pod phase is `failed`.

### Deprecated

### Removed

### Fixed Bugs

- [PR #167](https://github.com/Orange-OpenSource/nifikop/pull/167) - **[Operator/NiFiDataflow]** Fix nil pointer exception case whe sync Dataflow.
- [PR #188](https://github.com/Orange-OpenSource/nifikop/pull/188) - **[Operator/NiFiCluster]** Support all pod status as terminating if the pod phase is `failed`.
- [PR #189](https://github.com/Orange-OpenSource/nifikop/pull/189) - **[Operator/NiFiParameterContext]** Fix nil pointer exception case on empty description.

## v0.7.5
Expand Down
13 changes: 9 additions & 4 deletions controllers/nifidataflow_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ package controllers

import (
"context"
"emperror.dev/errors"
"encoding/json"
"fmt"
"reflect"
"strconv"
"time"

"emperror.dev/errors"
"github.com/Orange-OpenSource/nifikop/pkg/clientwrappers/dataflow"
"github.com/Orange-OpenSource/nifikop/pkg/errorfactory"
"github.com/Orange-OpenSource/nifikop/pkg/k8sutil"
Expand All @@ -31,10 +35,7 @@ import (
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/client-go/tools/record"
"reflect"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"strconv"
"time"

"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -125,6 +126,10 @@ func (r *NifiDataflowReconciler) Reconcile(ctx context.Context, req ctrl.Request
return Reconciled()
}

r.Recorder.Event(instance, corev1.EventTypeWarning, "ReferenceRegistryClientError",
fmt.Sprintf("Failed to lookup reference registry client : %s in %s",
current.Spec.RegistryClientRef.Name, registryClientNamespace))

// the cluster does not exist - should have been caught pre-flight
return RequeueWithError(r.Log, "failed to lookup referenced registry client", err)
}
Expand Down