Closed AaronME closed 2 years ago
Hi @AaronME , thanks for pointing this out.
This issue of different go types for same named field was recently fixed. Please take a look at this fix
You'll need to update generator.yaml to provide code-generator the instructions on how to handle this field. See the above mentioned fix's commit message for reference.
@vijtrip2 Thank you for the fast reply.
I had already tried running generation with the following:
resources:
Crawler:
fields:
Schedule:
set:
- on: Create
from: ScheduleExpression
- on: Update
from: ScheduleExpression
- on: ReadOne
from: ScheduleExpression
- on: ReadMany
from: ScheduleExpression
This did not change any generated code.
I have two theories about this:
2. allow different Go types for input/output shapes code-generator#232 does not affect setResourceReadMany (which is where GenerateCrawler is being generated).
Hi @AaronME! It's this second one. I will try to push a fix for this ASAP.
- allow different Go types for input/output shapes code-generator#232 does not affect setResourceReadMany (which is where GenerateCrawler is being generated).
Hi @AaronME! It's this second one. I will try to push a fix for this ASAP.
Actually, it turns out that Glue's GetCrawler (Singular form/ReadOne) is used and not the list form of GetCrawlers (ReadMany) so this must be some other problem. Looking further into it...
Yeah, it's the lack of nested struct support (list item 1 above). I'm working on a fix now.
@jaypipes I appreciate you taking a look at it.
We have similar situation in lambda.Function
where Layers
field is []*string
in CreateFunctionInput
but []*Layer
in FunctionConfiguration
which is the struct returned by CreateFunctionWithContext
.
We have similar situation in lambda.Function where Layers field is []string in CreateFunctionInput but []Layer in FunctionConfiguration which is the struct returned by CreateFunctionWithContext.
I am aware of this issue. For now our lambda controller is ignoring the Layers field. Will /cc you one the PR fixing that once it's open
@AaronME Sorry for the long delay in addressing this. I have pushed up aws-controllers-k8s/code-generator#255 to address the issue.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/close
@ack-bot: Closing this issue.
Describe the bug https://github.com/aws-controllers-k8s/code-generator/pull/232 introduced the ability to support different goTypes for input/output shapes with the same name. This code is not working for all fields on all resources.
The Crawler Resource on the Glue API exposes a field "Schedule."
In CreateCrawlerInput, "Schedule" is a string. In GetCrawlerOutput's Crawler, "Schedule" is a type Schedule.
When running this through the latest code-generator, we get the following on the
GenerateCrawler
method:Because
Schedule
is a*string
and not astring
, this code does not compile.Steps to reproduce See generated code in https://github.com/crossplane/provider-aws/blob/2212c0919ed36e8d10f7829ef939d69322766b7e/pkg/controller/glue/crawler/zz_conversions.go#L92
Expected outcome I would expect the generator to initialize this value as
nil
for a pointer:Environment