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

Add tolerations to StatefulSet #28

Closed
wants to merge 1 commit into from
Closed

Conversation

twavv
Copy link

@twavv twavv commented Sep 24, 2020

Fixes #27

{{- end }}
{{- if $root.Values.tolerations }}
tolerations:
{{ toYaml $root.Values.tolerations | indent 8 }}
Copy link
Author

Choose a reason for hiding this comment

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

This has to be unindented to make the | indent 8 work, apparently. Unsure if there's a better way to do it.

This is actually also kind of an issue for nodeSelector, but I think it would only show up if there are more than one label in the selector. If there's only one, the selector is visually overindented but still valid YAML:

    spec:
      nodeSelector:
        # should be here...
              # but is actually here
              foo: bar

Copy link
Collaborator

@bhavin192 bhavin192 Oct 5, 2020

Choose a reason for hiding this comment

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

You are right, good catch 😄 . AFAIK better would be to have something like this,

      {{- if $root.Values.tolerations }}
      tolerations:
      {{- toYaml $root.Values.tolerations | nindent 8 }}
      {{- end }}

The hyphen before toYaml will remove one line (along with our indentation). The nindent will add a new line and then indent our object by 8.

Also, as you mentioned the nodeSelector needs to be fixed.

Copy link
Collaborator

@bhavin192 bhavin192 left a comment

Choose a reason for hiding this comment

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

Can you also change the tolerations: [] from values.yaml to tolerations: {} as it's not a list.

{{- end }}
{{- if $root.Values.tolerations }}
tolerations:
{{ toYaml $root.Values.tolerations | indent 8 }}
Copy link
Collaborator

@bhavin192 bhavin192 Oct 5, 2020

Choose a reason for hiding this comment

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

You are right, good catch 😄 . AFAIK better would be to have something like this,

      {{- if $root.Values.tolerations }}
      tolerations:
      {{- toYaml $root.Values.tolerations | nindent 8 }}
      {{- end }}

The hyphen before toYaml will remove one line (along with our indentation). The nindent will add a new line and then indent our object by 8.

Also, as you mentioned the nodeSelector needs to be fixed.

@iSignal
Copy link
Contributor

iSignal commented Oct 5, 2020

Along with the changes requested by @bhavin192 , could you please add a Test Plan to the commit summary with the helm command line used to test these changes? Thanks!

@twavv twavv closed this Apr 2, 2024
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.

Tolerations is not added to chart
3 participants