Merge pull request #9393 from y1r/add-context-k8sutil-endpoint
core: add context parameter to k8sutil endpoint
This commit is contained in:
3 files changed
+3
-4
No files matched your search
@@ -714,7 +714,7 @@ func ConfigureExternalMetricsEndpoint(ctx *clusterd.Context, monitoringSpec ceph
|
||||
}
|
||||
logger.Debugf("diff between current endpoint and newly generated one: %v \n", cmp.Diff(currentEndpoints, endpoint, cmp.Comparer(func(x, y resource.Quantity) bool { return x.Cmp(y) == 0 })))
|
||||
|
||||
_, err = k8sutil.CreateOrUpdateEndpoint(ctx.Clientset, clusterInfo.Namespace, endpoint)
|
||||
_, err = k8sutil.CreateOrUpdateEndpoint(clusterInfo.Context, ctx.Clientset, clusterInfo.Namespace, endpoint)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to create or update mgr endpoint")
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ func (c *clusterConfig) reconcileExternalEndpoint(cephObjectStore *cephv1.CephOb
|
||||
return errors.Wrapf(err, "failed to set owner reference to ceph object store endpoint %q", endpoint.Name)
|
||||
}
|
||||
|
||||
_, err = k8sutil.CreateOrUpdateEndpoint(c.context.Clientset, cephObjectStore.Namespace, endpoint)
|
||||
_, err = k8sutil.CreateOrUpdateEndpoint(c.clusterInfo.Context, c.context.Clientset, cephObjectStore.Namespace, endpoint)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to create or update object store %q endpoint", cephObjectStore.Name)
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ import (
|
||||
)
|
||||
|
||||
// CreateOrUpdateEndpoint creates a service or updates the service declaratively if it already exists.
|
||||
func CreateOrUpdateEndpoint(clientset kubernetes.Interface, namespace string, endpointDefinition *v1.Endpoints) (*v1.Endpoints, error) {
|
||||
ctx := context.TODO()
|
||||
func CreateOrUpdateEndpoint(ctx context.Context, clientset kubernetes.Interface, namespace string, endpointDefinition *v1.Endpoints) (*v1.Endpoints, error) {
|
||||
name := endpointDefinition.Name
|
||||
logger.Debugf("creating endpoint %q. %v", name, endpointDefinition.Subsets)
|
||||
ep, err := clientset.CoreV1().Endpoints(namespace).Create(ctx, endpointDefinition, metav1.CreateOptions{})
|
||||
|
||||
Reference in new issue
Block a user