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

[fix][broker] fix Update contains no change error when use --update-auth-data flag to update function/sink/source #19450

Merged
merged 3 commits into from
Jun 13, 2023

Conversation

labuladong
Copy link
Contributor

@labuladong labuladong commented Feb 7, 2023

Fixes #19375

Modifications

When --update-auth-data is set to true, always update the data, even if the config is identical.

The key fix is changing

if (existingFunctionConfig.equals(mergedConfig) && isBlank(functionPkgUrl) && uploadedInputStream == null) {
            throw new RestException(Response.Status.BAD_REQUEST, "Update contains no change");
}

to

if (existingFunctionConfig.equals(mergedConfig) && isBlank(functionPkgUrl) && uploadedInputStream == null
                && (updateOptions == null || !updateOptions.isUpdateAuthData())) {
            throw new RestException(Response.Status.BAD_REQUEST, "Update contains no change");
}

For both function, source and sink.

Other modifications are test cases.

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: labuladong#21

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 7, 2023
@github-actions
Copy link

The pr had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Mar 10, 2023
Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your contribution!

@tisonkun tisonkun requested a review from nlu90 June 13, 2023 04:56
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@tisonkun
Copy link
Member

Merging...

@tisonkun tisonkun merged commit 2b92ed1 into apache:master Jun 13, 2023
43 checks passed
@tisonkun tisonkun added this to the 3.1.0 milestone Jun 13, 2023
lhotari pushed a commit that referenced this pull request Feb 26, 2024
…e-auth-data` flag to update function/sink/source (#19450)

Co-authored-by: tison <wander4096@gmail.com>
(cherry picked from commit 2b92ed1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug][pulsar-functions][worker] --update-auth-data fails if Config is identical
4 participants