-
Notifications
You must be signed in to change notification settings - Fork 271
Description
Describe the bug
aws-controllers-k8s/code-generator#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:
if resp.Crawler.Schedule != nil {
var f13 string
cr.Spec.ForProvider.Schedule = f13
} else {
cr.Spec.ForProvider.Schedule = nil
}Because Schedule is a *string and not a string, 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:
if resp.Crawler.Schedule != nil {
cr.Spec.ForProvider.Schedule = resp.Crawler.Schedule
} else {
cr.Spec.ForProvider.Schedule = nil
}Environment
- Kubernetes version N/A
- Using EKS (yes/no), if so version? N/A
- AWS service targeted (S3, RDS, etc.) glue