first commit
This commit is contained in:
18
admissioncontrollers/introduction/sourcecode/test.go
Normal file
18
admissioncontrollers/introduction/sourcecode/test.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user