(workspace *common.DevWorkspaceWithConfig, clusterAPI sync.ClusterAPI)
| 398 | } |
| 399 | |
| 400 | func 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 | } |
nothing calls this directly
no test coverage detected