GetHistory returns the ReplicaSet revisions associated with a Deployment
(namespace, name string)
| 160 | |
| 161 | // GetHistory returns the ReplicaSet revisions associated with a Deployment |
| 162 | func (h *DeploymentHistoryViewer) GetHistory(namespace, name string) (map[int64]runtime.Object, error) { |
| 163 | allRSs, err := getDeploymentReplicaSets(h.c.AppsV1(), namespace, name) |
| 164 | if err != nil { |
| 165 | return nil, err |
| 166 | } |
| 167 | |
| 168 | result := make(map[int64]runtime.Object) |
| 169 | for _, rs := range allRSs { |
| 170 | v, err := deploymentutil.Revision(rs) |
| 171 | if err != nil { |
| 172 | klog.Warningf("unable to get revision from replicaset %s for deployment %s in namespace %s: %v", rs.Name, name, namespace, err) |
| 173 | continue |
| 174 | } |
| 175 | result[v] = rs |
| 176 | } |
| 177 | |
| 178 | return result, nil |
| 179 | } |
| 180 | |
| 181 | func printTemplate(template *corev1.PodTemplateSpec) (string, error) { |
| 182 | buf := bytes.NewBuffer([]byte{}) |