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(helm): explicitly define kind and apiVersion of volumeClaimTemplate element #7362

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Conversation

LucasVanHaaren
Copy link
Contributor

@LucasVanHaaren LucasVanHaaren commented Aug 20, 2024

Description

Hello, I made a quick fix to define explicitly all volumeClaimTemplate field.
This allows to use gitops tools (like argoCD) to sync raw k8s manifests (built via helm) with cluster resources. Without these fields defined, these will be added in the cluster resource resulting in an OutOfSync with the generated manifest.

Feel free to discuss this fix in the below linked discussion.

Related issues

Like mentionned in guidelines for contributing, I think this change is trivial. This is why I created this PR without any Issue linked.
Nevertheless, I oepened a discussion here: #7361

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@CLAassistant
Copy link

CLAassistant commented Aug 20, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@LucasVanHaaren LucasVanHaaren changed the title fix: define explicitly kind and apiVersion of volumeClaimTemplate child fix(helm): define explicitly kind and apiVersion of volumeClaimTemplate child Aug 20, 2024
@LucasVanHaaren LucasVanHaaren changed the title fix(helm): define explicitly kind and apiVersion of volumeClaimTemplate child fix(helm): explicitly define kind and apiVersion of volumeClaimTemplate child Aug 20, 2024
@LucasVanHaaren LucasVanHaaren changed the title fix(helm): explicitly define kind and apiVersion of volumeClaimTemplate child fix(helm): explicitly define kind and apiVersion of volumeClaimTemplate element Aug 20, 2024
@LucasVanHaaren
Copy link
Contributor Author

Hey @knqyf263 @simar7, what do you think about this ?

@knqyf263 knqyf263 requested review from afdesk and removed request for chen-keinan September 2, 2024 09:27
Comment on lines +20 to +21
- apiVersion: v1
kind: PersistentVolumeClaim
Copy link
Contributor

@afdesk afdesk Sep 3, 2024

Choose a reason for hiding this comment

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

If I understand correctly from the docs, PersistentVolumeClaim is created by default. so this update doesn't affect on k8s deploying.

But it seems ArgoCD tries to compare the state in the cluster with what is specified, it notices that the kind and apiVersion are not specified in one place, and it considers this a discrepancy, which leads to an "out of sync" state.

So I think It makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also it's useful if the k8s behavior will be changed.

@afdesk
Copy link
Contributor

afdesk commented Sep 3, 2024

@LucasVanHaaren thanks for your contribution! LGTM!

@knqyf263 knqyf263 added this pull request to the merge queue Sep 3, 2024
Merged via the queue into aquasecurity:main with commit da4ebfa Sep 3, 2024
18 checks passed
@aqua-bot aqua-bot mentioned this pull request Sep 2, 2024
@LucasVanHaaren
Copy link
Contributor Author

Hello, thanks for merging it!

I just noticed that no new chart versions have been released with this modification.
Do you plan to release a new revision of the helm chart with only this one or you wait for other fixes before releasing?

@afdesk
Copy link
Contributor

afdesk commented Sep 4, 2024

I just noticed that no new chart versions have been released with this modification. Do you plan to release a new revision of the helm chart with only this one or you wait for other fixes before releasing?

oh, It's my mistake. I'll think over and update the helm version soon.
thanks

@rverchere
Copy link

@LucasVanHaaren FYI, it's a more generic issue with all Statefulsets using PVC Templates, see argoproj/argo-cd#11143.

As a workaround, you can add annotation argocd.argoproj.io/compare-options: ServerSideDiff=true.

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.

5 participants