pingcap / tidb-docker-compose

Apache License 2.0
351 stars 155 forks source link

separate condition statement #69

Closed zuiurs closed 5 years ago

zuiurs commented 5 years ago

what does this do

To avoid nil pointer reference, separate condition of if statement. This will prevent the error when we generate compose file for TiKV.

what is happened

I want to try to generate a compose file for TiKV. TiKV document says below.

Edit the compose/values.yaml file to configure the networkMode and host and comment the tidb section out.

https://tikv.org/docs/tasks/quickstart/

However, I got nil pointer exception when I commented out tidb section.

$ helm template compose
Error: render error in "tidb-docker-compose/templates/docker-compose.yml": template: tidb-docker-compose/templates/docker-compose.yml:104:33: executing "tidb-docker-compose/templates/docker-compose.yml" at <.Values.tidb.enableBinlog>: nil pointer evaluating interface {}.enableBinlog

This error is occurred by evaluating .Values.tidb and .Values.tidb.enableBinlog together. This is why I separate this condition statement.

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.

zuiurs commented 5 years ago

@tennix If you have the time, would you please review this?