func (t *PodsTable) Generate(ctx context.Context, queryContext table.QueryContext) ([]map[string]string, error) {
	pods, err := t.client.CoreV1().Pods("").List(metav1.ListOptions{})
	if err != nil {
		log.Println("could not get pods from k8s api")
		return nil, err
	}
	rows := make([]map[string]string, len(pods.Items))
	for i, pod := range pods.Items {
		rows[i] = map[string]string{
			"uid":             string(pod.UID), // UID is an alias to string
			"name":            pod.Name,
			"namespace":       pod.Namespace,
			"ip":              pod.Status.PodIP,
			"phase":           string(pod.Status.Phase),
			"service_account": pod.Spec.ServiceAccountName,
			"node_name":       pod.Spec.NodeName,
		}
	}
	return rows, nil
}
// Generate uses the api to retrieve information on all pods
Generate uses the api to retrieve information on all pods
// Generate uses the api to retrieve information on all pods
func (t *PodsTable) Generate(ctx context.Context, queryContext table.QueryContext) ([]map[string]string, error) {
	pods, err := t.client.CoreV1().Pods("").List(metav1.ListOptions{})
	if err != nil {
		log.Println("could not get pods from k8s api")
		return nil, err
	}
	rows := make([]map[string]string, len(pods.Items))
	for i, pod := range pods.Items {
		rows[i] = map[string]string{
			"uid":             string(pod.UID), 
			"name":            pod.Name,
			"namespace":       pod.Namespace,
			"ip":              pod.Status.PodIP,
			"phase":           string(pod.Status.Phase),
			"service_account": pod.Spec.ServiceAccountName,
			"node_name":       pod.Spec.NodeName,
		}
	}
	return rows, nil
}
func ( t * PodsTable ) Generate ( ctx context . Context , queryContext table . QueryContext ) ( [ ] map [ string ] string , error ) { pods , err := t . client . CoreV1 ( ) . Pods ( " " ) . List ( metav1 . ListOptions { } ) if err != nil { log . Println ( " " ) return nil , err } rows := make ( [ ] map [ string ] string , len ( pods . Items ) ) for i , pod := range pods . Items { rows [ i ] = map [ string ] string { " " : string ( pod . UID ) , " " : pod . Name , " " : pod . Namespace , " " : pod . Status . PodIP , " " : string ( pod . Status . Phase ) , " " : pod . Spec . ServiceAccountName , " " : pod . Spec . NodeName , } } return rows , nil }
Generate uses the api to retrieve information on all pods
Generate uses the api to retrieve information on all pods
// UID is an alias to string