@@ -723,7 +723,7 @@ func ExtractKubeImageVersion() string {
723723 return version
724724}
725725
726- // Runs and logs kubectl describe pod command
726+ // Runs ' kubectl describe pod' command and logs output.
727727func DescribePod (cluster * Cluster , pod * Pod ) {
728728 cmd := fmt .Sprintf ("%s -n %s" , pod .Name , pod .NameSpace )
729729 output , describeErr := KubectlCommand (cluster , "node" , "describe" , "pod" , cmd )
@@ -736,7 +736,7 @@ func DescribePod(cluster *Cluster, pod *Pod) {
736736 }
737737}
738738
739- // Runs and logs: kubectl logs command output
739+ // Runs ' kubectl logs' command and logs output.
740740func PodLogs (cluster * Cluster , pod * Pod ) {
741741 if pod .NameSpace == "" || pod .Name == "" {
742742 LogLevel ("warn" , "Name or Namespace info in pod data is empty. kubectl logs cmd may not work" )
@@ -753,8 +753,8 @@ func PodLogs(cluster *Cluster, pod *Pod) {
753753}
754754
755755// Given a namespace, this function:
756- // 1. filters ALL pods in the namespace
757- // 2. logs both kubectl describe pod and kubectl logs output for each pod in the namespace
756+ // 1. Filters ALL pods in the namespace.
757+ // 2. logs both ' kubectl describe pod' and ' kubectl logs' output for each pod in the namespace.
758758func LogAllPodsForNamespace (namespace string ) {
759759 LogLevel ("debug" , "logging pod logs and describe pod output for all pods with namespace: %s" , namespace )
760760 filters := map [string ]string {
@@ -773,9 +773,10 @@ func LogAllPodsForNamespace(namespace string) {
773773 }
774774}
775775
776- // Search and log for a particular pod(s) given its unique name substring and namespace. Ex: coredns, kube-system
777- // 1. Filter based on the name substring, and find the right pod(s)
778- // 2. For the pods matching the name, logs: kubectl describe pod and kubectl logs output
776+ // Search and log for a particular pod(s) given its unique name substring and namespace. Ex: coredns, kube-system.
777+ // 1. Filter based on the name substring, and find the right pod(s).
778+ // 2. For the pods matching the name, logs: 'kubectl describe pod' and 'kubectl logs' output.
779+ // In the given example, it will filter all 'coredns' named pods in 'kube-system' namespace and log their outputs.
779780func FindPodAndLog (name , namespace string ) {
780781 LogLevel ("debug" ,
781782 "find and log(pod logs and describe pod) for pod starting with %s for namespace %s" , name , namespace )
0 commit comments