Skip to content

Commit 467b468

Browse files
Merge pull request #21017 from openshift-cherrypick-robot/cherry-pick-21014-to-release-3.11
[release-3.11] Fix printing DC replicas
2 parents 4b0752f + 44fd519 commit 467b468

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/oc/lib/describe/deployments.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ func printDeploymentRc(deployment *corev1.ReplicationController, kubeClient kube
414414
timeAt := strings.ToLower(formatRelativeTime(deployment.CreationTimestamp.Time))
415415
fmt.Fprintf(w, "\tCreated:\t%s ago\n", timeAt)
416416
fmt.Fprintf(w, "\tStatus:\t%s\n", appsutil.DeploymentStatusFor(deployment))
417-
fmt.Fprintf(w, "\tReplicas:\t%d current / %d desired\n", deployment.Status.Replicas, deployment.Spec.Replicas)
417+
if deployment.Spec.Replicas != nil {
418+
fmt.Fprintf(w, "\tReplicas:\t%d current / %d desired\n", deployment.Status.Replicas, *deployment.Spec.Replicas)
419+
}
418420

419421
if verbose {
420422
fmt.Fprintf(w, "\tSelector:\t%s\n", formatLabels(deployment.Spec.Selector))

0 commit comments

Comments
 (0)