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