WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@nicdumz
Copy link
Contributor

@nicdumz nicdumz commented Dec 5, 2025

Calling a templating method on resources means that the resource object currently means that Resources need to be aware of template locations, filesystem considerations, and in the future fs.FS objects.

On the other hand if we move this to the google package, those "global" template functions will have a way to pass through fs.FS objects.

Before removing the CustomTemplate method from Resource and Type, I've also double-checked that our private overrides do not use these.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

Calling a templating method on resources means that the resource object currently means that Resources need to be aware of template locations, filesystem considerations, and in the future `fs.FS` objects.

On the other hand if we move this to the `google` package, those "global" template functions will have a way to pass through `fs.FS` objects.

Before removing the `CustomTemplate` method from Resource and Type, I've also double-checked that our private overrides do not use these.

Note that I'm forced to change Resource.HasLabelsField and remove the pointer: without this I get a `F1205 17:17:34.717325  328294 template_data.go:335] error executing resource.go.tmpl for filepath ${override}/services/compute/resource_compute_address.go template: resource.go.tmpl:442:8: executing "resource.go.tmpl" at <customTemplate $ $.CustomCode.PostCreate false>: error calling customTemplate: template: labels.tmpl:1:8: executing "labels.tmpl" at <$.HasLabelsField>: can't evaluate field HasLabelsField in type api.Resource` error.
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

terraform-google-conversion: Diff ( 1 file changed, 1 deletion(-))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

terraform-google-conversion: Diff ( 1 file changed, 1 deletion(-))

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.

2 participants