Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move verbose log lines to debug #1269

Merged
merged 2 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 111 additions & 3 deletions config/crd/bases/rabbitmq.com_rabbitmqclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
name: rabbitmqclusters.rabbitmq.com
spec:
Expand Down Expand Up @@ -1484,6 +1484,18 @@ spec:
type: object
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -2101,6 +2113,18 @@ spec:
type: object
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -2725,6 +2749,18 @@ spec:
type: object
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -2967,12 +3003,43 @@ spec:
- conditionType
type: object
type: array
resourceClaims:
items:
properties:
name:
type: string
source:
properties:
resourceClaimName:
type: string
resourceClaimTemplateName:
type: string
type: object
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
restartPolicy:
type: string
runtimeClassName:
type: string
schedulerName:
type: string
schedulingGates:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
securityContext:
properties:
fsGroup:
Expand Down Expand Up @@ -3344,13 +3411,26 @@ spec:
type: string
name:
type: string
namespace:
type: string
required:
- kind
- name
type: object
x-kubernetes-map-type: atomic
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -3889,13 +3969,26 @@ spec:
type: string
name:
type: string
namespace:
type: string
required:
- kind
- name
type: object
x-kubernetes-map-type: atomic
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -4007,6 +4100,21 @@ spec:
memory: 2Gi
description: The desired compute resource requirements of Pods in the cluster.
properties:
claims:
description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand Down
6 changes: 3 additions & 3 deletions controllers/rabbitmqcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ func (r *RabbitmqClusterReconciler) Reconcile(ctx context.Context, req ctrl.Requ
}
}

logger.Info("Start reconciling")

instanceSpec, err := json.Marshal(rabbitmqCluster.Spec)
if err != nil {
logger.Error(err, "Failed to marshal cluster spec")
}

logger.Info("Start reconciling",
"spec", string(instanceSpec))
logger.V(1).Info("RabbitmqCluster", "spec", string(instanceSpec))

resourceBuilder := resource.RabbitmqResourceBuilder{
Instance: rabbitmqCluster,
Expand Down
3 changes: 2 additions & 1 deletion controllers/reconcile_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (r *RabbitmqClusterReconciler) runRabbitmqCLICommandsIfAnnotated(ctx contex
// plugins configMap was updated very recently
// give StatefulSet controller some time to trigger restart of StatefulSet if necessary
// otherwise, there would be race conditions where we exec into containers losing the connection due to pods being terminated
logger.Info("requeuing request to set plugins")
logger.V(1).Info("requeuing request to set plugins")
return 2 * time.Second, nil
}

Expand Down Expand Up @@ -113,6 +113,7 @@ func (r *RabbitmqClusterReconciler) runQueueRebalanceCommand(ctx context.Context
r.Recorder.Event(rmq, corev1.EventTypeWarning, "FailedReconcile", fmt.Sprintf("%s %s", msg, podName))
return fmt.Errorf("%s %s: %w", msg, podName, err)
}
logger.Info("successfully rebalanced queues")
return r.deleteAnnotation(ctx, rmq, queueRebalanceAnnotation)
}

Expand Down