diff --git a/pkg/clients/ecs/taskdefinitionfamily/task_definition_family.go b/pkg/clients/ecs/taskdefinitionfamily/task_definition_family.go index f34ac6b9b6..d6876517a0 100644 --- a/pkg/clients/ecs/taskdefinitionfamily/task_definition_family.go +++ b/pkg/clients/ecs/taskdefinitionfamily/task_definition_family.go @@ -46,11 +46,13 @@ func LateInitialize(in *ecs.TaskDefinitionFamilyParameters, resp *awsecs.Describ } } if in.Volumes != nil { - for voli, vol := range in.Volumes { - awsvol := resp.TaskDefinition.Volumes[voli] - if vol.Host == nil && awsvol.Host != nil { - vol.Host = &ecs.HostVolumeProperties{ - SourcePath: awsvol.Host.SourcePath, + if len(in.Volumes) == len(resp.TaskDefinition.Volumes) { + for voli, vol := range in.Volumes { + awsvol := resp.TaskDefinition.Volumes[voli] + if vol.Host == nil && awsvol.Host != nil { + vol.Host = &ecs.HostVolumeProperties{ + SourcePath: awsvol.Host.SourcePath, + } } } } @@ -752,10 +754,16 @@ func IsUpToDate(target *ecs.TaskDefinitionFamily, out *awsecs.DescribeTaskDefini c := GenerateTaskDefinitionFamilyFromDescribe(out).Spec.ForProvider.DeepCopy() tags := func(a, b *ecs.Tag) bool { return aws.StringValue(a.Key) < aws.StringValue(b.Key) } + stringpointer := func(a, b *string) bool { return aws.StringValue(a) < aws.StringValue(b) } + keyValuePair := func(a, b *ecs.KeyValuePair) bool { return aws.StringValue(a.Name) < aws.StringValue(b.Name) } + secret := func(a, b *ecs.Secret) bool { return aws.StringValue(a.Name) < aws.StringValue(b.Name) } diff := cmp.Diff(c, t, cmpopts.EquateEmpty(), cmpopts.SortSlices(tags), + cmpopts.SortSlices(stringpointer), + cmpopts.SortSlices(keyValuePair), + cmpopts.SortSlices(secret), // Not present in DescribeTaskDefinitionOutput cmpopts.IgnoreFields(ecs.TaskDefinitionFamilyParameters{}, "Region"), cmpopts.IgnoreTypes(&xpv1.Reference{}, &xpv1.Selector{}, []xpv1.Reference{})) diff --git a/pkg/controller/ecs/service/setup.go b/pkg/controller/ecs/service/setup.go index 9a687de6ae..5460ad41ea 100644 --- a/pkg/controller/ecs/service/setup.go +++ b/pkg/controller/ecs/service/setup.go @@ -86,11 +86,13 @@ func isUpToDate(context context.Context, service *svcapitypes.Service, output *s tags := func(a, b *svcapitypes.Tag) bool { return aws.StringValue(a.Key) < aws.StringValue(b.Key) } stringpointer := func(a, b *string) bool { return aws.StringValue(a) < aws.StringValue(b) } + keyValuePair := func(a, b *svcsdk.KeyValuePair) bool { return aws.StringValue(a.Name) < aws.StringValue(b.Name) } diff := cmp.Diff(c, t, cmpopts.EquateEmpty(), cmpopts.SortSlices(tags), cmpopts.SortSlices(stringpointer), + cmpopts.SortSlices(keyValuePair), // Not present in DescribeServicesOutput cmpopts.IgnoreFields(svcapitypes.ServiceParameters{}, "Region"), cmpopts.IgnoreFields(svcapitypes.CustomServiceParameters{}, "Cluster"),