mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
19 lines
321 B
Go
19 lines
321 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
"fmt"
|
|
)
|
|
|
|
func test(){
|
|
|
|
pods, err := clientSet.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{})
|
|
|
|
if err != nil {
|
|
panic(err.Error())
|
|
}
|
|
|
|
fmt.Printf("There are %d pods in the cluster\n", len(pods.Items))
|
|
|
|
} |