File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,16 +123,24 @@ func flattenClusterTemplateRevisions(input []managementClient.ClusterTemplateRev
123123 }
124124 }
125125 }
126- sortedInput := make ([]managementClient.ClusterTemplateRevision , len (input ))
126+ inputLen := len (input )
127+ pLen := len (p )
128+ sortedInput := make ([]managementClient.ClusterTemplateRevision , inputLen )
127129 newCTR := []managementClient.ClusterTemplateRevision {}
128130 lastIndex := 0
129131 for i := range sortedInput {
130132 if v , ok := pIndexID [input [i ].ID ]; ok {
133+ if v > i && pLen > inputLen {
134+ v = v - (v - i )
135+ }
131136 sortedInput [v ] = input [i ]
132137 lastIndex ++
133138 continue
134139 }
135140 if v , ok := pIndexName [input [i ].Name ]; ok {
141+ if v > i && pLen > inputLen {
142+ v = v - (v - i )
143+ }
136144 sortedInput [v ] = input [i ]
137145 lastIndex ++
138146 continue
You can’t perform that action at this time.
0 commit comments