strimzi / strimzi-kafka-operator

Apache Kafka® running on Kubernetes
https://strimzi.io/
Apache License 2.0
4.8k stars 1.28k forks source link

[Bug] CruiseControl doesn't handle empty goals #3090

Closed im-konge closed 4 years ago

im-konge commented 4 years ago

Describe the bug When we want to deploy CruiseControl with empty goals or default.goals, Kafka will have error in it's status:

- lastTransitionTime: 2020-05-25T19:52:28+0000
      message: goals - Unsupported type class java.util.LinkedHashMap in configuration
        for this key
      reason: InvalidConfigParameterException
      status: "True"
      type: NotReady

To Reproduce Steps to reproduce the behavior:

  1. Add goals: {} or default.goals: {} to CC config

YAML files and logs

spec:
    cruiseControl:
      capacity:
        networkIn: 10000KB/s
        networkOut: 10000KB/s
      config:
        goals: {}

    ...

  status:
    conditions:
    - lastTransitionTime: 2020-05-25T19:52:28+0000
      message: goals - Unsupported type class java.util.LinkedHashMap in configuration
        for this key
      reason: InvalidConfigParameterException
      status: "True"
      type: NotReady

https://gist.github.com/im-konge/98b1a2649b4d48ac088763c6399ae3ae

ppatierno commented 4 years ago

As from documentation https://strimzi.io/docs/operators/master/using.html#ref-cruise-control-configuration-str you can specify Number, Boolean, or a String in the cruise control configuration fields. The goals is a String field and it represents a comma-separated list of goals classes as described in the cruise control official documentation. I think it's not a bug that you see then. The status is just saying you that you cannot use a "List" (because { } actually represents an empty List) as value.

scholzj commented 4 years ago

@ppatierno This is still a bug if the documentation gives you an example of using goals: {} and it needs to be fixed.

ppatierno commented 4 years ago

I didn't notice it was on the doc @PaulRMellor @laidan6000

im-konge commented 4 years ago

@ppatierno yes it's in examples and that was core of my question. I was wondering if it's a bug or mistake in documentation.

im-konge commented 4 years ago

https://strimzi.io/docs/operators/master/using.html#proc-deploying-cruise-control-str

d-laing commented 4 years ago

Bug addressed in #3107.

I removed goals: {} from the example Cruise Control configuration shown in "Deploying Cruise Control".