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

feat: add custom image commands and arguments #408

Conversation

travis-cook-sfdc
Copy link
Contributor

@travis-cook-sfdc travis-cook-sfdc commented Dec 11, 2023

Add support for customizing an image's command or arguments. In our setup, we have some custom startup & shutdown behavior that need to run before the main process starts for things like enabling / disabling networking or injecting secrets. These cannot be configured with init containers since they need to run in the same place that the main process is going to run. If command / args are empty or not present, they will be excluded from helm, allowing the default command of the image to be used

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)

Travis Cook added 2 commits December 11, 2023 12:55
Add support for customizing an image's command or arguments.  In our setup, we have
some custom startup & shutdown behavior that need to run before the main process
starts for things like enabling / disabling networking or injecting secrets.  These
cannot be configured with init containers since they need to run in the same place
that the main process is going to run.  If command / args are empty or not present,
they will be excluded from helm, allowing the default command of the image to be used
@david-leifker
Copy link
Contributor

Thanks!

@david-leifker david-leifker merged commit 6f73340 into acryldata:master Dec 11, 2023
1 check passed
travis-cook-sfdc pushed a commit to travis-cook-sfdc/datahub-helm that referenced this pull request Jan 4, 2024
Fix two issues with the custom command & args behavior
added in acryldata#408:

1. Change custom command & args to use `toRawJson` instead of
`toJson`.  Previously, this resulted in special character would
be escaped.

For example, this value:
```
args: [ "source setup.sh && /datahub/datahub-gms/scripts/start.sh" ]
```

Would get rendered as:

```
args: [ "source setup.sh \u0026\u0026 /datahub/datahub-gms/scripts/start.sh" ]
```

Use `toRawJson` to force special values to not be escaped

2. Add custom command & args to all other containers that do not
support it:
  - Datahub cleanup job
  - Datahub Nocode Migration Job
  - Datahub Restore Indices Job
  - Datahub System Update Job
  - Datahub Actions
  - Elastic Search Setup
  - Kafka Setup
  - Mysql Setup
  - Postgres setup
david-leifker pushed a commit that referenced this pull request Jan 4, 2024
* fix: fix custom command & args behavior

Fix two issues with the custom command & args behavior
added in #408:

1. Change custom command & args to use `toRawJson` instead of
`toJson`.  Previously, this resulted in special character would
be escaped.

For example, this value:
```
args: [ "source setup.sh && /datahub/datahub-gms/scripts/start.sh" ]
```

Would get rendered as:

```
args: [ "source setup.sh \u0026\u0026 /datahub/datahub-gms/scripts/start.sh" ]
```

Use `toRawJson` to force special values to not be escaped

2. Add custom command & args to all other containers that do not
support it:
  - Datahub cleanup job
  - Datahub Nocode Migration Job
  - Datahub Restore Indices Job
  - Datahub System Update Job
  - Datahub Actions
  - Elastic Search Setup
  - Kafka Setup
  - Mysql Setup
  - Postgres setup

* fix lint issues

---------

Co-authored-by: Travis Cook <[email protected]>
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.

2 participants