Skip to content

Conversation

@HuangZhenQiu
Copy link
Contributor

@HuangZhenQiu HuangZhenQiu commented Sep 21, 2022

What is the purpose of the change

Remove operator related configs from flink runtime config, so that users will not see any operator related config in web ui.

Brief change log

  • remove operator configs before deployments in Flink services.

Verifying this change

This change is a trivial rework / code cleanup with unit test coverage.

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

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changes to the CustomResourceDescriptors: (no)
  • Core observer or reconciler logic that is regularly executed: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

@flinkbot
Copy link
Collaborator

flinkbot commented Sep 21, 2022

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Comment on lines +51 to +53
(res.status == HttpStatusCode.MovedPermanently ||
res.status == HttpStatusCode.TemporaryRedirect ||
res.status == HttpStatusCode.SeeOther) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I've taken a look at the RFC and it lists multiple 3xx codes. Just wondering how did you picked the listed codes?
Screen Shot 2022-09-21 at 18 19 59

Copy link
Contributor Author

@HuangZhenQiu HuangZhenQiu Sep 21, 2022

Choose a reason for hiding this comment

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

The code path is mainly to fetching job metadata. Multiple Choices, Use Proxy, Unused are not fit for the scenarios or data type. But I am open to add more status code to make it more robust.

Copy link
Contributor

Choose a reason for hiding this comment

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

Starting an image build and then coming back here w/ an in-depth consideration from my side...

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking about to add 302 Found but that's optional which is denoted w/ the MAY keyword in the documentation:
Screen Shot 2022-09-23 at 10 10 44
It's good as-is from my perspective.

@gaborgsomogyi
Copy link
Contributor

I've started to build an image to test the feature end-t-end. Let's see how it goes...
Additionally plz change the heading which is Flink PR compliant: [FLINK-29363][runtime-web] ...

@gaborgsomogyi
Copy link
Contributor

@flinkbot run azure

@HuangZhenQiu HuangZhenQiu changed the title (FLINK-29363) allow fully redirection in web dashboard [FLINK-29363][runtime-web] allow fully redirection in web dashboard Sep 22, 2022
@gaborgsomogyi
Copy link
Contributor

I presume a rebase to the latest master is needed since second time the following error arrived:

Sep 22 08:19:47 	Suppressed: java.lang.AssertionError: Test failed Error while running command to get file permissions : java.io.IOException: Cannot run program "ls": error=1, Operation not permitted

@rmetzger
Copy link
Contributor

rmetzger commented Sep 27, 2022

Yes, this issue with ls is a known build failure.

@gaborgsomogyi thanks a lot for the review. Lmk once you've approved the PR, I'll then take a look and merge it.

@gaborgsomogyi
Copy link
Contributor

@rmetzger thanks for the help in advance!
I think the current change set is not going to work with same-origin policy.
Let's hear what @HuangZhenQiu thinks about this.

@HuangZhenQiu
Copy link
Contributor Author

@gaborgsomogyi @rmetzger

Let's say proxy server is served in domain A. If the token/cookie times out, requests need to be redirected to domain B. In this case, Users need to configure CSP and CORS as below for security considerations.
For the security considerations, users need to set

Content-Security-Policy: sandbox, allow-form, allow-scripts, allow-same-origin
Access-Control-Allow-Origin: A, B

CSP guarantee the app runs in an isolated environment and also make sure cookies are attached to request to the allowed domain. Putting B in the Access-Control-Allow-Origin will make the redirection work, otherwise the redirection will be blocked by browser due to the cross origin access.

@gaborgsomogyi
Copy link
Contributor

If I understand it correctly then the proxy would add CORS, right? If we can test it in a real environment then I'm fine w/ the actual code.

@gaborgsomogyi
Copy link
Contributor

I've tested it manually on live cluster and it works.
@HuangZhenQiu could you do a rebase to the latest master where tests are more stable?

Copy link
Contributor

@gaborgsomogyi gaborgsomogyi left a comment

Choose a reason for hiding this comment

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

LGTM. Only green unit tests needed.

@rmetzger
Copy link
Contributor

Thanks for manually testing it.

@rmetzger
Copy link
Contributor

rmetzger commented Nov 24, 2022

A rebase would be nice just to make sure there haven't been major changes on the UI side since September.

@gaborgsomogyi
Copy link
Contributor

@rmetzger now it's all green and good to go :)

@wanglijie95
Copy link
Contributor

Hi all, what's the current status of this PR? Looks like it's ready to be merged, but hasn't been merged

@gaborgsomogyi
Copy link
Contributor

You see it well...

@rmetzger
Copy link
Contributor

rmetzger commented Jan 2, 2023

Merging change ...

@rmetzger rmetzger closed this in ded2df5 Jan 2, 2023
chucheng92 pushed a commit to chucheng92/flink that referenced this pull request Feb 3, 2023
akkinenivijay pushed a commit to krisnaru/flink that referenced this pull request Feb 11, 2023
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.

5 participants