diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index fe05df36..d1cef7f4 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,5 +1,5 @@ ack_generate_info: - build_date: "2024-04-18T22:18:38Z" + build_date: "2024-04-23T20:03:09Z" build_hash: 37f4ba2b5a121a8786bc516e9ec4aa0b8b590c7d go_version: go1.21.6 version: v0.33.0-1-g37f4ba2 diff --git a/pkg/resource/function/sdk.go b/pkg/resource/function/sdk.go index a803972e..d0abbcf7 100644 --- a/pkg/resource/function/sdk.go +++ b/pkg/resource/function/sdk.go @@ -358,12 +358,6 @@ func (rm *resourceManager) sdkFind( rm.setStatusDefaults(ko) if resp.Code != nil { - // We need to keep the desired .Code s3Bucket s3Key and s3ObjectVersion - // part of the function's spec. So instead of setting Spec.Code to nil - // we only set ImageURI - // - // When adopting a Function resource, Spec.Code field should be manually - // initialised before injecting ImageURI. if ko.Spec.Code == nil { ko.Spec.Code = &svcapitypes.FunctionCode{} } @@ -373,7 +367,7 @@ func (rm *resourceManager) sdkFind( } if resp.Configuration.Layers != nil { f16 := []*svcapitypes.Layer{} - f := []*string{} + layer := []*string{} for _, f16iter := range resp.Configuration.Layers { f16elem := &svcapitypes.Layer{} if f16iter.Arn != nil { @@ -389,9 +383,9 @@ func (rm *resourceManager) sdkFind( f16elem.SigningProfileVersionARN = f16iter.SigningProfileVersionArn } f16 = append(f16, f16elem) - f = append(f, f16iter.Arn) + layer = append(layer, f16iter.Arn) } - ko.Spec.Layers = f + ko.Spec.Layers = layer ko.Status.LayerStatuses = f16 } else { ko.Status.LayerStatuses = nil diff --git a/templates/hooks/function/sdk_read_one_post_set_output.go.tpl b/templates/hooks/function/sdk_read_one_post_set_output.go.tpl index 2b7b2639..47c9c1d1 100644 --- a/templates/hooks/function/sdk_read_one_post_set_output.go.tpl +++ b/templates/hooks/function/sdk_read_one_post_set_output.go.tpl @@ -7,7 +7,7 @@ } } if resp.Configuration.Layers != nil { - f17 := []*svcapitypes.Layer{} + f16 := []*svcapitypes.Layer{} layer := []*string{} for _, f16iter := range resp.Configuration.Layers { f16elem := &svcapitypes.Layer{}