MCPcopy
hub / github.com/kubernetes/kubectl / getDeploymentReplicaSets

Function getDeploymentReplicaSets

pkg/polymorphichelpers/history.go:313–328  ·  view source on GitHub ↗
(apps clientappsv1.AppsV1Interface, namespace, name string)

Source from the content-addressed store, hash-verified

311}
312
313func 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

Callers 2

ViewHistoryMethod · 0.85
GetHistoryMethod · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…