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

[bitnami/flux] Added Lookup Flag when Installing CRDs #28843

Closed
wants to merge 7 commits into from

Conversation

jl-beast
Copy link
Contributor

Description of the change

Added a flag to the values that allows a check to see if the CRDs already exist when installing the chart.

Benefits

Gives users more control over the install of the CRDs when installing Flux, preventing scenarios wherein you could not install flux because the CRDs already existed.

Possible drawbacks

Added Chart Complexity and Variance.

Applicable issues

Additional information

I locally tested both helm install and helm template, both with and without --dry-run=server.

I am not particularly certain what to do regarding the:
# Conditional: .Values.____.installCRDs
on the top of each CRD file, given that I added an additional if statement. Let me know if that is relevant.

Checklist

  • Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • Variables are documented in the values.yaml and added to the README.md using readme-generator-for-helm
  • Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • All commits signed off and in agreement of Developer Certificate of Origin (DCO)

bitnami-bot and others added 3 commits August 12, 2024 21:18
Signed-off-by: Bitnami Containers <[email protected]>
Signed-off-by: Bitnami Containers <[email protected]>
@javsalgar javsalgar added verify Execute verification workflow for these changes in-progress labels Aug 13, 2024
@github-actions github-actions bot removed the triage Triage is needed label Aug 13, 2024
@github-actions github-actions bot removed the request for review from javsalgar August 13, 2024 08:43
Signed-off-by: Bitnami Containers <[email protected]>
@jl-beast
Copy link
Contributor Author

Any Updates?

Copy link
Contributor

@jotamartos jotamartos left a comment

Choose a reason for hiding this comment

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

Hi @jl-beast,

Thanks for taking the time to create this PR. However, I can't accept this as the next version of the solution will overwrite your changes. There is a GitHub action that updates those crds based on the files in the upstream project. You can learn more about that here.

There are 2 options here:

  • Update the "Conditional" line to only include one single if in those crd files
  • Check how the upstream project enables that feature

jl-beast and others added 2 commits August 27, 2024 13:35
@jl-beast
Copy link
Contributor Author

@jotamartos

I have reviewed and updated the conditionals.

However, given that files may contain multiple different CRDs when downloaded from their remote release sources, this means that lookup must be attuned to selecting a particular one. For this purpose, I selected the first in file.

This does however introduce additional risk, in that, if a kubernetes clusters include "Provider", but not "Alert" (for example), then it will attempt to install nonetheless with the setting. My thought, however, is that the cluster's operations with a deleted CRD for flux should already break it for each controller. That is likely a bigger concern for the cluster operator than lookup failing on a chart.

Copy link
Contributor

@jotamartos jotamartos left a comment

Choose a reason for hiding this comment

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

Could you investigate how this is done in the upstream chart and update the templates based on that?

@@ -434,6 +434,8 @@ spec:
subresources:
status: {}
---
{{- end }}
{{- if or (not .Values.imageReflectorController.lookupCRDs) (not (lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" "" "imagerepositories.image.toolkit.fluxcd.io")) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

As I mentioned before, this will be overwritten during the next release

Copy link

This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.

@github-actions github-actions bot added the stale 15 days without activity label Sep 27, 2024
Copy link

github-actions bot commented Oct 2, 2024

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary.

@github-actions github-actions bot added the solved label Oct 2, 2024
@bitnami-bot bitnami-bot added stale 15 days without activity and removed stale 15 days without activity labels Oct 2, 2024
@bitnami-bot bitnami-bot closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flux solved stale 15 days without activity verify Execute verification workflow for these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bitnami/flux] Use Helm Lookup for CRDs
4 participants