mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
kubectl: Use apps/v1 Deployment/ReplicaSet.
This is necessary since kubectl shares code with the controllers, and the controllers have been updated to use apps/v1.
This commit is contained in:
@@ -102,12 +102,12 @@ type DeploymentHistoryViewer struct {
|
||||
// ViewHistory returns a revision-to-replicaset map as the revision history of a deployment
|
||||
// TODO: this should be a describer
|
||||
func (h *DeploymentHistoryViewer) ViewHistory(namespace, name string, revision int64) (string, error) {
|
||||
versionedExtensionsClient := h.c.ExtensionsV1beta1()
|
||||
deployment, err := versionedExtensionsClient.Deployments(namespace).Get(name, metav1.GetOptions{})
|
||||
versionedAppsClient := h.c.AppsV1()
|
||||
deployment, err := versionedAppsClient.Deployments(namespace).Get(name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to retrieve deployment %s: %v", name, err)
|
||||
}
|
||||
_, allOldRSs, newRS, err := deploymentutil.GetAllReplicaSets(deployment, versionedExtensionsClient)
|
||||
_, allOldRSs, newRS, err := deploymentutil.GetAllReplicaSets(deployment, versionedAppsClient)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to retrieve replica sets from deployment %s: %v", name, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user