|
|
@@ -266,14 +266,15 @@ func (d *DockerSecretsPostRenderer) updatePodSpecs(secrets map[string]string) {
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
- var imagePullSecrets []map[string]interface{}
|
|
|
- existingNames := map[string]bool{}
|
|
|
+ imagePullSecrets := make([]map[string]interface{}, 0)
|
|
|
+
|
|
|
if existingPullSecrets, ok := podSpec["imagePullSecrets"]; ok {
|
|
|
- imagePullSecrets = existingPullSecrets.([]map[string]interface{})
|
|
|
- for _, s := range imagePullSecrets {
|
|
|
+ existing := existingPullSecrets.([]map[string]interface{})
|
|
|
+
|
|
|
+ for _, s := range existing {
|
|
|
if name, ok := s["name"]; ok {
|
|
|
- if n, ok := name.(string); ok {
|
|
|
- existingNames[n] = true
|
|
|
+ if n, ok := name.(string); ok && n != "" {
|
|
|
+ imagePullSecrets = append(imagePullSecrets, s)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -311,9 +312,10 @@ func (d *DockerSecretsPostRenderer) updatePodSpecs(secrets map[string]string) {
|
|
|
"name": secrets[regName],
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
if len(imagePullSecrets) > 0 {
|
|
|
podSpec["imagePullSecrets"] = imagePullSecrets
|
|
|
+ } else {
|
|
|
+ podSpec["imagePullSecrets"] = nil
|
|
|
}
|
|
|
|
|
|
}
|