Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy_flow_version with version=None does not deploy the latest version #326

Open
knguyen1 opened this issue May 8, 2023 · 2 comments
Open
Assignees
Milestone

Comments

@knguyen1
Copy link

knguyen1 commented May 8, 2023

  • Nipyapi version: 0.19.1
  • NiFi version: 1.20.0
  • NiFi-Registry version: 1.20.0
  • Python version: 3.8
  • Operating System: Linux

Description

Deploy a flow's latest version to a nifi instance that doesn't have the PG (first deploy).

Line 750 of versioning.py:

target_flow = target_flow[0].versioned_flow_snapshot_metadata

assumes that the returned flows are sorted descending with the latest version at index 0. This is not the case.

A better implementation would be (line 738):

target_flow = sorted(flow_versions.versioned_flow_snapshot_metadata_set, key=lambda x: x.versioned_flow_snapshot_metadata.version, reverse=True)

What I Did

nipyapi.versioning.deploy_flow_version(
        process_group_id, (0, 0), bucket_id, flow_id, registry_id
    )

Urgency

Not urgent

@Chaffelson
Copy link
Owner

Thanks for this report and suggested patch, I will include it in the next release

@Chaffelson Chaffelson self-assigned this Jul 14, 2023
@ChrisSamo632
Copy link
Contributor

#262 likely duplicate

@Chaffelson Chaffelson added this to the 0.20 milestone Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants