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

Commit

Permalink
[Fix/ParameterContext] Support optional parametere context and empty …
Browse files Browse the repository at this point in the history
…slice parameters (#157)

* fix operator metrics configuration

* append changelog

* fix optinal parameter context and support empty array for parameter context

* bump version and append changelog
  • Loading branch information
erdrix authored Nov 12, 2021
1 parent 4684da5 commit de9c802
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 26 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@

### Fixed Bugs

- [PR #156](https://github.com/Orange-OpenSource/nifikop/pull/156) - **[Helm chart]** Operator metrics port configuration
## v0.7.3

### Fixed Bugs

- [PR #156](https://github.com/Orange-OpenSource/nifikop/pull/156) - **[Helm chart]** Operator metrics port configuration.
- [PR #157](https://github.com/Orange-OpenSource/nifikop/pull/157) - **[Operator/NiFiParameterContext]** Support optional parametere context and empty slice.

## v0.7.2

Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- /manager
args:
- --leader-elect
image: orangeopensource/nifikop:v0.7.2-release
image: orangeopensource/nifikop:v0.7.3-release
name: nifikop
securityContext:
allowPrivilegeEscalation: false
Expand Down
14 changes: 10 additions & 4 deletions controllers/nifidataflow_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,23 @@ func (r *NifiDataflowReconciler) Reconcile(ctx context.Context, req ctrl.Request
}

// Check if cluster references are the same
var clusterRefs []v1alpha1.ClusterReference

registryClusterRef := registryClient.Spec.ClusterRef
registryClusterRef.Namespace = registryClientNamespace
clusterRefs = append(clusterRefs, registryClusterRef)

parameterContextClusterRef := parameterContext.Spec.ClusterRef
parameterContextClusterRef.Namespace = parameterContextNamespace
if parameterContext !=nil {
parameterContextClusterRef := parameterContext.Spec.ClusterRef
parameterContextClusterRef.Namespace = parameterContextNamespace
clusterRefs = append(clusterRefs, parameterContextClusterRef)
}

currentClusterRef := current.Spec.ClusterRef
currentClusterRef.Namespace = GetClusterRefNamespace(current.Namespace, current.Spec.ClusterRef)
clusterRefs = append(clusterRefs, currentClusterRef)

if !v1alpha1.ClusterRefsEquals(
[]v1alpha1.ClusterReference{registryClusterRef, parameterContextClusterRef, currentClusterRef}) {
if !v1alpha1.ClusterRefsEquals(clusterRefs) {

r.Recorder.Event(instance, corev1.EventTypeWarning, "ReferenceClusterError",
fmt.Sprintf("Failed to lookup reference cluster : %s in %s",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/antihax/optional v1.0.0
github.com/banzaicloud/k8s-objectmatcher v1.4.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/erdrix/nigoapi v0.0.0-20211026131235-b258e0b217af
github.com/erdrix/nigoapi v0.0.0-20211112150537-d8047033a68a
github.com/go-logr/logr v0.3.0
github.com/imdario/mergo v0.3.10
github.com/jarcoal/httpmock v1.0.6
Expand Down
12 changes: 2 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,8 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/erdrix/nigoapi v0.0.0-20210420154406-e2cc6c207bc8 h1:i8dQxETjo7Dn+lkstq/0BwnQxhbuT63jrQNtvul1naI=
github.com/erdrix/nigoapi v0.0.0-20210420154406-e2cc6c207bc8/go.mod h1:owY+8fs8YXnST3ENM+ulVllYjTbzGaqKA+Y7HHJ0lZA=
github.com/erdrix/nigoapi v0.0.0-20211026102428-b2c05eaea34d h1:MZ+ZpxaWLA3kCt1T3KZPpN6TRrebDksfDhm8p2Qjvy8=
github.com/erdrix/nigoapi v0.0.0-20211026102428-b2c05eaea34d/go.mod h1:owY+8fs8YXnST3ENM+ulVllYjTbzGaqKA+Y7HHJ0lZA=
github.com/erdrix/nigoapi v0.0.0-20211026105001-8b40a035361c h1:/oOkNDKFoBcdNbEaI0VNsIjR/znibLb8zXl8AtSzjHg=
github.com/erdrix/nigoapi v0.0.0-20211026105001-8b40a035361c/go.mod h1:owY+8fs8YXnST3ENM+ulVllYjTbzGaqKA+Y7HHJ0lZA=
github.com/erdrix/nigoapi v0.0.0-20211026110358-9bf3bfa29e46 h1:KshP0euoy8R3aVWgjJg0Zuk0TsO4Lbt/k/FvfVQneTo=
github.com/erdrix/nigoapi v0.0.0-20211026110358-9bf3bfa29e46/go.mod h1:owY+8fs8YXnST3ENM+ulVllYjTbzGaqKA+Y7HHJ0lZA=
github.com/erdrix/nigoapi v0.0.0-20211026131235-b258e0b217af h1:0t7jHTzu/UDzZqpgQKiCdQJ1JADPamrl2HMlWCuxRMQ=
github.com/erdrix/nigoapi v0.0.0-20211026131235-b258e0b217af/go.mod h1:owY+8fs8YXnST3ENM+ulVllYjTbzGaqKA+Y7HHJ0lZA=
github.com/erdrix/nigoapi v0.0.0-20211112150537-d8047033a68a h1:isV4zYi8OKvV7XK4tPDJQ+i383uDZ/wTqzjqAMu/FpM=
github.com/erdrix/nigoapi v0.0.0-20211112150537-d8047033a68a/go.mod h1:owY+8fs8YXnST3ENM+ulVllYjTbzGaqKA+Y7HHJ0lZA=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=
Expand Down
4 changes: 2 additions & 2 deletions helm/nifikop/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: nifikop
home: https://github.com/Orange-OpenSource/nifikop
sources:
- https://github.com/Orange-OpenSource/nifikop
version: 0.7.2
appVersion: 0.7.2-release
version: 0.7.3
appVersion: 0.7.3-release
icon:
maintainers:
- name: erdrix
Expand Down
2 changes: 1 addition & 1 deletion helm/nifikop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The following tables lists the configurable parameters of the NiFi Operator Helm
| Parameter | Description | Default |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
| `image.repository` | Image | `orangeopensource/nifikop` |
| `image.tag` | Image tag | `v0.7.2-release` |
| `image.tag` | Image tag | `v0.7.3-release` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `image.imagePullSecrets.enabled` | Enable tue use of secret for docker image | `false` |
| `image.imagePullSecrets.name` | Name of the secret to connect to docker registry | - |
Expand Down
2 changes: 1 addition & 1 deletion helm/nifikop/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
image:
repository: orangeopensource/nifikop
tag: v0.7.2-release
tag: v0.7.3-release
pullPolicy: Always
imagePullSecrets:
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion pkg/clientwrappers/parametercontext/parametercontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func updateParameterContextEntity(parameterContext *v1alpha1.NifiParameterContex
entity.Component = &nigoapi.ParameterContextDto{}
}

var parameters []nigoapi.ParameterEntity
parameters := make([]nigoapi.ParameterEntity, 0)

for _, secret := range parameterSecrets {
for k, v := range secret.Data {
Expand Down
4 changes: 2 additions & 2 deletions site/docs/2_setup/1_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Now deploy the helm chart :
helm install nifikop \
orange-incubator/nifikop \
--namespace=nifi \
--version 0.7.2 \
--set image.tag=v0.7.2-release \
--version 0.7.3 \
--set image.tag=v0.7.3-release \
--set resources.requests.memory=256Mi \
--set resources.requests.cpu=250m \
--set resources.limits.memory=256Mi \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The following tables lists the configurable parameters of the NiFi Operator Helm
| Parameter | Description | Default |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
| `image.repository` | Image | `orangeopensource/nifikop` |
| `image.tag` | Image tag | `v0.7.2-release` |
| `image.tag` | Image tag | `v0.7.3-release` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `image.imagePullSecrets.enabled` | Enable tue use of secret for docker image | `false` |
| `image.imagePullSecrets.name` | Name of the secret to connect to docker registry | - |
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package version

var (
Version = "0.7.2"
Version = "0.7.3"
)

0 comments on commit de9c802

Please sign in to comment.