This repository has been archived on 2023-11-25. You can view files and clone it, but cannot push or open issues or pull requests.
kreaper/main.go
2022-04-13 08:06:23 +02:00

21 lines
372 B
Go

package main
import (
"context"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
)
func main() {
restCfg, err := rest.InClusterConfig()
if err != nil {
panic(err)
}
k8sClient, err := client.NewWithWatch(restCfg, client.Options{})
labels := client.MatchingLabels{
"from": "value",
}
k8sClient.Watch(context.Background(), nil, labels)
}