func()

in internal/deployers/eksapi/logs.go [42:61]


func (m *logManager) gatherLogsFromNodes(k8sClient *k8sClient, opts *deployerOptions, phase deployerPhase) error {
	if opts.LogBucket == "" {
		klog.Info("--log-bucket is empty, no logs will be gathered!")
		return nil
	}
	if k8sClient == nil {
		klog.Infof("no k8s client available, no logs will be gathered!")
		return nil
	}
	if opts.AutoMode {
		return m.gatherLogsUsingNodeDiagnostic(k8sClient, opts, phase)
	}
	switch opts.UserDataFormat {
	case "bootstrap.sh", "nodeadm", "": // if no --user-data-format was passed, we must be using managed nodes, which default to AL-based AMIs
		return m.gatherLogsUsingScript(k8sClient, opts, phase)
	default:
		klog.Warningf("unable to gather logs for userDataFormat: %s\n", opts.UserDataFormat)
		return nil
	}
}