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

Fix NPE which breaks reconciliation when overrides are used without NodePorts #1456

Merged

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented Mar 19, 2019

Type of change

  • Bugfix

Description

When the external listener is set to nodeport and overrides are used without actually overriding the node port numbers, the findAny() call when looking for the node port configuration will fire an NPE and break the reconciliation. We need to add an additional check whether the node port is set or not.

See the following example resource which triggers the original bug:

apiVersion: kafka.strimzi.io/v1alpha1
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    version: 2.1.0
    replicas: 3
    listeners:
      plain: {}
      tls: {}
      external:
        type: nodeport
        tls: false    
        overrides:
          brokers:
          - broker: 0
            advertisedHost: 192.168.99.103
          - broker: 1
            advertisedHost: 192.168.99.103
          - broker: 2
            advertisedHost: 192.168.99.103
    config:
      offsets.topic.replication.factor: 3
      transaction.state.log.replication.factor: 3
      transaction.state.log.min.isr: 2
      log.message.format.version: "2.1"
    storage:
      type: persistent-claim
      size: 100Gi
      deleteClaim: false
  zookeeper:
    replicas: 3
    storage:
      type: persistent-claim
      size: 100Gi
      deleteClaim: false
  entityOperator:
    topicOperator: {}
    userOperator: {}

Checklist

  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally

@scholzj scholzj added the bug label Mar 19, 2019
@scholzj scholzj added this to the 0.12.0 milestone Mar 19, 2019
@scholzj scholzj requested a review from ppatierno March 19, 2019 00:01
@scholzj scholzj merged commit ad49ce3 into master Mar 19, 2019
@scholzj scholzj deleted the npe-when-extenral-listener-overrides-are-used-without-nodeport branch March 19, 2019 09:00
scholzj added a commit that referenced this pull request Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants