mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #48389 from nikhita/apiextensions-client-go-cleanup
Automatic merge from submit-queue apiextensions: add cleanup section to client-go Adds a `Cleanup` section to be consistent with other client-go tutorials. Fixes https://github.com/kubernetes/apiextensions-apiserver/issues/1 **Release note**: ```release-note NONE ```
This commit is contained in:
commit
13e142fb18
@ -43,4 +43,10 @@ type User struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Cleanup
|
||||||
|
|
||||||
|
Successfully running this program will clean the created artifacts. If you terminate the program without completing, you can clean up the created CustomResourceDefinition with:
|
||||||
|
|
||||||
|
kubectl delete crd examples.cr.client-go.k8s.io
|
||||||
|
@ -110,7 +110,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
fmt.Print("PROCESSED\n")
|
fmt.Print("PROCESSED\n")
|
||||||
|
|
||||||
// Fetch a list of our TPRs
|
// Fetch a list of our CRs
|
||||||
exampleList := crv1.ExampleList{}
|
exampleList := crv1.ExampleList{}
|
||||||
err = exampleClient.Get().Resource(crv1.ExampleResourcePlural).Do().Into(&exampleList)
|
err = exampleClient.Get().Resource(crv1.ExampleResourcePlural).Do().Into(&exampleList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user