-
Notifications
You must be signed in to change notification settings - Fork 29
Fix boolean parameters for download command #390
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
Conversation
| "if [ \"b$tlsAllowInsecureConnection\" = \"btrue\" ]; then export ALLOW_INSECURE=\"--tls-allow-insecure\"; fi && ", | ||
| "if [ \"b$tlsHostnameVerificationEnable\" = \"btrue\" ]; then export ENABLE_HOSTNAME_VERIFY=\"--tls-enable-hostname-verification\"; fi && ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please check https://github.com/apache/pulsar/blob/master/docker/pulsar/scripts/apply-config-from-env.py, which is contained in each runner image by default (but java and go runner image do not have python installed yet), and it should be useful to overwrite the tls / auth configs in conf/client.conf from ENV, and can be used to simplify the pulsar-admin command here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, so we need to install python in the base-runner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiangpengcheng I think it is acceptable, but it requires some work to keep the backward compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for compatibility, we may need to use shell to check whether python is installed on the runtime image which makes the command more complicated, any other advice for compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@freeznet
looks like we can use env > conf/client.conf to do similar thing, but some config names we used in configs and secrets need to be transformed when writing into the config file:
webServiceURL -> webServiceUrl
brokerServiceURL -> brokerServiceUrl
clientAuthenticationPlugin -> authPlugin
clientAuthenticationParameters -> authParams
tlsHostnameVerificationEnable -> tlsEnableHostnameVerification
for this transformation, I think we can inform users to update their configs&secrets before upgrading function-mesh, HDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiangpengcheng env > conf/client.conf needs extra commands as well right?
What do you think if we separate the package download part as an initContainer? will it solve the backward compatibility issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds perfect! but it will be a big change(needs to add an init container and volume if download path is specified?), and we still need to assemble download commands in the init container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, the file path can be extracted via .spec.java.jar / .spec.python.py / .spec.golang.go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, during development, I found that .spec.java.jar can be any value, like a raw filename without specifying dir, like pulsar-functions-api-examples.jar, then in the VolumeMounts for downloader, we need to use /pulsar(the workdir) as the MountPath? which will override everything under the workdir
|
if use init containers, we need to do follow things:
@freeznet please check |
|
@jiangpengcheng lgtm, add some thoughts below:
Lets make this task an Epic and break-down into small tasks first. |
|
suppressed by #411 |
Fixes #388
Motivation
Jcommander doesn't accept additional parameter for bool, https://jcommander.org/#_boolean
Modifications
use env when TLS related parameters are true
Verifying this change
Make sure that the change passes the CI checks.
This change is already covered by existing tests, such as (please describe tests).
Documentation
Check the box below.
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-docbug fix
doc(If this PR contains doc changes)