INNER CODE UNIT · Go
printLogsForInitContainers
openservicemesh/osm · ci/cmd/maestro.go:195
func printLogsForInitContainers(kubeClient kubernetes.Interface, pod v1.Pod) {
for _, initContainer := range pod.Spec.InitContainers {
initLogs := maestro.GetPodLogs(kubeClient, pod.Namespace, pod.Name, initContainer.Name, maestro.FailureLogsFromTimeSince)
fmt.Println(fmt.Sprintf("---- NS: %s Pod: %s InitContainer: %s --------\n",
pod.Namespace, pod.Name, initContainer.Name), cutIt(initLogs))
}
}
func printLogsForContainers(kubeClient kubernetes.Interface, pod v1.Pod) {
for _, containerObj := range pod.Spec.Containers {
initLogs := maestro.GetPodLogs(kubeClient, pod.Namespace, pod.Name, containerObj.Name, maestro.FailureLogsFromTimeSince)
switch containerObj.Name {
case constants.EnvoyContainerName:
fmt.Println(fmt.Sprintf("---- NS: %s Pod: %s Envoy Logs: --------\n",
pod.Namespace, pod.Name), initLogs)
default:
fmt.Println(fmt.Sprintf("---- NS: %s Pod: %s Container: %s --------\n",
pod.Namespace, pod.Name, containerObj.Name), cutIt(initLogs))