Skip to content

Conversation

eadasiak
Copy link
Contributor

@eadasiak eadasiak commented Mar 1, 2024

Issue aws-controllers-k8s/community#2029

Description of changes:
Fixed the reference by using varIncludeTemplate, so that the controller name is properly prefixed.

Generated ec2 controller code before:

{{/* The path the shared credentials file is mounted */}}
{{- define "ack-ec2-controller.aws.credentials.path" -}}
{{- printf "%s/%s" (include "aws.credentials.secret_mount_path" .) .Values.aws.credentials.secretKey -}}
{{- end -}}

Which resulted in:

Error: template: ec2-chart/templates/deployment.yaml:112:20: executing "ec2-chart/templates/deployment.yaml" at <include "ack-ec2-controller.aws.credentials.path" .>: error calling include: template: ec2-chart/templates/_helpers.tpl:47:20: executing "ack-ec2-controller.aws.credentials.path" at <include "aws.credentials.secret_mount_path" .>: error calling include: template: no template "aws.credentials.secret_mount_path" associated with template "gotpl"

After:

{{/* The path the shared credentials file is mounted */}}
{{- define "ack-ec2-controller.aws.credentials.path" -}}
{{ $secret_mount_path := include "ack-ec2-controller.aws.credentials.secret_mount_path" . }}
{{- printf "%s/%s" $secret_mount_path .Values.aws.credentials.secretKey -}}
{{- end -}}

Now the template renders correctly.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from a-hilaly and jljaco March 1, 2024 22:06
@ack-prow ack-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 1, 2024
Copy link

ack-prow bot commented Mar 1, 2024

Hi @eadasiak. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@a-hilaly
Copy link
Member

a-hilaly commented Mar 1, 2024

/ok-to-test

@ack-prow ack-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 1, 2024
@a-hilaly
Copy link
Member

a-hilaly commented Mar 1, 2024

/retest

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

Neat! Thank you Edward!
/approve
/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 2, 2024
Copy link

ack-prow bot commented Mar 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, eadasiak

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants