Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

[source-kafka] Describe fails with runtime error if sink is not set #61

Description

@navidshaikh

Create a kafka source without sink and try describing it, it fails with runtime error as the nil check for Sink is missing:

Steps to reproduce:

  1. Create kafka source
kn source kafka create mykafkasrc --servers my-cluster-kafka-bootstrap.kafka.svc:9092 --topics test-topic --consumergroup test-consumer-group
  1. Describe it
kn source kafka describe mykafkasrc
Name:              mykafkasrc
Namespace:         default
Age:               3h
BootstrapServers:  my-cluster-kafka-bootstrap.kafka.svc:9092
Topics:            test-topic
ConsumerGroup:     test-consumer-group

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x134ad18]

goroutine 1 [running]:
knative.dev/client-contrib/plugins/source-kafka/pkg/factories.writeSink(0x184c360, 0xc00042dc50, 0x0)

[...]

Error: exit status 2
Run 'kn --help' for usage

Suggested fix:

Check for nil value here

writeSink(dw, kafkaSource.Spec.Sink)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions