(apps clientappsv1.AppsV1Interface, namespace, name string)
| 311 | } |
| 312 | |
| 313 | func getDeploymentReplicaSets(apps clientappsv1.AppsV1Interface, namespace, name string) ([]*appsv1.ReplicaSet, error) { |
| 314 | deployment, err := apps.Deployments(namespace).Get(context.TODO(), name, metav1.GetOptions{}) |
| 315 | if err != nil { |
| 316 | return nil, fmt.Errorf("failed to retrieve deployment %s: %v", name, err) |
| 317 | } |
| 318 | |
| 319 | _, oldRSs, newRS, err := deploymentutil.GetAllReplicaSets(deployment, apps) |
| 320 | if err != nil { |
| 321 | return nil, fmt.Errorf("failed to retrieve replica sets from deployment %s: %v", name, err) |
| 322 | } |
| 323 | |
| 324 | if newRS == nil { |
| 325 | return oldRSs, nil |
| 326 | } |
| 327 | return append(oldRSs, newRS), nil |
| 328 | } |
| 329 | |
| 330 | // controlledHistories returns all ControllerRevisions in namespace that selected by selector and owned by accessor |
| 331 | // TODO: Rename this to controllerHistory when other controllers have been upgraded |
no test coverage detected
searching dependent graphs…