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(helm): add option to set resources for initHelper #865

Merged

Conversation

guilhermeoki
Copy link
Contributor

@guilhermeoki guilhermeoki commented Jul 25, 2024

Description

This PR adds an option to define resources for initHelper container.

Issues Resolved

Closes this issue #866

Check List

  • Commits are signed per the DCO using --signoff
  • Unittest added for the new/changed functionality and all unit tests are successful
  • Customer-visible features documented
  • No linter warnings (make lint)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Collaborator

@swoehrl-mw swoehrl-mw left a comment

Choose a reason for hiding this comment

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

Hi @guilhermeoki. Thank you for your contribution. Please see my inline comment.

Also, I know you only added the resources part, but could you please add the entire initHelper struct to the values.yaml of the chart to show that it is possible to set it?

Comment on lines 30 to 50
{{- if .Values.opensearchCluster.initHelper.resources }}
resources:
{{- if .Values.opensearchCluster.initHelper.resources.requests }}
requests:
{{- if .Values.opensearchCluster.initHelper.resources.requests.memory }}
memory: {{ .Values.opensearchCluster.initHelper.resources.requests.memory }}
{{- end }}
{{- if .Values.opensearchCluster.initHelper.resources.requests.cpu }}
cpu: {{ .Values.opensearchCluster.initHelper.resources.requests.cpu }}
{{- end }}
{{- end }}
{{- if .Values.opensearchCluster.initHelper.resources.limits }}
limits:
{{- if .Values.opensearchCluster.initHelper.resources.limits.memory }}
memory: {{ .Values.opensearchCluster.initHelper.resources.limits.memory }}
{{- end }}
{{- if .Values.opensearchCluster.initHelper.resources.limits.cpu }}
cpu: {{ .Values.opensearchCluster.initHelper.resources.limits.cpu }}
{{- end }}
{{- end }}
{{- end }}
Copy link
Collaborator

@swoehrl-mw swoehrl-mw Aug 7, 2024

Choose a reason for hiding this comment

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

This could be simplified like this:

{{- if .Values.opensearchCluster.initHelper.resources }}
resources:
  {{- toYaml .Values.opensearchCluster.initHelper.resources | nindent 6 }}
{{- end }}

Copy link
Contributor Author

@guilhermeoki guilhermeoki Aug 13, 2024

Choose a reason for hiding this comment

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

Also, I know you only added the resources part, but could you please add the entire initHelper struct to the values.yaml of the chart to show that it is possible to set it?

Sure! I will add the struct to the values.yaml

Copy link
Contributor Author

@guilhermeoki guilhermeoki Aug 13, 2024

Choose a reason for hiding this comment

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

This could be simplified like this:

Ok! I will simplify that part.

Copy link
Collaborator

@swoehrl-mw swoehrl-mw left a comment

Choose a reason for hiding this comment

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

LGTM.
Not sure why the test fails, when I run it locally it passes, so not a problem with your code.
I'll merge it anyway.

@swoehrl-mw swoehrl-mw merged commit 610222a into opensearch-project:main Aug 13, 2024
9 of 10 checks passed
rkthtrifork pushed a commit to trifork/opensearch-k8s-operator that referenced this pull request Aug 21, 2024
…oject#865)

### Description

This PR adds an option to define resources for initHelper container.

### Issues Resolved

Closes this issue
opensearch-project#866

### Check List
- [X] Commits are signed per the DCO using --signoff 
- [X] Unittest added for the new/changed functionality and all unit
tests are successful
- [X] Customer-visible features documented
- [X] No linter warnings (`make lint`)

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Guilherme Oki <[email protected]>
rkthtrifork pushed a commit to trifork/opensearch-k8s-operator that referenced this pull request Aug 21, 2024
…oject#865)

### Description

This PR adds an option to define resources for initHelper container.

### Issues Resolved

Closes this issue
opensearch-project#866

### Check List
- [X] Commits are signed per the DCO using --signoff 
- [X] Unittest added for the new/changed functionality and all unit
tests are successful
- [X] Customer-visible features documented
- [X] No linter warnings (`make lint`)

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Guilherme Oki <[email protected]>
rkthtrifork pushed a commit to trifork/opensearch-k8s-operator that referenced this pull request Aug 21, 2024
…oject#865)

### Description

This PR adds an option to define resources for initHelper container.

### Issues Resolved

Closes this issue
opensearch-project#866

### Check List
- [X] Commits are signed per the DCO using --signoff
- [X] Unittest added for the new/changed functionality and all unit
tests are successful
- [X] Customer-visible features documented
- [X] No linter warnings (`make lint`)

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Guilherme Oki <[email protected]>
Signed-off-by: rkthtrifork <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants