From b2ca00e03cdb84e3661f429c49cf32e1a34810e8 Mon Sep 17 00:00:00 2001 From: erdrix Date: Tue, 23 Nov 2021 14:01:46 +0100 Subject: [PATCH 1/5] Revert "Hotfix description (#163)" This reverts commit 65671ad436c3ea0f9b93f269583a4e98288e9e3a. --- .circleci/config.yml | 2 +- api/v1alpha1/nifiparametercontext_types.go | 2 +- config/crd/bases/nifi.orange.com_nifiparametercontexts.yaml | 1 - helm/nifikop/crds/nifi.orange.com_nifiparametercontexts.yaml | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ac815cb6c..a7a3e8c22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -214,7 +214,7 @@ orbs: if [[ $(echo "$CIRCLE_BRANCH" | grep -c "pull") -gt 0 ]]; then echo "This is a PR, we don't publish to helm repo." else - CHART_VERSION=$(cat helm/nifikop/Chart.yaml| grep version | awk -F"version: " '{print $2}') GCP_SA_CREDS=${GCP_SQUIDFLOW_SBX_SA_KEY} /home/circleci/nifikop/tools/publish_helm_gcs.sh + CHART_VERSION=$(cat helm/nifikop/Chart.yaml| grep version | awk -F"version: " '{print $2}') GCP_SA_CREDS=${GCP_POC_RTC_SA_KEY} /home/circleci/nifikop/tools/publish_helm_gcs.sh fi jobs: deploy-website: diff --git a/api/v1alpha1/nifiparametercontext_types.go b/api/v1alpha1/nifiparametercontext_types.go index 565c682c0..2d04d69c0 100644 --- a/api/v1alpha1/nifiparametercontext_types.go +++ b/api/v1alpha1/nifiparametercontext_types.go @@ -41,7 +41,7 @@ type Parameter struct { // the value of the Parameter. Value *string `json:"value,omitempty"` // the description of the Parameter. - Description string `json:"description"` + Description string `json:"description,omitempty"` // Whether the parameter is sensitive or not. Sensitive bool `json:"sensitive,omitempty"` } diff --git a/config/crd/bases/nifi.orange.com_nifiparametercontexts.yaml b/config/crd/bases/nifi.orange.com_nifiparametercontexts.yaml index 98fd0ea43..5e090110a 100644 --- a/config/crd/bases/nifi.orange.com_nifiparametercontexts.yaml +++ b/config/crd/bases/nifi.orange.com_nifiparametercontexts.yaml @@ -68,7 +68,6 @@ spec: description: the value of the Parameter. type: string required: - - description - name type: object type: array diff --git a/helm/nifikop/crds/nifi.orange.com_nifiparametercontexts.yaml b/helm/nifikop/crds/nifi.orange.com_nifiparametercontexts.yaml index 98fd0ea43..5e090110a 100644 --- a/helm/nifikop/crds/nifi.orange.com_nifiparametercontexts.yaml +++ b/helm/nifikop/crds/nifi.orange.com_nifiparametercontexts.yaml @@ -68,7 +68,6 @@ spec: description: the value of the Parameter. type: string required: - - description - name type: object type: array From 757b3cfa22332b016f95317aca6eb458e6ae3f07 Mon Sep 17 00:00:00 2001 From: erdrix Date: Tue, 23 Nov 2021 14:05:42 +0100 Subject: [PATCH 2/5] clean --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a7a3e8c22..ac815cb6c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -214,7 +214,7 @@ orbs: if [[ $(echo "$CIRCLE_BRANCH" | grep -c "pull") -gt 0 ]]; then echo "This is a PR, we don't publish to helm repo." else - CHART_VERSION=$(cat helm/nifikop/Chart.yaml| grep version | awk -F"version: " '{print $2}') GCP_SA_CREDS=${GCP_POC_RTC_SA_KEY} /home/circleci/nifikop/tools/publish_helm_gcs.sh + CHART_VERSION=$(cat helm/nifikop/Chart.yaml| grep version | awk -F"version: " '{print $2}') GCP_SA_CREDS=${GCP_SQUIDFLOW_SBX_SA_KEY} /home/circleci/nifikop/tools/publish_helm_gcs.sh fi jobs: deploy-website: From 6e2b2750aa7b26acb9f9da65a107ab8570cdf75c Mon Sep 17 00:00:00 2001 From: erdrix Date: Tue, 30 Nov 2021 15:54:28 +0100 Subject: [PATCH 3/5] fix nil pointer exception case --- pkg/clientwrappers/dataflow/dataflow.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/clientwrappers/dataflow/dataflow.go b/pkg/clientwrappers/dataflow/dataflow.go index c838f1cb0..38b870c18 100644 --- a/pkg/clientwrappers/dataflow/dataflow.go +++ b/pkg/clientwrappers/dataflow/dataflow.go @@ -315,7 +315,8 @@ func SyncDataflow( updateRequest2Status(updateRequest, t) } - if err := clientwrappers.ErrorGetOperation(log, err, "Get version-request"); err != nificlient.ErrNifiClusterReturned404 || !updateRequest.Request.Complete { + if err := clientwrappers.ErrorGetOperation(log, err, "Get version-request"); err != nificlient.ErrNifiClusterReturned404 || + (updateRequest != nil && updateRequest.Request != nil && !updateRequest.Request.Complete) { if err != nil { return &flow.Status, err } From 076248accdf5f0ead81a5e460604dfc44c925f22 Mon Sep 17 00:00:00 2001 From: erdrix Date: Tue, 30 Nov 2021 15:58:18 +0100 Subject: [PATCH 4/5] append changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20edf7fa9..acc51bfe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,13 @@ ### Fixed Bugs +- [PR #167](https://github.com/Orange-OpenSource/nifikop/pull/167) - **[Operator/NiFiDataflow]** Fix nil pointer exception case whe sync Dataflow. + ## v0.7.5 ### Added -- [PR #161](https://github.com/Orange-OpenSource/nifikop/pull/162) - **[Operator/NiFiParameterContext]** Support declarative sensitive value out of secret. +- [PR #162](https://github.com/Orange-OpenSource/nifikop/pull/162) - **[Operator/NiFiParameterContext]** Support declarative sensitive value out of secret. ### Fixed Bugs From 94d296fb3bd7822d6a07dee9afe4741bbc8a649a Mon Sep 17 00:00:00 2001 From: erdrix Date: Tue, 30 Nov 2021 16:07:48 +0100 Subject: [PATCH 5/5] fix log --- controllers/nifidataflow_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/nifidataflow_controller.go b/controllers/nifidataflow_controller.go index 6f6ec6107..b9f99c569 100644 --- a/controllers/nifidataflow_controller.go +++ b/controllers/nifidataflow_controller.go @@ -443,7 +443,7 @@ func (r *NifiDataflowReconciler) Reconcile(ctx context.Context, req ctrl.Request r.Log.Info("Ensured Dataflow") r.Recorder.Event(instance, corev1.EventTypeWarning, "Reconciled", - fmt.Sprintf("Reconciled failed dataflow %s based on flow {bucketId : %s, flowId: %s, version: %s}", + fmt.Sprintf("Success fully ensured dataflow %s based on flow {bucketId : %s, flowId: %s, version: %s}", instance.Name, instance.Spec.BucketId, instance.Spec.FlowId, strconv.FormatInt(int64(*instance.Spec.FlowVersion), 10)))