🌳
pt0/deployF/k8sF/logsF/podLogsF.mts
5type PodLogsProps = WithClusterName & {
6 name?: string
7 fuzzyPodName?: string
8 tailLines?: number
9 follow?: boolean
10 pretty?: boolean
11 timestamps?: boolean
12 streamStdout?: boolean
15export const streamPodLogs = async (props: PodLogsProps) => {
16 await retPodLogs({streamStdout: true, follow: true, timestamps: true, pretty: true, ...props})
19export const retPodLogs = async ({name, fuzzyPodName, ...props}: PodLogsProps) => {
20 const {cluster_name} = props
21 let podH: {cluster_name: string, fuzzyPodName?: string, labels?: {name: string}} = {cluster_name, fuzzyPodName}
22 if (name) podH = {...podH, labels: {name}}
23 const podInfo = await getSinglePod(podH)
24 if (!podInfo) return
25 const {podName, containerName} = podInfo
26 return await ret1PodLogs({podName, containerName, ...props})