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 chart syntax errors #533

Merged
merged 1 commit into from
May 31, 2024

Conversation

willie-yao
Copy link
Contributor

What this PR does / why we need it:
This PR fixes a few edge cases that cause syntax errors in helm charts.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes part of #532

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 23, 2024
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 23, 2024
Copy link

netlify bot commented May 23, 2024

Deploy Preview for kubernetes-sigs-cluster-api-operator ready!

Name Link
🔨 Latest commit 92f0294
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-operator/deploys/664fcab5256acf00082721e5
😎 Deploy Preview https://deploy-preview-533--kubernetes-sigs-cluster-api-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -45,7 +45,7 @@ spec:
{{- end }}
{{- if $.Values.manager }}
manager:
{{- if $.Values.manager.featureGates.core }}
{{- if and $.Values.manager.featureGates $.Values.manager.featureGates.core }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes nil pointer exception if manager is defined but not manager.featureGates

@@ -38,15 +38,15 @@ metadata:
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
{{- if or $infrastructureVersion $.Values.configSecret.name }}
{{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes a bug where spec: is not printed when infrastructureVersion .Values.configSecret.name are not specified and Values.manager is.

spec:
{{- end }}
{{- if $infrastructureVersion }}
version: {{ $infrastructureVersion }}
{{- end }}
{{- if $.Values.manager }}
manager:
{{- if hasKey $.Values.manager.featureGates $infrastructureName }}
{{- if and (kindIs "map" $.Values.manager.featureGates) (hasKey $.Values.manager.featureGates $infrastructureName) }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes a type check error if $.Values.manager.featureGates is not specified.

Copy link
Contributor

@Fedosin Fedosin left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 24, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: dd57901978af6ad5b4553b19b357a2d5518616ac

Copy link

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

thanks a lot for fixing this

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexander-demicev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 31, 2024
@k8s-ci-robot k8s-ci-robot merged commit 7e8c9cd into kubernetes-sigs:main May 31, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants