@@ -158,18 +158,19 @@ func (comp *migrationsComponent) Reconcile(ctx *cu.Context) (cu.Result, error) {
158
158
}
159
159
160
160
// Find the template container.
161
- templatePodSpecContainers := templatePodSpec ["containers" ].([]map [ string ] interface {})
161
+ templatePodSpecContainers := templatePodSpec ["containers" ].([]interface {})
162
162
var templateContainer map [string ]interface {}
163
163
if obj .Spec .Container != "" {
164
164
// Looking for a specific container name.
165
165
for _ , c := range templatePodSpecContainers {
166
- if c ["name" ].(string ) == obj .Spec .Container {
167
- templateContainer = c
166
+ container := c .(map [string ]interface {})
167
+ if container ["name" ].(string ) == obj .Spec .Container {
168
+ templateContainer = container
168
169
break
169
170
}
170
171
}
171
172
} else if len (templatePodSpecContainers ) > 0 {
172
- templateContainer = templatePodSpecContainers [0 ]
173
+ templateContainer = templatePodSpecContainers [0 ].( map [ string ] interface {})
173
174
}
174
175
if templateContainer == nil {
175
176
// Welp, either nothing matched the name or somehow there are no containers.
@@ -209,9 +210,10 @@ func (comp *migrationsComponent) Reconcile(ctx *cu.Context) (cu.Result, error) {
209
210
210
211
// Purge any migration wait initContainers since that would be a yodawg situation.
211
212
initContainers := []map [string ]interface {}{}
212
- for _ , c := range migrationPodSpec ["initContainers" ].([]map [string ]interface {}) {
213
- if ! strings .HasPrefix (c ["name" ].(string ), "migrate-wait-" ) {
214
- initContainers = append (initContainers , c )
213
+ for _ , c := range migrationPodSpec ["initContainers" ].([]interface {}) {
214
+ container := c .(map [string ]interface {})
215
+ if ! strings .HasPrefix (container ["name" ].(string ), "migrate-wait-" ) {
216
+ initContainers = append (initContainers , container )
215
217
}
216
218
}
217
219
migrationPodSpec ["initContainers" ] = initContainers
0 commit comments