Skip to content

Commit 3fab033

Browse files
committed
🎨 Try to fix casting issues.
1 parent fabb1f7 commit 3fab033

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

‎components/migrations.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,18 @@ func (comp *migrationsComponent) Reconcile(ctx *cu.Context) (cu.Result, error) {
158158
}
159159

160160
// Find the template container.
161-
templatePodSpecContainers := templatePodSpec["containers"].([]map[string]interface{})
161+
templatePodSpecContainers := templatePodSpec["containers"].([]interface{})
162162
var templateContainer map[string]interface{}
163163
if obj.Spec.Container != "" {
164164
// Looking for a specific container name.
165165
for _, c := range templatePodSpecContainers {
166166
if c["name"].(string) == obj.Spec.Container {
167-
templateContainer = c
167+
templateContainer = c.(map[string]interface{})
168168
break
169169
}
170170
}
171171
} else if len(templatePodSpecContainers) > 0 {
172-
templateContainer = templatePodSpecContainers[0]
172+
templateContainer = templatePodSpecContainers[0].(map[string]interface{})
173173
}
174174
if templateContainer == nil {
175175
// 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) {
209209

210210
// Purge any migration wait initContainers since that would be a yodawg situation.
211211
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)
215216
}
216217
}
217218
migrationPodSpec["initContainers"] = initContainers

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy