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

Pass Template object through to generated systemd unit values #357

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

glitchcrab
Copy link
Member

@glitchcrab glitchcrab commented Oct 3, 2024

What does this PR do?

Passes the root Template object into the generated dictionary used to template the systemd additionalFields value out.

What is the effect of this change to users?

None, this is required to pass CI tests (ABS chart linting)

How does it look like?

N/A

Any background context you can provide?

Provider charts template out successfully locally, however when the chart linting steps are carried out in CI (on the provider chart), they fail with the following error:

[ERROR] templates/: template: cluster-cloud-director/charts/cluster/templates/clusterapi/workers/machinedeployment.yaml:38:79: executing "cluster-cloud-director/charts/cluster/templates/clusterapi/workers/machinedeployment.yaml" at <include "cluster.internal.workers.kubeadmConfig.spec.hash" $>: error calling include: template: cluster-cloud-director/charts/cluster/templates/clusterapi/workers/_helpers.tpl:2:12: executing "cluster.internal.workers.kubeadmConfig.spec.hash" at <include "cluster.internal.workers.kubeadmConfig.spec" $>: error calling include: template: cluster-cloud-director/charts/cluster/templates/clusterapi/workers/_helpers.tpl:8:6: executing "cluster.internal.workers.kubeadmConfig.spec" at <include "cluster.internal.workers.kubeadm.ignition" $>: error calling include: template: cluster-cloud-director/charts/cluster/templates/clusterapi/workers/_helpers_flatcar.tpl:8:10: executing "cluster.internal.workers.kubeadm.ignition" at <include "cluster.internal.workers.kubeadm.ignition.containerLinuxConfig.additionalConfig.systemd.units" $>: error calling include: template: cluster-cloud-director/charts/cluster/templates/clusterapi/workers/_helpers_flatcar.tpl:20:4: executing "cluster.internal.workers.kubeadm.ignition.containerLinuxConfig.additionalConfig.systemd.units" at <include "cluster.internal.kubeadm.ignition.containerLinuxConfig.additionalConfig.systemd.units" $systemdUnitValues>: error calling include: template: cluster-cloud-director/charts/cluster/templates/clusterapi/_helpers_flatcar.tpl:76:7: executing "cluster.internal.kubeadm.ignition.containerLinuxConfig.additionalConfig.systemd.units" at <tpl .contents.service.additionalFields $>: error calling tpl: cannot retrieve Template.Basepath from values inside tpl function: {{- if $.global.connectivity.network.staticRoutes }}
ExecStart=/usr/bin/bash -cv 'sleep 3'
{{- range $.global.connectivity.network.staticRoutes }}
ExecStart=/usr/bin/bash -cv 'ip route add {{ .destination }} via {{ .via }}'
{{- end }}
{{- end }}: "BasePath" is not a value

What is needed from the reviewers?

Do the docs need to be updated?

Should this change be mentioned in the release notes?

  • CHANGELOG.md has been updated (if it exists)

@taylorbot
Copy link
Contributor

Hey @glitchcrab, a test pull request has been created for you in the cluster-aws repo! Go to pull request giantswarm/cluster-aws#884 in order to test your cluster chart changes on AWS.

@glitchcrab glitchcrab changed the title WIP: Passed Template object through to generated systemd unit values Pass Template object through to generated systemd unit values Oct 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

There were no differences in the rendered Helm template.

Output
=== Differences when rendered with values file helm/cluster/ci/test-required-values.yaml ===

No difference


=== Differences when rendered with values file helm/cluster/ci/test-zot-mc-and-local-values.yaml ===

No difference


=== Differences when rendered with values file helm/cluster/ci/test-zot-mc-values.yaml ===

No difference


=== Differences when rendered with values file helm/cluster/ci/test-zot-only-local-values.yaml ===

No difference


=== No differences at all ===

@glitchcrab glitchcrab marked this pull request as ready for review October 3, 2024 13:48
@glitchcrab glitchcrab requested a review from a team as a code owner October 3, 2024 13:48
@glitchcrab glitchcrab merged commit 1cd7f2c into main Oct 3, 2024
13 checks passed
@glitchcrab glitchcrab deleted the fix/systemd-templating branch October 3, 2024 14:44
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.

3 participants