@@ -165,7 +165,7 @@ func SetSDK(
165165 }
166166
167167 opConfig , override := cfg .OverrideValues (op .Name )
168-
168+ fieldConfigs := cfg . ResourceFields ( r . Names . Original )
169169 for memberIndex , memberName := range inputShape .MemberNames () {
170170 if r .UnpacksAttributesMap () && memberName == "Attributes" {
171171 continue
@@ -190,6 +190,22 @@ func SetSDK(
190190 }
191191 }
192192
193+ fc , ok := fieldConfigs [memberName ]
194+ if ok && fc .IsSecret {
195+ out += fmt .Sprintf ("%sif %s.Spec.%s != nil {\n " , indent , sourceVarName , memberName )
196+ out += fmt .Sprintf ("%s%stmpSecret, err := rm.rr.SecretValueFromReference(ctx, %s.Spec.%s)\n " , indent ,
197+ indent , sourceVarName , memberName )
198+ out += fmt .Sprintf ("%s%sif err != nil {\n " , indent , indent )
199+ out += fmt .Sprintf ("%s%s%sreturn nil, err\n " , indent , indent , indent )
200+ out += fmt .Sprintf ("%s%s}\n " , indent , indent )
201+ out += fmt .Sprintf ("%s%sif tmpSecret != \" \" {\n " , indent , indent )
202+ out += fmt .Sprintf ("%s%s%s%s.Set%s(%s)\n " , indent , indent , indent ,
203+ targetVarName , memberName , "tmpSecret" )
204+ out += fmt .Sprintf ("%s%s}\n " , indent , indent )
205+ out += fmt .Sprintf ("%s}\n " , indent )
206+ continue
207+ }
208+
193209 if r .IsPrimaryARNField (memberName ) {
194210 // if ko.Status.ACKResourceMetadata != nil && ko.Status.ACKResourceMetadata.ARN != nil {
195211 // res.SetTopicArn(string(*ko.Status.ACKResourceMetadata.ARN))
0 commit comments