Files
locust-operator/internal/controller/sync.go
Chris Richardson 9d4d9b385b
Some checks failed
E2E Tests / Run on Ubuntu (push) Failing after 1m26s
Lint / Run on Ubuntu (push) Failing after 4m54s
Tests / Run on Ubuntu (push) Successful in 5m8s
first commit
2025-05-09 08:22:45 -04:00

19 lines
475 B
Go

package controller
import (
"context"
locustCluster "git.lilpenguins.com/crichardson/locust-operator/api/v1alpha1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
func GetLocustCluster(client client.Client, ctx context.Context, namespace string, name string) (
*locustCluster.LocustCluster, error) {
cluster := &locustCluster.LocustCluster{}
err := client.Get(ctx, BuildObjectKey(namespace, name), cluster)
if err != nil {
return nil, err
}
return cluster, nil
}