first commit
This commit is contained in:
18
internal/controller/sync.go
Normal file
18
internal/controller/sync.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user