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:
Anthony Yeh
2018-03-20 09:45:19 -07:00
parent e32a15558b
commit 1c531fc970
8 changed files with 90 additions and 110 deletions

View File

@@ -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)
}