Skip to content

Commit 22506e5

Browse files
authored
adjust log level (#617)
1 parent da0d0ab commit 22506e5

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

controllers/operandconfig/operandconfig_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (r *Reconciler) updateStatus(ctx context.Context, instance *operatorv1alpha
138138

139139
if _, ok := sub.Labels[constant.OpreqLabel]; !ok {
140140
// Subscription existing and not managed by OperandRequest controller
141-
klog.V(2).Infof("Subscription %s in the namespace %s isn't created by ODLM", sub.Name, sub.Namespace)
141+
klog.V(1).Infof("Subscription %s in the namespace %s isn't created by ODLM", sub.Name, sub.Namespace)
142142
}
143143

144144
csv, err := r.GetClusterServiceVersion(ctx, sub)

controllers/operandrequest/operandrequest_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func (r *Reconciler) UpdateNamespaceScope(ctx context.Context, namespacedName ty
226226
nsScopeKey := types.NamespacedName{Name: constant.NamespaceScopeCrName, Namespace: util.GetOperatorNamespace()}
227227
if err := r.Client.Get(ctx, nsScopeKey, nsScope); err != nil {
228228
if apierrors.IsNotFound(err) {
229-
klog.V(2).Infof("Not found NamespaceScope CR %s, ignore update it.", nsScopeKey.String())
229+
klog.Warningf("Not found NamespaceScope CR %s, ignore update it.", nsScopeKey.String())
230230
return nil
231231
}
232232
return err
@@ -282,7 +282,7 @@ func (r *Reconciler) addFinalizer(ctx context.Context, cr *operatorv1alpha1.Oper
282282
}
283283

284284
func (r *Reconciler) checkFinalizer(ctx context.Context, requestInstance *operatorv1alpha1.OperandRequest) error {
285-
klog.V(2).Infof("Deleting OperandRequest %s in the namespace %s", requestInstance.Name, requestInstance.Namespace)
285+
klog.V(1).Infof("Deleting OperandRequest %s in the namespace %s", requestInstance.Name, requestInstance.Namespace)
286286
existingSub := &olmv1alpha1.SubscriptionList{}
287287

288288
opts := []client.ListOption{

controllers/operandrequest/reconcile_operand.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (r *Reconciler) reconcileOperand(ctx context.Context, requestInstance *oper
7979
sub, err := r.GetSubscription(ctx, operatorName, namespace, opdRegistry.PackageName)
8080

8181
if apierrors.IsNotFound(err) {
82-
klog.V(2).Infof("There is no Subscription %s or %s in the namespace %s", operatorName, opdRegistry.PackageName, namespace)
82+
klog.Warningf("There is no Subscription %s or %s in the namespace %s", operatorName, opdRegistry.PackageName, namespace)
8383
continue
8484
}
8585

@@ -558,7 +558,7 @@ func (r *Reconciler) deleteCustomResource(ctx context.Context, unstruct unstruct
558558
if err != nil {
559559
return errors.Wrapf(err, "failed to delete custom resource -- Kind: %s, NamespacedName: %s/%s", kind, namespace, name)
560560
}
561-
klog.V(2).Infof("Finish deleting custom resource -- Kind: %s, NamespacedName: %s/%s", kind, namespace, name)
561+
klog.V(1).Infof("Finish deleting custom resource -- Kind: %s, NamespacedName: %s/%s", kind, namespace, name)
562562
}
563563
}
564564
return nil

controllers/operandrequest/reconcile_operator.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ func (r *Reconciler) reconcileOperator(ctx context.Context, requestInstance *ope
112112
}
113113
} else {
114114
// Subscription existing and not managed by OperandRequest controller
115-
klog.V(2).Infof("Subscription %s in namespace %s isn't created by ODLM. Ignore update/delete it.", sub.Name, sub.Namespace)
115+
klog.V(1).Infof("Subscription %s in namespace %s isn't created by ODLM. Ignore update/delete it.", sub.Name, sub.Namespace)
116116
}
117117
} else {
118-
klog.V(2).Infof("Operator %s not found in the registry %s/%s", operand.Name, registryInstance.Namespace, registryInstance.Name)
118+
klog.V(1).Infof("Operator %s not found in the OperandRegistry %s/%s", operand.Name, registryInstance.Namespace, registryInstance.Name)
119119
requestInstance.SetNotFoundOperatorFromRegistryCondition(operand.Name, operatorv1alpha1.ResourceTypeSub, corev1.ConditionTrue)
120120
}
121121
}
@@ -199,7 +199,7 @@ func (r *Reconciler) updateSubscription(ctx context.Context, cr *operatorv1alpha
199199
func (r *Reconciler) deleteSubscription(ctx context.Context, operandName string, requestInstance *operatorv1alpha1.OperandRequest, registryInstance *operatorv1alpha1.OperandRegistry, configInstance *operatorv1alpha1.OperandConfig) error {
200200
op := registryInstance.GetOperator(operandName)
201201
if op == nil {
202-
klog.V(2).Infof("Operand %s not found", operandName)
202+
klog.Warningf("Operand %s not found", operandName)
203203
return nil
204204
}
205205

@@ -230,14 +230,14 @@ func (r *Reconciler) deleteSubscription(ctx context.Context, operandName string,
230230
}
231231

232232
if r.checkUninstallLabel(ctx, op.Name, namespace) {
233-
klog.V(2).Infof("Operator %s has label operator.ibm.com/opreq-do-not-uninstall. Skip the uninstall", op.Name)
233+
klog.V(1).Infof("Operator %s has label operator.ibm.com/opreq-do-not-uninstall. Skip the uninstall", op.Name)
234234
return nil
235235
}
236236

237237
klog.V(3).Info("Set Deleting Condition in the operandRequest")
238238
requestInstance.SetDeletingCondition(csv.Name, operatorv1alpha1.ResourceTypeCsv, corev1.ConditionTrue)
239239

240-
klog.V(2).Infof("Deleting the ClusterServiceVersion, Namespace: %s, Name: %s", csv.Namespace, csv.Name)
240+
klog.V(1).Infof("Deleting the ClusterServiceVersion, Namespace: %s, Name: %s", csv.Namespace, csv.Name)
241241
if err := r.Delete(ctx, csv); err != nil {
242242
requestInstance.SetDeletingCondition(csv.Name, operatorv1alpha1.ResourceTypeCsv, corev1.ConditionFalse)
243243
return errors.Wrap(err, "failed to delete the ClusterServiceVersion")
@@ -255,6 +255,8 @@ func (r *Reconciler) deleteSubscription(ctx context.Context, operandName string,
255255
return errors.Wrap(err, "failed to delete subscription")
256256
}
257257
}
258+
259+
klog.V(1).Infof("Subscription %s/%s is deleted", namespace, op.Name)
258260
return nil
259261
}
260262

0 commit comments

Comments
 (0)