Skip to content

Commit

Permalink
Upgrade nigoapi 0.1.0 (#422)
Browse files Browse the repository at this point in the history
* Upgrade NiGoApi to v0.1.0

* Update CHANGELOG

* Update CHANGELOG

* Update HELM chart and documentation

* Update docs
  • Loading branch information
juldrixx authored May 1, 2024
1 parent 50c664a commit d7ce7f4
Show file tree
Hide file tree
Showing 29 changed files with 46 additions and 52 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [PR #415](https://github.com/konpyutaika/nifikop/pull/415) - **[Operator]** Upgrade golang to 1.22.2.
- [PR #421](https://github.com/konpyutaika/nifikop/pull/421) - **[Documentation]** Upgrade node 22.0.0.
- [PR #422](https://github.com/konpyutaika/nifikop/pull/422) - **[NiGoApi]** Upgrade NiGoApi to v0.1.0.

### Fixed Bugs

Expand All @@ -15,6 +16,8 @@

### Deprecated

- [PR #422](https://github.com/konpyutaika/nifikop/pull/422) - **[Operator/NifiCluster]** `MaximumEventDrivenThreadCount` is no longer configurable in NiFi.

### Removed

## v1.8.0
Expand Down
2 changes: 1 addition & 1 deletion api/v1/nificluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ type Node struct {
type ReadOnlyConfig struct {
// MaximumTimerDrivenThreadCount define the maximum number of threads for timer driven processors available to the system.
MaximumTimerDrivenThreadCount *int32 `json:"maximumTimerDrivenThreadCount,omitempty"`
// MaximumEventDrivenThreadCount define the maximum number of threads for event driven processors available to the system.
// MaximumEventDrivenThreadCount define the maximum number of threads for event driven processors available to the system (@DEPRECATED. This has no effect from NiFiKOp v1.9.0 or later).
MaximumEventDrivenThreadCount *int32 `json:"maximumEventDrivenThreadCount,omitempty"`
// AdditionalSharedEnvs define a set of additional env variables that will shared between all init containers and
// containers in the pod.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/imdario/mergo v0.3.14
github.com/jarcoal/httpmock v1.3.0
github.com/konpyutaika/nigoapi v0.0.10
github.com/konpyutaika/nigoapi v0.1.0
github.com/onsi/ginkgo/v2 v2.14.0
github.com/onsi/gomega v1.30.0
github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konpyutaika/nigoapi v0.0.10 h1:afyzzczUABUGfUSl7OULrcFuMSlwmwF15pNFTSweLLs=
github.com/konpyutaika/nigoapi v0.0.10/go.mod h1:tI7IUufKquth2lnB8Lk4SDPkyaXbv1DlGy5NrjuY/VU=
github.com/konpyutaika/nigoapi v0.1.0 h1:7CUNmceYZIkml5DeQUDrJFKqFbVThPESOUHsi4VwwVI=
github.com/konpyutaika/nigoapi v0.1.0/go.mod h1:KHZQsQSl2phNKOqrSp/X8y4qoep8/tKC/mTh81uEW2Y=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
Expand Down
1 change: 0 additions & 1 deletion helm/nifi-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ A Helm chart for deploying NiFi clusters in Kubernetes
| cluster.logbackConfig.replaceSecretConfig | object | `{}` | A Secret ref to override the default logback configuration see https://konpyutaika.github.io/nifikop/docs/5_references/1_nifi_cluster/2_read_only_config#logbackconfig |
| cluster.managedAdminUsers | list | `[]` | see https://konpyutaika.github.io/nifikop/docs/5_references/1_nifi_cluster#managedusers |
| cluster.managedReaderUsers | list | `[]` | see https://konpyutaika.github.io/nifikop/docs/5_references/1_nifi_cluster#managedusers |
| cluster.maximumEventDrivenThreadCount | int | `10` | MaximumEventDrivenThreadCount defines the maximum number of threads for timer driven processors available to the system. This is a feature enabled by the following PR and should not be used unless you're running nifkop with this PR applied: https://github.com/Orange-OpenSource/nifikop/pull/184 |
| cluster.maximumTimerDrivenThreadCount | int | `10` | MaximumTimerDrivenThreadCount defines the maximum number of threads for timer driven processors available to the system. |
| cluster.nameOverride | string | `"nifi-cluster"` | the full name of the cluster. This is used to set a portion of the name of various nifikop resources |
| cluster.nifiProperties | object | `{"needClientAuth":false,"overrideConfigs":"nifi.web.proxy.context.path=/nifi-cluster\n","webProxyHosts":[],"webProxyNodePorts":{"enabled":false,"hosts":[]}}` | You can override the individual properties via the overrideConfigs attribute. These will be provided to all pods via secrets. https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#system_properties |
Expand Down
3 changes: 0 additions & 3 deletions helm/nifi-cluster/templates/nifi-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ spec:
{{- if .Values.cluster.maximumTimerDrivenThreadCount }}
maximumTimerDrivenThreadCount: {{ .Values.cluster.maximumTimerDrivenThreadCount }}
{{- end }}
{{- if .Values.cluster.maximumEventDrivenThreadCount }}
maximumEventDrivenThreadCount: {{ .Values.cluster.maximumEventDrivenThreadCount }}
{{- end }}
{{- if .Values.cluster.additionalSharedEnvs }}
additionalSharedEnvs:
{{- toYaml .Values.cluster.additionalSharedEnvs | nindent 6 }}
Expand Down
3 changes: 0 additions & 3 deletions helm/nifi-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ cluster:
# -- MaximumTimerDrivenThreadCount defines the maximum number of threads for timer driven processors available to the system.
maximumTimerDrivenThreadCount: 10

# -- MaximumEventDrivenThreadCount defines the maximum number of threads for timer driven processors available to the system.
# This is a feature enabled by the following PR and should not be used unless you're running nifkop with this PR applied: https://github.com/Orange-OpenSource/nifikop/pull/184
maximumEventDrivenThreadCount: 10

# -- list of additional environment variables to attach to all init containers and the nifi container
# https://konpyutaika.github.io/nifikop/docs/5_references/1_nifi_cluster/2_read_only_config#readonlyconfig
Expand Down
4 changes: 1 addition & 3 deletions pkg/clientwrappers/controllersettings/controllersettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import (
var log = common.CustomLogger().Named("controllersettings-method")

func controllerConfigIsSync(cluster *v1.NifiCluster, entity *nigoapi.ControllerConfigurationEntity) bool {
return cluster.Spec.ReadOnlyConfig.GetMaximumTimerDrivenThreadCount() == entity.Component.MaxTimerDrivenThreadCount &&
cluster.Spec.ReadOnlyConfig.GetMaximumEventDrivenThreadCount() == entity.Component.MaxEventDrivenThreadCount
return cluster.Spec.ReadOnlyConfig.GetMaximumTimerDrivenThreadCount() == entity.Component.MaxTimerDrivenThreadCount
}

func SyncConfiguration(config *clientconfig.NifiConfig, cluster *v1.NifiCluster) error {
Expand Down Expand Up @@ -50,5 +49,4 @@ func updateControllerConfigEntity(cluster *v1.NifiCluster, entity *nigoapi.Contr
entity.Component = &nigoapi.ControllerConfigurationDto{}
}
entity.Component.MaxTimerDrivenThreadCount = cluster.Spec.ReadOnlyConfig.GetMaximumTimerDrivenThreadCount()
entity.Component.MaxEventDrivenThreadCount = cluster.Spec.ReadOnlyConfig.GetMaximumEventDrivenThreadCount()
}
4 changes: 2 additions & 2 deletions pkg/clientwrappers/registryclient/registryclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func RemoveRegistryClient(registryClient *v1.NifiRegistryClient,
func registryClientIsSync(registryClient *v1.NifiRegistryClient, entity *nigoapi.FlowRegistryClientEntity) bool {
return registryClient.Name == entity.Component.Name &&
registryClient.Spec.Description == entity.Component.Description &&
registryClient.Spec.Uri == entity.Component.Uri
registryClient.Spec.Uri == entity.Uri
}

func updateRegistryClientEntity(registryClient *v1.NifiRegistryClient, entity *nigoapi.FlowRegistryClientEntity) {
Expand All @@ -131,6 +131,6 @@ func updateRegistryClientEntity(registryClient *v1.NifiRegistryClient, entity *n

entity.Component.Name = registryClient.Name
entity.Component.Description = registryClient.Spec.Description
entity.Component.Uri = registryClient.Spec.Uri
entity.Uri = registryClient.Spec.Uri
entity.Component.Properties["url"] = registryClient.Spec.Uri
}
4 changes: 2 additions & 2 deletions pkg/nificlient/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (n *nifiClient) UpdateConnection(entity nigoapi.ConnectionEntity) (*nigoapi
}

// Request on Nifi Rest API to update the connection informations
connectionEntity, rsp, body, err := client.ConnectionsApi.UpdateConnection(context, entity.Id, entity)
connectionEntity, rsp, body, err := client.ConnectionsApi.UpdateConnection(context, entity, entity.Id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand All @@ -55,7 +55,7 @@ func (n *nifiClient) DeleteConnection(entity nigoapi.ConnectionEntity) error {
context,
entity.Id,
&nigoapi.ConnectionsApiDeleteConnectionOpts{
Version: optional.NewString(strconv.FormatInt(*entity.Revision.Version, 10)),
Version: optional.NewInterface(strconv.FormatInt(*entity.Revision.Version, 10)),
})

return errorDeleteOperation(rsp, body, err, n.log)
Expand Down
4 changes: 2 additions & 2 deletions pkg/nificlient/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (n *nifiClient) UpdateFlowControllerServices(entity nigoapi.ActivateControl
}

// Request on Nifi Rest API to enable or disable the controller services
csEntity, rsp, body, err := client.FlowApi.ActivateControllerServices(context, entity.Id, entity)
csEntity, rsp, body, err := client.FlowApi.ActivateControllerServices(context, entity, entity.Id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand All @@ -74,7 +74,7 @@ func (n *nifiClient) UpdateFlowProcessGroup(entity nigoapi.ScheduleComponentsEnt
}

// Request on Nifi Rest API to enable or disable the controller services
csEntity, rsp, body, err := client.FlowApi.ScheduleComponents(context, entity.Id, entity)
csEntity, rsp, body, err := client.FlowApi.ScheduleComponents(context, entity, entity.Id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/nificlient/flowfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (n *nifiClient) GetDropRequest(connectionId, id string) (*nigoapi.DropReque
}

// Request on Nifi Rest API to get the drop request information
dropRequest, rsp, body, err := client.FlowfileQueuesApi.GetDropRequest(context, connectionId, id)
dropRequest, rsp, body, err := client.FlowFileQueuesApi.GetDropRequest(context, connectionId, id)
if err := errorGetOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand All @@ -31,7 +31,7 @@ func (n *nifiClient) CreateDropRequest(connectionId string) (*nigoapi.DropReques
}

// Request on Nifi Rest API to create the drop Request
entity, rsp, body, err := client.FlowfileQueuesApi.CreateDropRequest(context, connectionId)
entity, rsp, body, err := client.FlowFileQueuesApi.CreateDropRequest(context, connectionId)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/nificlient/inputport.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (n *nifiClient) UpdateInputPortRunStatus(id string, entity nigoapi.PortRunS
}

// Request on Nifi Rest API to update the input port run status
processor, rsp, body, err := client.InputPortsApi.UpdateRunStatus(context, id, entity)
processor, rsp, body, err := client.InputPortsApi.UpdateRunStatus2(context, entity, id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/nificlient/outputport.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (n *nifiClient) UpdateOutputPortRunStatus(id string, entity nigoapi.PortRun
}

// Request on Nifi Rest API to update the output port run status
processor, rsp, body, err := client.OutputPortsApi.UpdateRunStatus(context, id, entity)
processor, rsp, body, err := client.OutputPortsApi.UpdateRunStatus3(context, entity, id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/nificlient/parametercontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (n *nifiClient) RemoveParameterContext(entity nigoapi.ParameterContextEntit
// Request on Nifi Rest API to remove the parameter context
_, rsp, body, err := client.ParameterContextsApi.DeleteParameterContext(context, entity.Id,
&nigoapi.ParameterContextsApiDeleteParameterContextOpts{
Version: optional.NewString(strconv.FormatInt(*entity.Revision.Version, 10)),
Version: optional.NewInterface(strconv.FormatInt(*entity.Revision.Version, 10)),
})

return errorDeleteOperation(rsp, body, err, n.log)
Expand All @@ -88,7 +88,7 @@ func (n *nifiClient) CreateParameterContextUpdateRequest(contextId string, entit
}

// Request on Nifi Rest API to create the parameter context update request
request, rsp, body, err := client.ParameterContextsApi.SubmitParameterContextUpdate(context, contextId, entity)
request, rsp, body, err := client.ParameterContextsApi.SubmitParameterContextUpdate(context, entity, contextId)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/nificlient/policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (n *nifiClient) UpdateAccessPolicy(entity nigoapi.AccessPolicyEntity) (*nig
}

// Request on Nifi Rest API to update the access policy
accessPolicyEntity, rsp, body, err := client.PoliciesApi.UpdateAccessPolicy(context, entity.Id, entity)
accessPolicyEntity, rsp, body, err := client.PoliciesApi.UpdateAccessPolicy(context, entity, entity.Id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand All @@ -80,7 +80,7 @@ func (n *nifiClient) RemoveAccessPolicy(entity nigoapi.AccessPolicyEntity) error
// Request on Nifi Rest API to remove the registry client
_, rsp, body, err := client.PoliciesApi.RemoveAccessPolicy(context, entity.Id,
&nigoapi.PoliciesApiRemoveAccessPolicyOpts{
Version: optional.NewString(strconv.FormatInt(*entity.Revision.Version, 10)),
Version: optional.NewInterface(strconv.FormatInt(*entity.Revision.Version, 10)),
})

return errorDeleteOperation(rsp, body, err, n.log)
Expand Down
8 changes: 4 additions & 4 deletions pkg/nificlient/processgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func (n *nifiClient) CreateProcessGroup(
// Request on Nifi Rest API to create the versioned process group
pgEntity, rsp, body, err := client.ProcessGroupsApi.CreateProcessGroup(
context,
pgParentId,
entity,
pgParentId,
&nigoapi.ProcessGroupsApiCreateProcessGroupOpts{ParameterContextHandlingStrategy: optional.NewString("KEEP_EXISTING")})
if err := errorCreateOperation(rsp, body, err, n.log); err != nil {
return nil, err
Expand All @@ -57,7 +57,7 @@ func (n *nifiClient) UpdateProcessGroup(entity nigoapi.ProcessGroupEntity) (*nig
}

// Request on Nifi Rest API to update the versioned process group
pgEntity, rsp, body, err := client.ProcessGroupsApi.UpdateProcessGroup(context, entity.Id, entity)
pgEntity, rsp, body, err := client.ProcessGroupsApi.UpdateProcessGroup(context, entity, entity.Id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand All @@ -78,7 +78,7 @@ func (n *nifiClient) RemoveProcessGroup(entity nigoapi.ProcessGroupEntity) error
context,
entity.Id,
&nigoapi.ProcessGroupsApiRemoveProcessGroupOpts{
Version: optional.NewString(strconv.FormatInt(*entity.Revision.Version, 10)),
Version: optional.NewInterface(strconv.FormatInt(*entity.Revision.Version, 10)),
})

return errorDeleteOperation(rsp, body, err, n.log)
Expand All @@ -93,7 +93,7 @@ func (n *nifiClient) CreateConnection(entity nigoapi.ConnectionEntity) (*nigoapi
}

// Request on Nifi Rest API to create a connection
conEntity, rsp, body, err := client.ProcessGroupsApi.CreateConnection(context, entity.Component.ParentGroupId, entity)
conEntity, rsp, body, err := client.ProcessGroupsApi.CreateConnection(context, entity, entity.Component.ParentGroupId)
if err := errorCreateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/nificlient/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (n *nifiClient) UpdateProcessorRunStatus(
}

// Request on Nifi Rest API to update the processor run status
processor, rsp, body, err := client.ProcessorsApi.UpdateRunStatus(context, id, entity)
processor, rsp, body, err := client.ProcessorsApi.UpdateRunStatus4(context, entity, id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/nificlient/registryclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (n *nifiClient) UpdateRegistryClient(entity nigoapi.FlowRegistryClientEntit
}

// Request on Nifi Rest API to update the registry client
regCliEntity, rsp, body, err := client.ControllerApi.UpdateFlowRegistryClient(context, entity.Id, entity)
regCliEntity, rsp, body, err := client.ControllerApi.UpdateFlowRegistryClient(context, entity, entity.Id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand All @@ -71,7 +71,7 @@ func (n *nifiClient) RemoveRegistryClient(entity nigoapi.FlowRegistryClientEntit
// Request on Nifi Rest API to remove the registry client
_, rsp, body, err := client.ControllerApi.DeleteFlowRegistryClient(context, entity.Id,
&nigoapi.ControllerApiDeleteFlowRegistryClientOpts{
Version: optional.NewString(strconv.FormatInt(*entity.Revision.Version, 10)),
Version: optional.NewInterface(strconv.FormatInt(*entity.Revision.Version, 10)),
})

return errorDeleteOperation(rsp, body, err, n.log)
Expand Down
2 changes: 1 addition & 1 deletion pkg/nificlient/registryclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ func MockRegistryClient(id, name, description, uri string) nigoapi.FlowRegistryC
Id: id,
Name: name,
Description: description,
Uri: uri,
},
Uri: uri,
Revision: &nigoapi.RevisionDto{Version: &version},
}
}
6 changes: 3 additions & 3 deletions pkg/nificlient/reportingtask.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (n *nifiClient) UpdateReportingTask(entity nigoapi.ReportingTaskEntity) (*n
}

// Request on Nifi Rest API to update the reporting task
out, rsp, body, err := client.ReportingTasksApi.UpdateReportingTask(context, entity.Id, entity)
out, rsp, body, err := client.ReportingTasksApi.UpdateReportingTask(context, entity, entity.Id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand All @@ -69,7 +69,7 @@ func (n *nifiClient) UpdateRunStatusReportingTask(id string, entity nigoapi.Repo
}

// Request on Nifi Rest API to update the reporting task
out, rsp, body, err := client.ReportingTasksApi.UpdateRunStatus(context, id, entity)
out, rsp, body, err := client.ReportingTasksApi.UpdateRunStatus5(context, entity, id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand All @@ -88,7 +88,7 @@ func (n *nifiClient) RemoveReportingTask(entity nigoapi.ReportingTaskEntity) err
// Request on Nifi Rest API to remove the reporting task
_, rsp, body, err := client.ReportingTasksApi.RemoveReportingTask(context, entity.Id,
&nigoapi.ReportingTasksApiRemoveReportingTaskOpts{
Version: optional.NewString(strconv.FormatInt(*entity.Revision.Version, 10)),
Version: optional.NewInterface(strconv.FormatInt(*entity.Revision.Version, 10)),
})

return errorDeleteOperation(rsp, body, err, n.log)
Expand Down
2 changes: 1 addition & 1 deletion pkg/nificlient/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (n *nifiClient) UpdateSnippet(entity nigoapi.SnippetEntity) (*nigoapi.Snipp
}

// Request on Nifi Rest API to update the snippet
snippetEntity, rsp, body, err := client.SnippetsApi.UpdateSnippet(context, entity.Snippet.Id, entity)
snippetEntity, rsp, body, err := client.SnippetsApi.UpdateSnippet(context, entity, entity.Snippet.Id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/nificlient/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (n *nifiClient) setClusterNodeStatus(nId int32, status, expectedActionStatu
targetedNode.Status = string(status)

// Request on Nifi Rest API to update the node status
nodeEntity, rsp, body, err := client.ControllerApi.UpdateNode(context, targetedNode.NodeId, nigoapi.NodeEntity{Node: targetedNode})
nodeEntity, rsp, body, err := client.ControllerApi.UpdateNode(context, nigoapi.NodeEntity{Node: targetedNode}, targetedNode.NodeId)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/nificlient/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (n *nifiClient) UpdateUser(entity nigoapi.UserEntity) (*nigoapi.UserEntity,
}

// Request on Nifi Rest API to update the user
userEntity, rsp, body, err := client.TenantsApi.UpdateUser(context, entity.Id, entity)
userEntity, rsp, body, err := client.TenantsApi.UpdateUser(context, entity, entity.Id)
if err := errorUpdateOperation(rsp, body, err, n.log); err != nil {
return nil, err
}
Expand All @@ -89,7 +89,7 @@ func (n *nifiClient) RemoveUser(entity nigoapi.UserEntity) error {
// Request on Nifi Rest API to remove the user
_, rsp, body, err := client.TenantsApi.RemoveUser(context, entity.Id,
&nigoapi.TenantsApiRemoveUserOpts{
Version: optional.NewString(strconv.FormatInt(*entity.Revision.Version, 10)),
Version: optional.NewInterface(strconv.FormatInt(*entity.Revision.Version, 10)),
})

return errorDeleteOperation(rsp, body, err, n.log)
Expand Down
Loading

0 comments on commit d7ce7f4

Please sign in to comment.