fixed ConfigTracker to be able to scan envFrom in init-containers

Signed-off-by: kazukousen <mmchari.0228@gmail.com>
This commit is contained in:
kazukousen
2021-05-24 14:09:04 +09:00
parent 39a3898234
commit 17557dc206
+2
View File
@@ -135,6 +135,7 @@ func (ct *ConfigTracker) GetTargetConfigs(cd *flaggerv1.Canary) (map[string]Conf
}
vs = targetDep.Spec.Template.Spec.Volumes
cs = targetDep.Spec.Template.Spec.Containers
cs = append(cs, targetDep.Spec.Template.Spec.InitContainers...)
case "DaemonSet":
targetDae, err := ct.KubeClient.AppsV1().DaemonSets(cd.Namespace).Get(context.TODO(), targetName, metav1.GetOptions{})
if err != nil {
@@ -142,6 +143,7 @@ func (ct *ConfigTracker) GetTargetConfigs(cd *flaggerv1.Canary) (map[string]Conf
}
vs = targetDae.Spec.Template.Spec.Volumes
cs = targetDae.Spec.Template.Spec.Containers
cs = append(cs, targetDae.Spec.Template.Spec.InitContainers...)
default:
return nil, fmt.Errorf("TargetRef.Kind invalid: %s", cd.Spec.TargetRef.Kind)
}