@@ -46,11 +46,13 @@ func LateInitialize(in *ecs.TaskDefinitionFamilyParameters, resp *awsecs.Describ
4646 }
4747 }
4848 if in .Volumes != nil {
49- for voli , vol := range in .Volumes {
50- awsvol := resp .TaskDefinition .Volumes [voli ]
51- if vol .Host == nil && awsvol .Host != nil {
52- vol .Host = & ecs.HostVolumeProperties {
53- SourcePath : awsvol .Host .SourcePath ,
49+ if len (in .Volumes ) == len (resp .TaskDefinition .Volumes ) {
50+ for voli , vol := range in .Volumes {
51+ awsvol := resp .TaskDefinition .Volumes [voli ]
52+ if vol .Host == nil && awsvol .Host != nil {
53+ vol .Host = & ecs.HostVolumeProperties {
54+ SourcePath : awsvol .Host .SourcePath ,
55+ }
5456 }
5557 }
5658 }
@@ -752,10 +754,16 @@ func IsUpToDate(target *ecs.TaskDefinitionFamily, out *awsecs.DescribeTaskDefini
752754 c := GenerateTaskDefinitionFamilyFromDescribe (out ).Spec .ForProvider .DeepCopy ()
753755
754756 tags := func (a , b * ecs.Tag ) bool { return aws .StringValue (a .Key ) < aws .StringValue (b .Key ) }
757+ stringpointer := func (a , b * string ) bool { return aws .StringValue (a ) < aws .StringValue (b ) }
758+ keyValuePair := func (a , b * ecs.KeyValuePair ) bool { return aws .StringValue (a .Name ) < aws .StringValue (b .Name ) }
759+ secret := func (a , b * ecs.Secret ) bool { return aws .StringValue (a .Name ) < aws .StringValue (b .Name ) }
755760
756761 diff := cmp .Diff (c , t ,
757762 cmpopts .EquateEmpty (),
758763 cmpopts .SortSlices (tags ),
764+ cmpopts .SortSlices (stringpointer ),
765+ cmpopts .SortSlices (keyValuePair ),
766+ cmpopts .SortSlices (secret ),
759767 // Not present in DescribeTaskDefinitionOutput
760768 cmpopts .IgnoreFields (ecs.TaskDefinitionFamilyParameters {}, "Region" ),
761769 cmpopts .IgnoreTypes (& xpv1.Reference {}, & xpv1.Selector {}, []xpv1.Reference {}))
0 commit comments