Skip to content

Commit b55ae87

Browse files
Revert "Correct the generated code for nested parent field reference." (#398)
Fixes aws-controllers-k8s/community#1653 Reverts #369 This pull request introduced a change to the way lists of references were accessed, but incorrectly falls back on a conditional that will treat a list of references as a struct. This breaks the `ec2` and `rds` controllers.
1 parent 931c99c commit b55ae87

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

templates/pkg/resource/references.go.tpl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,6 @@ func resolveReferenceFor{{ $field.FieldPathWithUnderscore }}(
143143
}
144144
return nil
145145
}
146-
{{ else if not $isList -}}
147-
if ko.Spec.{{ $field.ReferenceFieldPath }} != nil &&
148-
ko.Spec.{{ $field.ReferenceFieldPath }}.From != nil {
149-
arr := ko.Spec.{{ $field.ReferenceFieldPath }}.From
150-
{{ template "read_referenced_resource_and_validate" $field }}
151-
referencedValue := string(*obj.{{ $field.FieldConfig.References.Path }})
152-
ko.Spec.{{ $field.Path }} = &referencedValue
153-
}
154-
return nil
155-
}
156146
{{ else }}
157147
{{ $parentField := index .CRD.Fields $fp.String }}
158148
{{ if eq $parentField.ShapeRef.Shape.Type "list" -}}

0 commit comments

Comments
 (0)