Skip to content

Commit

Permalink
Merge pull request #61 from fabriziosestito/docs/clarify-kubernetes-l…
Browse files Browse the repository at this point in the history
…ist-return-type

docs(kubernetes): clarify that list() returns an object list (e.g. li…
  • Loading branch information
fabriziosestito authored Jun 14, 2024
2 parents add57fb + 3629a66 commit f47ca80
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/cel/library/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,17 @@ import (
// list
//
// Returns a list of Kubernetes resources matching the client configuration.
// The list of resources is returned as the corresponding object list type, for instance listing of `Pods` will return a [`PodList`](https://pkg.go.dev/k8s.io/api/core/v1#PodList).
// The resources can be accessed using the 'items' field.
//
// <Client>.list() <objectList>
//
// Examples:
//
// kw.k8s.apiVersion('v1').kind('Pod').namespace('default').list() // returns a list of 'Pod' resources in the 'default' namespace
// kw.k8s.apiVersion('v1').kind('Pod').list() // returns a list of 'Pod' resources in all namespaces
// kw.k8s.apiVersion('v1').kind('Pod').labelSelector('app=nginx').list() // returns a list of 'Pod' resources in all namespaces with the label selector 'app=nginx'
// kw.k8s.apiVersion('v1').kind('Pod').fieldSelector('status.phase=Running').namespace('default').list() // returns a list of running 'Pod' resources in the default namespace with the field selector 'status.phase=Running'
// kw.k8s.apiVersion('v1').kind('Pod').namespace('default').list().items // returns a list of 'Pod' resources in the 'default' namespace
// kw.k8s.apiVersion('v1').kind('Pod').list().items // returns a list of 'Pod' resources in all namespaces
// kw.k8s.apiVersion('v1').kind('Pod').labelSelector('app=nginx').list().items // returns a list of 'Pod' resources in all namespaces with the label selector 'app=nginx'
// kw.k8s.apiVersion('v1').kind('Pod').fieldSelector('status.phase=Running').namespace('default').list().items // returns a list of running 'Pod' resources in the default namespace with the field selector 'status.phase=Running'
//
// get
//
Expand Down

0 comments on commit f47ca80

Please sign in to comment.