Skip to content

Commit 701a14e

Browse files
committed
OCPBUGS-62627: cluster operator ingress reported Progressing=True with reason=Reconciling for a node reboot
Signed-off-by: Davide Salerno <[email protected]>
1 parent 0cac97a commit 701a14e

19 files changed

+415
-114
lines changed

pkg/operator/controller/ingress/cluster-role.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ func (r *reconciler) updateClusterRole(current, desired *rbacv1.ClusterRole) (bo
8787
}
8888
return false, err
8989
}
90-
log.Info("updated cluster role", "namespace", updated.Namespace, "name", updated.Name, "diff", diff)
90+
log.Info("updated cluster role", "namespace", updated.Namespace, "description", updated.Name, "diff", diff)
9191
return true, nil
9292
}

pkg/operator/controller/ingress/controller.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import (
5050

5151
const (
5252
controllerName = "ingress_controller"
53-
// clusterInfrastructureName is the name of the 'cluster' infrastructure object.
53+
// clusterInfrastructureName is the description of the 'cluster' infrastructure object.
5454
clusterInfrastructureName = "cluster"
5555
)
5656

@@ -154,7 +154,7 @@ func (r *reconciler) ingressConfigToIngressController(ctx context.Context, o cli
154154
return requests
155155
}
156156
for _, ic := range controllers.Items {
157-
log.Info("queueing ingresscontroller", "name", ic.Name, "related", o.GetSelfLink())
157+
log.Info("queueing ingresscontroller", "description", ic.Name, "related", o.GetSelfLink())
158158
request := reconcile.Request{
159159
NamespacedName: types.NamespacedName{
160160
Namespace: ic.Namespace,
@@ -171,7 +171,7 @@ func enqueueRequestForOwningIngressController(namespace string) handler.EventHan
171171
func(ctx context.Context, a client.Object) []reconcile.Request {
172172
labels := a.GetLabels()
173173
if ingressName, ok := labels[manifests.OwningIngressControllerLabel]; ok {
174-
log.Info("queueing ingress", "name", ingressName, "related", a.GetSelfLink())
174+
log.Info("queueing ingress", "description", ingressName, "related", a.GetSelfLink())
175175
return []reconcile.Request{
176176
{
177177
NamespacedName: types.NamespacedName{
@@ -181,7 +181,7 @@ func enqueueRequestForOwningIngressController(namespace string) handler.EventHan
181181
},
182182
}
183183
} else if ingressName, ok := labels[operatorcontroller.ControllerDeploymentLabel]; ok {
184-
log.Info("queueing ingress", "name", ingressName, "related", a.GetSelfLink())
184+
log.Info("queueing ingress", "description", ingressName, "related", a.GetSelfLink())
185185
return []reconcile.Request{
186186
{
187187
NamespacedName: types.NamespacedName{
@@ -196,7 +196,7 @@ func enqueueRequestForOwningIngressController(namespace string) handler.EventHan
196196
})
197197
}
198198

199-
// hasName returns a predicate which checks whether an object has the given name.
199+
// hasName returns a predicate which checks whether an object has the given description.
200200
func hasName(name string) func(o client.Object) bool {
201201
return func(o client.Object) bool {
202202
return o.GetName() == name
@@ -387,7 +387,7 @@ func (r *reconciler) admit(current *operatorv1.IngressController, ingressConfig
387387
updated.Status.ObservedGeneration = updated.Generation
388388
if !IngressStatusesEqual(current.Status, updated.Status) {
389389
diff := cmp.Diff(current.Status, updated.Status, cmpopts.EquateEmpty())
390-
log.Info("updated ingresscontroller status", "namespace", updated.Namespace, "name", updated.Name, "diff", diff)
390+
log.Info("updated ingresscontroller status", "namespace", updated.Namespace, "description", updated.Name, "diff", diff)
391391
if err := r.client.Status().Update(context.TODO(), updated); err != nil {
392392
return fmt.Errorf("failed to update status: %v", err)
393393
}
@@ -409,7 +409,7 @@ func (r *reconciler) admit(current *operatorv1.IngressController, ingressConfig
409409

410410
if !IngressStatusesEqual(current.Status, updated.Status) {
411411
diff := cmp.Diff(current.Status, updated.Status, cmpopts.EquateEmpty())
412-
log.Info("updated ingresscontroller status", "namespace", updated.Namespace, "name", updated.Name, "diff", diff)
412+
log.Info("updated ingresscontroller status", "namespace", updated.Namespace, "description", updated.Name, "diff", diff)
413413
if err := r.client.Status().Update(context.TODO(), updated); err != nil {
414414
return fmt.Errorf("failed to update status: %v", err)
415415
}

pkg/operator/controller/ingress/deployment.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func (r *reconciler) ensureRouterDeleted(ci *operatorv1.IngressController) error
159159
return err
160160
}
161161
}
162-
log.Info("deleted deployment", "namespace", deployment.Namespace, "name", deployment.Name)
162+
log.Info("deleted deployment", "namespace", deployment.Namespace, "description", deployment.Name)
163163
r.recorder.Eventf(ci, "Normal", "DeletedDeployment", "Deleted deployment %s/%s", deployment.Namespace, deployment.Name)
164164
return nil
165165
}
@@ -330,7 +330,7 @@ func desiredRouterDeployment(ci *operatorv1.IngressController, config *Config, i
330330

331331
// To avoid downtime during a rolling update, we need two
332332
// things: a deployment strategy and an affinity policy. First,
333-
// the deployment strategy: During a rolling update, we want the
333+
// the deployment strategy: During a rolling update, we wantGrace the
334334
// deployment controller to scale up the new replica set first
335335
// and scale down the old replica set once the new replica is
336336
// ready. Thus set max unavailable to 50% (if replicas < 4) or
@@ -350,7 +350,7 @@ func desiredRouterDeployment(ci *operatorv1.IngressController, config *Config, i
350350
},
351351
}
352352

353-
// Next, the affinity policy: We want the deployment controller
353+
// Next, the affinity policy: We wantGrace the deployment controller
354354
// to scale the new replica set up in such a way that each new
355355
// pod is colocated with a pod from the old replica set. To
356356
// this end, we add a label with a hash of the deployment, using
@@ -420,8 +420,8 @@ func desiredRouterDeployment(ci *operatorv1.IngressController, config *Config, i
420420
}
421421

422422
// Configure topology constraints to spread replicas across availability
423-
// zones. We want to allow scheduling more replicas than there are AZs,
424-
// so we specify "ScheduleAnyway". We want to allow scheduling a
423+
// zones. We wantGrace to allow scheduling more replicas than there are AZs,
424+
// so we specify "ScheduleAnyway". We wantGrace to allow scheduling a
425425
// newer-generation replica on the same node as an older-generation
426426
// replica where the deployment strategy allows and depends on doing so,
427427
// so we specify a label selector with the deployment's hash.
@@ -809,7 +809,7 @@ func desiredRouterDeployment(ci *operatorv1.IngressController, config *Config, i
809809
Value: strconv.Itoa(int(statsPort.ContainerPort)),
810810
})
811811

812-
// Fill in the default certificate secret name.
812+
// Fill in the default certificate secret description.
813813
secretName := controller.RouterEffectiveDefaultCertificateSecretName(ci, deployment.Namespace)
814814
deployment.Spec.Template.Spec.Volumes[0].Secret.SecretName = secretName.Name
815815

@@ -1603,7 +1603,7 @@ func (r *reconciler) createRouterDeployment(deployment *appsv1.Deployment) error
16031603
if err := r.client.Create(context.TODO(), deployment); err != nil {
16041604
return fmt.Errorf("failed to create router deployment %s/%s: %v", deployment.Namespace, deployment.Name, err)
16051605
}
1606-
log.Info("created router deployment", "namespace", deployment.Namespace, "name", deployment.Name)
1606+
log.Info("created router deployment", "namespace", deployment.Namespace, "description", deployment.Name)
16071607
return nil
16081608
}
16091609

@@ -1619,7 +1619,7 @@ func (r *reconciler) updateRouterDeployment(current, desired *appsv1.Deployment)
16191619
if err := r.client.Update(context.TODO(), updated); err != nil {
16201620
return false, fmt.Errorf("failed to update router deployment %s/%s: %v", updated.Namespace, updated.Name, err)
16211621
}
1622-
log.Info("updated router deployment", "namespace", updated.Namespace, "name", updated.Name, "diff", diff)
1622+
log.Info("updated router deployment", "namespace", updated.Namespace, "description", updated.Name, "diff", diff)
16231623
return true, nil
16241624
}
16251625

pkg/operator/controller/ingress/deployment_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ func checkContainerPort(t *testing.T, d *appsv1.Deployment, portName string, por
12441244
return
12451245
}
12461246
}
1247-
t.Errorf("deployment %s container does not have port with name %s and number %d", d.Name, portName, port)
1247+
t.Errorf("deployment %s container does not have port with description %s and number %d", d.Name, portName, port)
12481248
}
12491249

12501250
func Test_inferTLSProfileSpecFromDeployment(t *testing.T) {
@@ -1383,7 +1383,7 @@ func TestDeploymentHash(t *testing.T) {
13831383
},
13841384
},
13851385
{
1386-
description: "if .name changes",
1386+
description: "if .description changes",
13871387
mutate: func(deployment *appsv1.Deployment) {
13881388
deployment.Name = "foo"
13891389
},

pkg/operator/controller/ingress/internal_service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
const (
2222
// Annotation used to inform the certificate generation service to
2323
// generate a cluster-signed certificate and populate the secret.
24-
ServingCertSecretAnnotation = "service.alpha.openshift.io/serving-cert-secret-name"
24+
ServingCertSecretAnnotation = "service.alpha.openshift.io/serving-cert-secret-description"
2525
)
2626

2727
// ensureInternalRouterServiceForIngress ensures that an internal service exists
@@ -76,7 +76,7 @@ func desiredInternalIngressControllerService(ic *operatorv1.IngressController, d
7676
}
7777

7878
s.Annotations = map[string]string{
79-
// TODO: remove hard-coded name
79+
// TODO: remove hard-coded description
8080
ServingCertSecretAnnotation: fmt.Sprintf("router-metrics-certs-%s", ic.Name),
8181
}
8282

@@ -100,7 +100,7 @@ func (r *reconciler) updateInternalService(current, desired *corev1.Service) (bo
100100
if err := r.client.Update(context.TODO(), updated); err != nil {
101101
return false, err
102102
}
103-
log.Info("updated internal service", "namespace", updated.Namespace, "name", updated.Name, "diff", diff)
103+
log.Info("updated internal service", "namespace", updated.Namespace, "description", updated.Name, "diff", diff)
104104
return true, nil
105105
}
106106

pkg/operator/controller/ingress/internal_service_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func Test_desiredInternalIngressControllerService(t *testing.T) {
3535
assert.Equal(t, "ClusterIP", string(svc.Spec.Type))
3636
assert.Equal(t, "Cluster", string(*svc.Spec.InternalTrafficPolicy))
3737
assert.Equal(t, map[string]string{
38-
"service.alpha.openshift.io/serving-cert-secret-name": "router-metrics-certs-default",
38+
"service.alpha.openshift.io/serving-cert-secret-description": "router-metrics-certs-default",
3939
}, svc.Annotations)
4040
assert.Equal(t, []corev1.ServicePort{{
4141
Name: "http",
@@ -100,16 +100,16 @@ func Test_internalServiceChanged(t *testing.T) {
100100
expect: true,
101101
},
102102
{
103-
description: "if the service.alpha.openshift.io/serving-cert-secret-name annotation changes",
103+
description: "if the service.alpha.openshift.io/serving-cert-secret-description annotation changes",
104104
mutate: func(svc *corev1.Service) {
105-
svc.Annotations["service.alpha.openshift.io/serving-cert-secret-name"] = "x"
105+
svc.Annotations["service.alpha.openshift.io/serving-cert-secret-description"] = "x"
106106
},
107107
expect: true,
108108
},
109109
{
110-
description: "if the service.alpha.openshift.io/serving-cert-secret-name annotation is deleted",
110+
description: "if the service.alpha.openshift.io/serving-cert-secret-description annotation is deleted",
111111
mutate: func(svc *corev1.Service) {
112-
delete(svc.Annotations, "service.alpha.openshift.io/serving-cert-secret-name")
112+
delete(svc.Annotations, "service.alpha.openshift.io/serving-cert-secret-description")
113113
},
114114
expect: true,
115115
},
@@ -197,7 +197,7 @@ func Test_internalServiceChanged(t *testing.T) {
197197
original := corev1.Service{
198198
ObjectMeta: metav1.ObjectMeta{
199199
Annotations: map[string]string{
200-
"service.alpha.openshift.io/serving-cert-secret-name": "router-metrics-certs-default",
200+
"service.alpha.openshift.io/serving-cert-secret-description": "router-metrics-certs-default",
201201
},
202202
Namespace: "openshift-ingress",
203203
Name: "router-internal-default",

0 commit comments

Comments
 (0)