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(mysql-setup-job): add mysql default port override support #5036

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

mmmeeedddsss
Copy link
Contributor

Mysql setup job is given with a port override to use from helm charts but the job itself does not read that variable. Due to this, it is not possible to setup a MySQL DB if your cluster is serving from a port other than 3306(which is the default port of MySQL)

In this pr, I'm adding the port parameter, which should be already present when using helm charts, to the mysql-setup-job's connection parameters.

There is also an issue with the documentation of the port parameter for the MySQL. This is also handled in this pr

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

(($MYSQL_PORT)) || port="3306"
Copy link
Contributor Author

@mmmeeedddsss mmmeeedddsss May 28, 2022

Choose a reason for hiding this comment

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

I am not sure if this line is required or not. In the helm charts, the port param is defined and passed to this task.
See definition
See the env var passed to this job

Still, I couldn't be sure about the other deployment flows of datahub other then using helm. Also considering that the port param was not mentioned in the docs too, I thought it might be better to add a default value to here would be better instead of having an if statement and have two versions of the command mysql ... with -P and without it. Or should we just omit the possibility of this variable being undefined? WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you try switching to bash by changing line 1 to #!/bin/bash
and then use this syntax to set defaults? https://github.com/datahub-project/datahub/blob/master/docker/kafka-setup/kafka-setup.sh#L2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice suggestion, did it your way @dexter-mh-lee !
Could you take a look once again please?

Copy link
Contributor

@dexter-mh-lee dexter-mh-lee 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 the contribution!!

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

Successfully merging this pull request may close these issues.

3 participants