Registry /
networking / k8snetworkplumbingwg-network-attachment-definition-client
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
networkattachmentdefinitionclient
✓ github.com/k8snetworkplumbingwg/network-attachment-definition-client
List NetworkAttachmentDefinitions in a Kubernetes cluster.
package main
import (
"context"
"fmt"
"github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned"
"k8s.io/client-go/tools/clientcmd"
)
func main() {
config, _ := clientcmd.BuildConfigFromFlags("", "")
clientset, _ := versioned.NewForConfig(config)
list, _ := clientset.K8sCniCncfIoV1().NetworkAttachmentDefinitions("default").List(context.TODO(), metav1.ListOptions{})
fmt.Println(len(list.Items))
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.7.7latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.