Просмотр исходного кода

show pod logs from pod creation time

sunguroku 5 лет назад
Родитель
Сommit
dc3960a3ba

+ 1 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/status/Logs.tsx

@@ -65,6 +65,7 @@ export default class Logs extends Component<PropsType, StateType> {
 
 
   componentWillUnmount() {
   componentWillUnmount() {
     if (this.state.ws) {
     if (this.state.ws) {
+      console.log('closing websockets')
       this.state.ws.close()
       this.state.ws.close()
     }
     }
   }
   }

+ 1 - 3
internal/kubernetes/agent.go

@@ -124,10 +124,8 @@ func (a *Agent) GetPodsByLabel(selector string) (*v1.PodList, error) {
 // GetPodLogs streams real-time logs from a given pod.
 // GetPodLogs streams real-time logs from a given pod.
 func (a *Agent) GetPodLogs(namespace string, name string, conn *websocket.Conn) error {
 func (a *Agent) GetPodLogs(namespace string, name string, conn *websocket.Conn) error {
 	// follow logs
 	// follow logs
-	tails := int64(30)
 	podLogOpts := v1.PodLogOptions{
 	podLogOpts := v1.PodLogOptions{
-		Follow:    true,
-		TailLines: &tails,
+		Follow: true,
 	}
 	}
 	req := a.Clientset.CoreV1().Pods(namespace).GetLogs(name, &podLogOpts)
 	req := a.Clientset.CoreV1().Pods(namespace).GetLogs(name, &podLogOpts)
 	podLogs, err := req.Stream(context.TODO())
 	podLogs, err := req.Stream(context.TODO())