Skip to content

Commit e349072

Browse files
Merge pull request #838 from aleskandro/master
OCPBUGS-27335: The console-deployment should set the number of replicas based on the ControlPlaneTopology
2 parents 123a0fd + 37eaca4 commit e349072

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pkg/console/subresource/deployment/deployment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func DefaultDownloadsDeployment(
114114

115115
func withReplicas(deployment *appsv1.Deployment, infrastructureConfig *configv1.Infrastructure) {
116116
replicas := int32(SingleNodeConsoleReplicas)
117-
if infrastructureConfig.Status.InfrastructureTopology != configv1.SingleReplicaTopologyMode {
117+
if infrastructureConfig.Status.ControlPlaneTopology != configv1.SingleReplicaTopologyMode {
118118
replicas = int32(DefaultConsoleReplicas)
119119
}
120120
deployment.Spec.Replicas = &replicas
@@ -126,7 +126,7 @@ func withAffinity(
126126
component string,
127127
) {
128128
affinity := &corev1.Affinity{}
129-
if infrastructureConfig.Status.InfrastructureTopology != configv1.SingleReplicaTopologyMode {
129+
if infrastructureConfig.Status.ControlPlaneTopology != configv1.SingleReplicaTopologyMode {
130130
affinity = &corev1.Affinity{
131131
PodAntiAffinity: &corev1.PodAntiAffinity{
132132
RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{

pkg/console/subresource/deployment/deployment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ func TestWithConsoleAnnotations(t *testing.T) {
542542
ResourceVersion: "12345",
543543
},
544544
Status: configv1.InfrastructureStatus{
545-
InfrastructureTopology: configv1.SingleReplicaTopologyMode,
545+
ControlPlaneTopology: configv1.SingleReplicaTopologyMode,
546546
},
547547
}
548548

test/e2e/deployment_replicas_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestDeploymentsReplicas(t *testing.T) {
3434
}
3535

3636
var expectedReplicas int32
37-
if infrastructureConfig.Status.InfrastructureTopology == configv1.SingleReplicaTopologyMode {
37+
if infrastructureConfig.Status.ControlPlaneTopology == configv1.SingleReplicaTopologyMode {
3838
expectedReplicas = int32(deploymentsub.SingleNodeConsoleReplicas)
3939
} else {
4040
expectedReplicas = int32(deploymentsub.DefaultConsoleReplicas)

0 commit comments

Comments
 (0)