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

Updated the ConfigMap Annotation Hook #1043

Closed
wants to merge 3 commits into from
Closed

Conversation

aakash21
Copy link

The ConfigMap Annotation has been incorrectly mentioned in the values.yaml file, as https://github.com/hashicorp/vault-helm/blob/main/templates/_helpers.tpl#L462 states that it is expecting the boolean value of includeConfigAnnotation

  {{- if .Values.server.includeConfigAnnotation }}
        vault.hashicorp.com/config-checksum: {{ include "vault.config" . | sha256sum }}
  {{- end }}

Instead in values.yaml the hook has been specified as configAnnotation: false which is not being used, For Reference: https://github.com/hashicorp/vault-helm/blob/main/values.yaml#L676

After updating this value to true, the checksum annotation could be created in the Stateful Set.

annotations:
  vault.hashicorp.com/config-checksum: 3961301403b088XXXXXXXXXXX

@aakash21 aakash21 requested a review from a team as a code owner July 18, 2024 06:34
Copy link

hashicorp-cla-app bot commented Jul 18, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@tvoran tvoran added bug Something isn't working vault-server Area: operation and usage of vault server in k8s labels Jul 19, 2024
@tvoran
Copy link
Member

tvoran commented Jul 19, 2024

Good catch, thanks for opening this! Would you mind updating that option in values.schema.json as well?

We could also add a bats test to check the default value in test/unit/server-statefulset.bats; I think we can get the default value from helm show values . and parse the output with yq. If that's something you'd like to add, let us know! Otherwise we can add it in a separate PR.

@aakash21
Copy link
Author

@tvoran i have modified the schema.json but in the test/unit/server-statefulset.bats the test case for this hook is already present https://github.com/hashicorp/vault-helm/blob/main/test/unit/server-statefulset.bats#L1702

  cd `chart_dir`
  local actual=$(helm template \
      --show-only templates/server-statefulset.yaml \
      --set 'server.includeConfigAnnotation=true' \
      . | tee /dev/stderr |
      yq '.spec.template.metadata.annotations["vault.hashicorp.com/config-checksum"] == null' | tee /dev/stderr)
  [ "${actual}" = "false" ]
}```

values.yaml Outdated Show resolved Hide resolved
Co-authored-by: Michal Minář <[email protected]>
@tvoran
Copy link
Member

tvoran commented Aug 7, 2024

Looks like the parameter in values.yaml was updated as part of #1049, so I'm going to close this for now. Thanks!

@tvoran tvoran closed this Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vault-server Area: operation and usage of vault server in k8s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants