MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / GetClusterDeployment

Function GetClusterDeployment

pkg/provision/workspace/deployment.go:400–413  ·  view source on GitHub ↗
(workspace *common.DevWorkspaceWithConfig, clusterAPI sync.ClusterAPI)

Source from the content-addressed store, hash-verified

398}
399
400func GetClusterDeployment(workspace *common.DevWorkspaceWithConfig, clusterAPI sync.ClusterAPI) (*appsv1.Deployment, error) {
401 workspaceDeployment := &appsv1.Deployment{}
402 workspaceKey := types.NamespacedName{Name: common.DeploymentName(workspace.Status.DevWorkspaceId), Namespace: workspace.Namespace}
403
404 err := clusterAPI.Client.Get(clusterAPI.Ctx, workspaceKey, workspaceDeployment)
405 if err != nil {
406 if k8sErrors.IsNotFound(err) {
407 return nil, nil
408 }
409 return nil, err
410 }
411
412 return workspaceDeployment, nil
413}

Callers

nothing calls this directly

Calls 2

DeploymentNameFunction · 0.92
GetMethod · 0.65

Tested by

no test coverage detected